Skip to main content
gamedev.net
🔒 Locked

Camera rotating

Started by LiOr 1 reply 350+ views
Original Post
LiOr
LiOr
Hello. I know it''s pretty simple to code but it''s just doesn''t work! What I''m to do is a pretty simple world , an object and a camera. let''s say for now that the object is a simple point in 3d. both the object and the camera is represented by matrix: (though I''m coding in java I''ll write it in simple writing) I have several matrix for each xrotate matrix yrotate matrix zrotate matrix trasformation matrix and each one have it''s position and all axis angles and each is first calculated in it''s own world space. rotating the point and moving it around worked perfect. the steps with rotating and moving the point was initialing each matrix with the angles or position and the multipling all the matrix together and at the end multipling the final matrix with the point coords. the problems begun when I added the camera. I did the same I did with the point and I thought that if I''ll multiply the final matrix of the point and the final camera matrix and then multipling the outcome with the point coords. well WRONG! didn''t work. So if anyone can help I''d apriciate it very much and 10x for anyone who reached this line , I know it''s a little bit long. sorry for my english!
coelurus
coelurus
It''s a bit hard to help you out when you can''t see the code. But DON''T send it, it''ll take too much place!

Remember that camera transformation is the opposite of normal transformation (-rx, -ry, -rz etc).

Also check out that you don''t transpose any matrix in some way (you never know...).

I don''t very much about problems with matrices, ''cause I haven''t had so many... Try look into your smallest function-call and the most tiny bit of declaration. That''s where the errors are!
LiOr
LiOr
10x , I''ll keep all of that in mind.
I think I''ve found a very good book on the subject.
Thank u all and bye

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.