Page 1 of 1

Move object by curve.

Posted: Fri Jan 19, 2007 7:47 pm
by Magnet
I have a model (such as):
Image

I am move this model by curve.
I want to realize slide my model by this curve.
In each step I have last position and current.
How to ROTATE my model for making the imitations of the repetition of the curvature:
Image

Posted: Fri Jan 19, 2007 8:03 pm
by vitek
There are several posts about rotating nodes to line them up with a vector, and that is exactly what you are trying to do. You want to align the axis (looks like the X axis in your drawing, but you might actually want the Z) to line up with the vector lastPos - curPos.

Travis

Posted: Fri Jan 19, 2007 8:14 pm
by Magnet
I it is necessary that model was clinging to curve.

I do the swimming of fish on curve.
I d'not know as it is correct align the model. And how to calculate model rotation.

Posted: Sat Jan 20, 2007 6:27 pm
by arras
for some exact results you would need yur curve to be defined by some function.

But I would simply store old position in last frame, calculate future position in next frame, than find out angle from current position to old and future one, add it together then cut it by 2 and you end up with something very close of what you need.