Jump to content
  • Advertisement
Sign in to follow this  

Orientation along a composite bezier curve

This topic is 2530 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

Hey all,

I'm currently working on a problem where I'd like a row of equally spaced meshes to uniformly move along a spline. Additionally, I'd like the meshes to orient themselves along the spline. The mesh also loops back to the beginning when it reaches the end of the path.

I've already gotten the movement part working. My spline is a composite bezier curve that uses arc length parameterization to ensure a constant velocity as the meshes move along the spline. However, I haven't quite figured out the best way to handle orientation.

I've read about Frenet frames and I've already ruled out that option since my spline could have straight segments, as well as inflection points. The parallel transport frame seems like a better solution. However, it doesn't seem like I can arbitrarily pick a position on the spline and have it magically orient itself properly. This is important because when I set up the spline, I want to position my meshes uniformly along the spline. After I position a mesh on the spline, I also want to orient it correctly at that exact point. It seems like the parallel transport frame works by using an initial orientation and successively orienting the object. I can't just orient it at location t on the spline, because that requires knowing the previous tangent. I should add that the first mesh on the spline defines the initial orientation.

The only solution that I can come up with would be to construct a table of times mapped to orientations. During initialization, I can move the transport frame across the spline at delta time intervals and record the corresponding quat value. If I position a mesh at time t on the spline, I can just look up the quat in the table and slerp it to the correct orientation. I'd like to avoid having the table, but I can't think of an alternative solution. Does anyone have any other suggestions?

I've attached a pic to illustrate my setup. The spline and meshes are created in Max, exported, and reconstructed in my game.


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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!