Click here to Skip to main content
15,867,308 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
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
Posted
Comments
GPUToaster™ 4-Feb-11 4:23am    
As I understand you have created a room model and enabled collision detection on it. And you are not able to go inside the room because of the collision detection.Right?

1 solution

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. :)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900