如何将相机绑定到modelVisual3d对象(房间内)内 [英] How to bound camera inside a modelVisual3d object(inside a room)
本文介绍了如何将相机绑定到modelVisual3d对象(房间内)内的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好,
我创建了一个由3ds Max的天花板和地板的墙壁组成的房间,并通过测试了modelvisual3d对象来查找单击了哪个模型,但是我很难将相机限制在房间内.
我正在旋转,并根据需要移动相机的外观方向,但无法绑定相机.
请帮忙.
Sandesh Shakya
hello,
I have created a room which consists of walls ceiling and floor from 3ds MAX and have hittested modelvisual3d object to find which model was clicked, but i am having difficulty in bounding the camera inside the room.
I am rotating, and moving the look direction of camera as need but am not able to bound the camera.
Please help.
Sandesh Shakya
推荐答案
我找到了解决方案,
解决方案不是很好,但是我只能想到这种解决方案.
我计算了ModelVisual3D并得到了GeometryModel3D.bound,这给了我Rect3D.
现在,我比较了Rect3D.contains(相机位置),它满足了我的需求.
当然,在旋转时,您需要更新相机的位置,这是另一部分.如果有人得到更好的解决方案,请告诉我. :)
I found the solution,
the solution is not as good, but i could think of only this solution.
I calculated the ModelVisual3D and got the GeometryModel3D.bound which gave me Rect3D.
Now i compared the Rect3D.contains(camera position) which gave me what i needed.
Ofcourse while rotating u need to update the position of the camera, which is another part.If anyone get a better solution, let me know. :)
这篇关于如何将相机绑定到modelVisual3d对象(房间内)内的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文