Archived

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

dh1637

Quaternion question

Recommended Posts

dh1637    122
I am programming a space sim, the engine uses quaternions. My question is about the camera in my world, here is the problem: The camera''s rotation works fine as a quaternion. However, i found that the centre of rotation was always at the origin. The translation of the camera at this point was working.(i.e. it was relative to the direction in which the camera was pointing). I thought the origin problem could be a tranlate/rotate order thing, so i swapped the order. When i did this, the centre of rotation was where it should be (the camera''s position in world) but the translation of the camera did not correspond to the direction it faces. (i.e. i press ''forwards'' and the camera moves down the negative z direction (worldspace), irrespective of the camera''s orientation.) Is there a way to change the centre of rotation? or does what i describe suggest a problem with my code? Thanks, DH

Share this post


Link to post
Share on other sites