Best way to implement this view/camera style?

Started by
1 comment, last by Supernat02 17 years, 9 months ago
I'm intending to create a view/camera where the entire scene is situated in front of you, and you can rotate the scene on the x,y and z stationary axises. For example imagine you have a floating ball in front you, which with your hand you yaw it on the y axis(up) by spinning it left or right, or you pitch it on the x axis(right), by spinning it away or towards you. The viewer's axises never change and the ball always rotates via these axises. I hope I've made that clear, my question is on the method of implementing this. Would it be best to rotate the world matrix via the stationary axises and have the camera stationary, and then multiply all the scene matrices to the word matrix before transforming them? or should i spin the camera's position, up, right around the scene? Which seems a little more difficult but better because it lessens the amount of multiplying matrices stated above. Also with this should I stick to matrices or would it increase the smoothness if I use a quaternion? thx
Advertisement
Hi. I would choose the fixed camera approach and transform the objects. I think this is simpler than doing the whole camera system.
You really wouldn't save anything, because either way you have to transform something. In the pipeline, it would concatenate the view matrix with the world matrix to get the world vertex position. Whether you set the view matrix or the world matrix is a mute point. If all you want to do is spin the object, you wouldn't have to manually multiply each vertex in the object by anything...and maybe this is what you were unclear about. Just set the world transform and you'll be fine.

Hope that helps,
Chris
Chris ByersMicrosoft DirectX MVP - 2005

This topic is closed to new replies.

Advertisement