Open xiaxiangfeng opened 10 months ago
Without a live, editable example it's not possible to debug - but there must be sometihng wrong with your integration with Mapbox since the model works in the live example in this project:
That aside your initialized "near" and "far" values are not valid, though it's not clear if this would cause issues.
camera = new THREE.PerspectiveCamera(
28,
window.innerWidth / window.innerHeight,
0.000000000001,
Infinity
);
https://github.com/xiaxiangfeng/3DTilesRendererJS.Test/tree/main/docs
I created this dome on the codepen. I guess it should be the same issue with mapboxgl syncing with threejs, but I don't know how to fix this, hope I can get your help
codepen
I've taken a look at the codepen and these settings strike me as odd:
this.cameraTransform = new THREE.Matrix4()
.makeTranslation(x, y, z)
.scale(new THREE.Vector3(scale, -scale, scale));
const mercatorMatrix = new THREE.Matrix4().fromArray(matrix);
camera.projectionMatrix = mercatorMatrix.multiply(this.cameraTransform);
I don't know how the render mapbox API works but please make sure the transformations and projection are set correctly on the threejs camera - these are required for the tiles renderer to function.
I have resolved this issue and make a PR. Waiting for merge
I have resolved this issue and make a PR. Waiting for merge
Currently, there are still problems that have not been solved when using mapboxgl. The specific how to use it and the existing problems are in the PR at the address below. I hope someone can complete this PR or provide some help and suggestions in the future.
Describe the bug
After adding 3Dtiles to mapboxgl using 3DTilesRendererJS, the model disappears when the rotated map is greater than 180 degrees
To Reproduce
Steps to reproduce the behavior:
Code The address of the code on GitHub
https://github.com/xiaxiangfeng/3DTilesRendererJS.Test/tree/main/docs
Live example https://xiaxiangfeng.github.io/3DTilesRendererJS.Test/mapbox.three.camera.3dtiles.html
Expected behavior
Display normally during rotation
Screenshots normal
bug Disappears after rotating 180 degrees
Platform: