Animate a plane along a cubic curve

This topic is 5400 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

I have a simple representation of a plane being a rectangle for the body and another rectangle for the wings. This is all in 3D. I want to animate this plane along a cubic curve but i have to tilt the plane with the curve. I want to divide this curve into five segments and draw the plane at each point of these segments. I have no idea how to accomplish any pointers would be great thanx for the help. Bignester

Share on other sites
Let f(t) be your path curve function (t is time).
You could align the plane along the vector f(t + d) - f(t - d), where d is some small time increment.

Share on other sites
yes. to elaborate on the above:

you can get one vector associated with the curve by taking its derivative. however, you need more than one direction to define a complete orientation in 3d. so you can also take the second derivative (both analitical btw).

if you normalize both these directions, then take the crossproduct, youve got three orthogonal vectors, which you can interpret as the column vectors of a transformation matrix.

i think that should give quite a natural orientation of the objects along your path aswell.

Share on other sites
That's called the 'osculating plane' - should be contained in a good calculus book or you can google for it.

Share on other sites
all right now my question is how do i get the z point from this equztion.

y=ax^3+bx^2+cx+d

There is only a y and a x, I know this is a simple math question if I can get my 5 sample points I believe I can finish the rest.

thanx again for the help.

Share on other sites
Hi,

You'll need to be comfortable with calculus for sure. This should help though:

www-2.cs.cmu.edu/~fp/courses/ graphics/asst5/cameraMovement.pdf

I'm sure Dave Eberly's magic site (please google for it) has a document on this, specifically re-parameterisation by arc length. I successfully used this technique for fish shoaling movements along a spline. Good luck!

Cheers,

Martin.

Share on other sites
Quote:
 Original post by Anonymous Posterhow do i get the z point from this equztion.y=ax^3+bx^2+cx+dThere is only a y and a x

If z is not part of the path function, then z is undefined, and there is not way to extract a z component for the vector. In other words, your plane's z position does not change within the path, so the z component of the plane's orientation is always 0.

I'm a bit rusty on my math, so someone let me know if I'm wrong here.

Share on other sites
I was just told that a,b,c,d are all vectors and that X,Y,Z are independent. If so then do the vectors have three different elements for the X,Y,Z direction.
modified function
U(t)=a*t^3+b*t^2+c*t+d (where a,b,c,d are vectors) am I completely wrong here.

Share on other sites
Quote:
 Original post by Anonymous PosterI was just told that a,b,c,d are all vectors and that X,Y,Z are independent. If so then do the vectors have three different elements for the X,Y,Z direction.modified functionU(t)=a*t^3+b*t^2+c*t+d (where a,b,c,d are vectors) am I completely wrong here.

If this is the case, then your plane's orientation ("tilt") will be a vector tangent to the curve. You could find this tangent line using calculus, or you could approximate it using the function I gave before, or something similar:

v = U(t + n) - U(t - n), where v is the plane's orientation and n is a small time interval.

• 18
• 29
• 11
• 21
• 16