使用 Away3D,如何操作相机,以便始终看到所有场景对象?
我遇到的问题是场景中的对象一直在移动。我有一个悬停相机,它也会改变角度,但我需要它根据场景的尺寸自动放大和缩小,以便整个场景始终在视野中。当然,当它悬停时,它会来回移动,但这显然是不够的,因为很多物体仍然看不见。
The problem that I'm having is that objects in my scene move around all the time. I have a hover camera, which also changes angles, but I need it to sort of zoom in and out automatically, based on the dimensions of the scene, so that the whole scene is always in view. Sure, when it hovers, it moves back and forth, but it is obviously not enough, because a lot of objects remain unseen.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要首先检查场景中每个对象的 x、y、z。然后您找到具有最高和最低值的那些。例如,最左边的 X 值最低。然后您需要相应地修改相机的变焦或相机的位置。
You would need to start by checking the x,y,z of each object on the scene. Then you find those with the highest and lowest values. For example, extremely far left would have the lowest X value. Then you need to modify your camera's zoom or the camera's position accordingly.