Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3694496
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T04:30:13+00:00 2026-05-19T04:30:13+00:00

I have an object with which I would like to make follow a bezier

  • 0

I have an object with which I would like to make follow a bezier curve and am a little lost right now as to how to make it do that based on time rather than the points that make up the curve.

.::Current System::.
Each object in my scene graph is made from position, rotation and scale vectors. These vectors are used to form their corresponding matrices: scale, rotation and translation. Which are then multiplied in that order to form the local transform matrix.
A world transform (Usually the identity matrix) is then multiplied against the local matrix transform.

class CObject
{
public:
 // Local transform functions
 Matrix4f GetLocalTransform() const;
 void SetPosition(const Vector3f& pos);
 void SetRotation(const Vector3f& rot);
 void SetScale(const Vector3f& scale);

    // Local transform
    Matrix4f m_local; 
    Vector3f m_localPostion;
    Vector3f m_localRotation; // rotation in degrees (xrot, yrot, zrot)
    Vector3f m_localScale;
}

Matrix4f CObject::GetLocalTransform()
{
    Matrix4f out(Matrix4f::IDENTITY);

    Matrix4f scale(), rotation(), translation();

    scale.SetScale(m_localScale);
    rotation.SetRotationDegrees(m_localRotation);
    translation.SetTranslation(m_localTranslation);

    out = scale * rotation * translation;
}

The big question I have are

1) How do I orientate my object to face the tangent of the Bezier curve?

2) How do I move that object along the curve without just setting objects position to that of a point on the bezier cuve?

Heres an overview of the function thus far

void CNodeControllerPieceWise::AnimateNode(CObject* pSpatial, double deltaTime)
{
    // Get object latest pos.
    Vector3f posDelta = pSpatial->GetWorldTransform().GetTranslation();

    // Get postion on curve
    Vector3f pos = curve.GetPosition(m_t);

    // Get tangent of curve
    Vector3f tangent = curve.GetFirstDerivative(m_t);

}

Edit: sorry its not very clear. I’ve been working on this for ages and its making my brain turn to mush.

I want the object to be attached to the curve and face the direction of the curve.

As for movement, I want to object to follow the curve based on the time this way it creates smooth movement throughout the curve.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T04:30:14+00:00Added an answer on May 19, 2026 at 4:30 am

    You should have a curve in parametric form and use derivative vector to evaluate the rotation of your object (rotation angle = derivative angle) as @etarion said.

    To move the object on a curve with a desired velocity ( i think it is the think you want) each simulation step you shoud estimate the distance the point should move on this step.

    The simplest estimation is dist = derivative.length()*TIMER_STEP. When you know the dist should be traversed on the current step and t0 – the current parameter of the curve you can simply increment t0 by some little value epsilon and check the traversed distance is still smaller then estimated. Repeat this until the traversed distance (while increasing t0) is >= estimated. This will be the new current parameter t0 for the next step

    EDIT:

    Didn’t notice first you are in 3d. In 3d space you can’t unambiguously define the position of an object on a curve even if you know the initial position. Just imagine your curve is a line – the object still can rotate around the line. This angle is not defined by a curve.

    I would do something like this. Let’s bind a vector to the object so that in the beginning of the movement (curve parameter t = 0 for example) the object vector direction coincide with the derivative vector. Then during the movement this vector should still coincide with the derivative in each point of a curve. So you will know this object vector and will be able to setup your object according to this vector. But you will still have one degree of freedom.

    For example you can say that object does not rotate around this vector.

    Knowing the object vector and the angle of rotation around it you can restore the object orientation in 3d world.

    PS: such object vector and a rotation angle around it is called quaternion – so you can use quaternion math (simple copy the required formula) to calculate the object rotation matrix!
    here are the formulas http://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToMatrix/index.htm

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a dictionary object which i would like to encrypt, then put it
I have an IEnumerable<KeyValuePair<string,string>> , from which I would like, ideally, an anonymous object
I have an NSArray of NSDictionary objects which I would like to be able
I have a List of objects which are ordered. I would like to remove
I have an object which has several properties that are set when the object
I have class World which manages creation of object... After creation it calls afterCreation
I have an array of DataRow objects in my C# project which I would
I have object A which contains multiple instances of object B, which in turn
I have this object which is an instance of a superclass. I want to
I have an object which contains models for my ASP.NET MVC web app. The

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.