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


orienting an object in 3d space

Recommended Posts

So now I''ve got a free-roaming camera that can pitch, roll, and yaw thanks to the great camera article in Game Programming Gems I. But now, I tried to apply the same system to a game entity with an arbitrary position, and this no longer works. The function presented in GPG for deriving a forward, up, and side vector from a pitch, roll, yaw always assume that your pitch, roll, and yaw are based around the origin (perfect for a camera). But when you start dealing with entities things get tricky because you''re going to yaw a bit to one side, then pitch by that new side vector at an arbitrary point in space. I realize I could get this to work very simply using quaternions for entity orientations BUT I need to be able to get the entity''s forward, up, and right vectors to do things like strafe along the side vector or launch projectile in the entity''s forward vector. Can anyone explain a way to do this? Thanks, Justin

Share this post

Link to post
Share on other sites