Jump to content
Site Stability Read more... ×
  • Advertisement
Sign in to follow this  
Aleks Le

XnaCollision Frustum rotation problem

This topic is 2116 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello everyone, this is my fist post, sorry if it is in the wrong section.

I am desperate for help, ive been trying to solve this problem for 2 days and its driving me crazy.


I Am working with Directx11 Api, for collisions i am using xnacollisions.h/cpp that can be found in the directxSDK examples;


xnacollisions provide me with all sorts of collision Boxes/spheres, it also allows me to create a Frustum from the camera view.


here is my problem.

(all functions with prefix XNA, are from xnacollisions)

XNAComputeFrustumFromProjection, creates the frustum from the camera values.


i then need to set the origin of the m_camFrustum, which is the position of the camera.


and then i also need to set the orientation of m_camFrustum which is the Quaternion representation of angles.


The camera in this game im working on is based on Euler angles.

and i found ways of converting euler to Quaternion.


The problem is i can not get the angles from my camera. i need to extract them from the matrix..?
another way i was thinking is calculating the angles(x,y,z) from the camera position to the cameraLookAt Position.

as i understand function XMMatrixLookAtLH() calcualtes taht angle and stores it in the cameraMatrix automatically.


How can i get the angles and store them in quaternion representation in order to rotate the frustum accordingly to the camera rotation?

Thanks, and sorry for mistakes if there are any.



Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!