Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Camera Rotation

This topic is 5379 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

I need help. I want to use a 3rd person camera for my app and have managed to implement rotation along the y-axis however i need to also do rotation along going up and down. But since there are 2 axises i can''t rotate it properly. Can someone help me??

Share this post


Link to post
Share on other sites
Advertisement
Camera questions never get decent replies. Don''t know if it''s because they''re always being asked. Most say cameras are really simple but no one can ever explain them properly.

However, after a lot of research there are a few camera classes out there that you may learn from. I, myself, do not fully understand them but maybe you will.

The one at gametutorials in the opengl section is ok, once you convert it to d3d. The one at ttp://www.ultimategameprogramming.com/DirectX1.htm is very similar to the one at gametutorials. I also had a german one somewhere but can''t find it, it was posted as a news item a couple months back.

Share this post


Link to post
Share on other sites
Yeah we should get somone to write a decent tutorial. Cause I asked a camera question before and got a crap answer too. Sorry if my own answer was crap! But no seriously we should have a decent one somwhere. There''s one on www.gametutorials.com but I don''t understand it very well, when I tried to copy it my program didn''t work quiet right.

Share this post


Link to post
Share on other sites
I already have the one from GameTutorials and it explains how to do rotation about the Y-Axis. What i want is rotation going up and down.

I am thinking that if i rotated about the strafe vector of the object i am looking at it should work, but what function rotates about an arbitrary angle. Oh yeah, there is D3DXMatrixRotationAxis but how would i use it? Would i pass the strafe vector in???

ANY CODE?????????? OR PSUEDOCODE???????

Share this post


Link to post
Share on other sites
quote:
Original post by dagamer34
I am thinking that if i rotated about the strafe vector of the object i am looking at it should work, but what function rotates about an arbitrary angle. Oh yeah, there is D3DXMatrixRotationAxis but how would i use it? Would i pass the strafe vector in???


That''s one way. Rotate around the Y axis, then rotate around the rotated strafe vector. The other way is to first rotate around the world X axis (which should be the strafe vector without rotation), then rotate around the world Y axis. Both do the same thing except the order is reversed.

Share this post


Link to post
Share on other sites
Umm... any code???? Besides, you would need to know how much to rotate and you can only do that if you know the angle of the vector from the view to the position. Any body know how to get the angle from a vector on a plane like the x-z( the one i will be using)???

And please post code too if you have it.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
It has been about some 360 days since I last visited these forums (I took some time off to ace my economics degree)... but I see that EXACTLY THE SAME QUESTION is still being made... please refer to previous posts as somebody surely has already said something before (at least over 1 year ago I responded to various posts with various degrees of dificulty).

The basics: you can use matrix conconation (or whatever the name) or some other maths principles, each has their own advantages and disadvantages (mind you, the other maths theories can be extremely useful and do some nice effects).
I prefer playing with matrices (it''s easier): make a rotation matrix, a translation matrix and another rotation matrix and as many matrices you feel like you need then multiply up the lot and TADA you''ve got what you always wanted. In other words: Y-rotation*translate*X-rotation, or just test other combinations and other orders and see if you get the result you desire, it just takes a few minutes to perform some tests and get the result you want...

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!