Skip to main content
gamedev.net
🔒 Locked

rotating view point?

Started by ricki Aug 26, 2000 at 5:58 AM 1 replies 550+ views
Original Post
ricki
ricki
hi...i''m trying to solve a little problem with my d3d engine... 1)i load an object 2)set rotations and translations on a matrix 3) when i put that matrix on VIEW or WORLD matrix, it translate correctly(the z translation has mad along my eye''s direction) but the object rotate''s around 0,0,0 world coordinates. so if i move near an object and try to rotate, it rotate not around the current (x,y,z) view position.... wha can i do to correct translate & rotate? ricki
Antknei
Antknei
Are you sure that you are rotating the object at the origin and then translating? If you are just adding additional rotations each frame to the current matrix, you will see what you are seeing. You will need to translate your object to the origin, rotate it, then translate it back to its current point.

Or if you are building a position matrix every frame, you could simply have the order of your matrix operations wrong. try changing the order of the operations that you use to build your matrix.



Edited by - Antknei on August 28, 2000 9:22:23 AM
ricki
ricki
i''m using d3d matrix....
first i make a translation matrix, then YawPitchRoll matrix....
so, my viewing matrix is: View = Translation * Rotation

the d3d make the rotations during rendering...so, for translating every object at his origin, rotate and then retranslate i''ve to write matrix application.......

Topic Locked

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

Sign in to reply to this topic.