Jump to content
  • Advertisement
Sign in to follow this  
Turbowaffle

Steering in 3D space with roll and pitch

This topic is 2780 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 want to be able to steer AI ships in space, and I'm not sure the best way to go about it. To make it look a bit more 'realistic', I want to ships to steer with roll and pitch to seek their targets. What's the best way to find the roll and pitch angle needed to align the ship to a particular point? I can see the idea conceptually :

rotate.png

But it's been a few years since linear algebra so I'm quite rusty.

Share this post


Link to post
Share on other sites
Advertisement
Do you want full 6DOF motion (that is, there's no fixed 'up' vector and all rotations are about the object's local axes)? Or should all movement be relative to a fixed 'up' vector?

Share this post


Link to post
Share on other sites
Do you want banked turns? These only really make sense in the presence of gravity, but they look cool so you often see spacecraft doing them in sci-fi anyway. It's called "coordinated flight," and it gets its name because it "coordinates" the rudder and ailerons so that the centripetal acceleration that you get from your nonzero roll angle (there's a horizontal component to your lift then) agrees with the yaw rate you get from your rudder. This avoids side-slipping of the aircraft; your nose is always pointed in the same direction as your velocity vector.

Now what's a nice, fully 3d model of coordinated flight, appropriate for computer animation? I've sort of wanted an answer to this question for a while now, but nothing has been simple/pretty enough... Lemme see if I can come up with anything nice...

(This paper has a fairly pretty model, but it's not totally what we want... (And unless you're at a university it'll be locked behind a paywall for you.))

Share this post


Link to post
Share on other sites

Do you want full 6DOF motion (that is, there's no fixed 'up' vector and all rotations are about the object's local axes)? Or should all movement be relative to a fixed 'up' vector?


I'm not quite sure I understand your question, but I'll try to provide some more information. Though the idea is to eventually have a full 6 degrees of freedom, I'm starting simpler just so I can make sure I grasp the math. Rotations will be relative to the ships own local coordinate, but 'up' will be the same for all ships, that is, given a rotation matrix with no rotation, all ships will be aligned the same. However, rotations will be around each ship's local access, not some global axis.

Share this post


Link to post
Share on other sites

Do you want banked turns? These only really make sense in the presence of gravity, but they look cool so you often see spacecraft doing them in sci-fi anyway. It's called "coordinated flight," and it gets its name because it "coordinates" the rudder and ailerons so that the centripetal acceleration that you get from your nonzero roll angle (there's a horizontal component to your lift then) agrees with the yaw rate you get from your rudder. This avoids side-slipping of the aircraft; your nose is always pointed in the same direction as your velocity vector.

Now what's a nice, fully 3d model of coordinated flight, appropriate for computer animation? I've sort of wanted an answer to this question for a while now, but nothing has been simple/pretty enough... Lemme see if I can come up with anything nice...

(This paper has a fairly pretty model, but it's not totally what we want... (And unless you're at a university it'll be locked behind a paywall for you.))


You're right, banking doesn't necessarily 'make sense' in space, but the idea is to make it look pretty, and to give me a "simple" problem to get myself back into the math. When I've tried working out the problem, I seem to be making it more complicated than it should be. I don't need a detailed or realistic option right now, I just feel like I'm banging my head on a simple problem, though it might not be as simple as it looks to me.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!