Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要引导整个模型完全进入视口。 因为如果模型的尺寸很大,它并没有完全进入视口,例如:
为了解决这个问题,我需要设置所需的相机位置:
camera.setPosition( new BABYLON.Vector3(216, 93, -17) );
例如: 测试页
如何自动计算模型将完全进入视口的相机坐标?
您可以设置:
camera.parent = yourMesh;
然后你可以改变:camera.position如你所愿
camera.position
但请注意:相机是父级,所以位置是相对于他的父级的!
所以你不能简单地使用你的向量: (216, 93, -17)