Setting Constant Velocity on a Path

Setting Constant Velocity on a Path

Hi folks,

I’m a graduate student at the University of Delaware and I am working on a research project that requires a particular animation capability. Presently we use Strata 3D and find that we cannot get it to do what we need with high precision.

What we want to be able to do is animate an object along a path and to have the object follow that path at a constant velocity.

With Strata, we use a bezier path and the program forces frame markers between event markers (control points) such that they are unevenly spaced all along the path. And it gets all messed up if the patch is tweaked. So the object appears to speed up and slow down all along the path and that is unacceptable.

Does Cheetah allow one to set the velocity, say at 5 cm/s, and then have it be constant along the path so that motion is smooth and not jerky?

Any help you can provide would be greatly appreciated.

Thanks,
Wilkey
 
Worst case in C3D you could script it.

(Has Strata added script language support?)

You could also do it in Blender / Python.
 
Thanks, Podperson. To tell you the truth, I had not explored scripts in Strata. We were hoping to do it with the animation controls alone. I will check it out.

Do you know what Cheetah script commands might be applicable for doing what we want?

Wilkey
 
No I haven't grappled with C3D's scripting yet. There are examples in the default installation, and the language is JavaScript.

Take a look at Bounce.js (it's in your C3D folder in Scripts / SplineObj).

var velocity = 0.5;
var height = 1.0;
var damping = 0.8;
var jumps = 5;
var g = 9.81;

function buildUI(obj){
obj.setParameter("name","Bounce");

obj.addParameterFloat("velocity",0.5,0,1000,true,true);
obj.addParameterFloat("height",1,0,1000,true,true);
obj.addParameterFloat("damping",0.9,0,10,true,true);
obj.addParameterInt("jumps",5,1,100,true,true);
}


function buildObject(obj){
var spline=obj.core();
var t=0.0;
var dt=0.0;

velocity=obj.getParameter("velocity");
height=obj.getParameter("height");
damping=obj.getParameter("damping");
jumps=obj.getParameter("jumps");


for(var i=0;i<jumps;i++){
var dt=Math.sqrt(2.0*height/g);

var start= new Vec3D(t*velocity ,0 ,0);
var lcont1= new Vec3D(t*velocity + dt*velocity/3.0 ,dt*(dt*g)/3.0 ,0);
var lcont2= new Vec3D((t+dt)*velocity - dt*velocity/3.0 ,height ,0);
var middle= new Vec3D((t+dt)*velocity ,height ,0);
var rcont1= new Vec3D((t+dt)*velocity + dt*velocity/3.0 ,height ,0);
var rcont2= new Vec3D((t+2*dt)*velocity - dt*velocity/3.0 ,dt*(dt*g)/3.0 ,0);
var end= new Vec3D((t+2*dt)*velocity ,0 ,0);


if(i==0) spline.move(start);
spline.curve(lcont1,lcont2,middle);
spline.curve(rcont1,rcont2,end);

t+=2*dt;
height*=damping;
}
}
 
Hi,
yes you can record it of course. Just select the spline tracking tag and make a right click on the record button in the time line. In the context menu you can record the position property of the spline tracking tag.

Cheetah3D also come with an example file in the animation folder which shows how to use the spline tracking tag for animation.

Bye,
Martin
 
Podperson and Martin,

Thank you for your guidance.

So Martin, if I understand you correctly, the Spline Tracking tag functions to fix the object velocity constant along the path? Is this for splines only or bezier?

Wilkey
 
OK -- I tried that and it worked once I realized that there's a bug in the "Only key changed parameters" toggle -- which never seems to think it changes. (Note that you need to use the second "Record Position" menu option ... the first refers to the object's position in space).

Just by the by -- the whole keyframe recording UI is one of the least intuitive nooks in C3D. I'm constantly making mistakes that cause me lost time and rework. One simple fix would be a "record from root" option (we could use something similar for recording poses) so that you don't constantly need to change your selection to record keyframes (and poses) properly.

I still don't know what all the toggle options are supposed to do (but then I've just found a bug, which may be one of the reasons I'm confused), and often end up recording a lot of junk I don't want to.
 

Attachments

  • position.jpg
    position.jpg
    27.5 KB · Views: 372
Last edited:
Hi,
ups that is a bug. The first position parameter is the position of the tag. I will probably remove it in the future but I currently have to maintain it for backward compatibility since the old UV tag uses it.

The second position parameter will be the position used in the spline tracking tag.

Sorry for the confusion.

Bye,
Martin
 
Just by the by -- the whole keyframe recording UI is one of the least intuitive nooks in C3D. I'm constantly making mistakes that cause me lost time and rework. One simple fix would be a "record from root" option (we could use something similar for recording poses) so that you don't constantly need to change your selection to record keyframes (and poses) properly.

Do you mean with record from root to record the hole scene? Since that would be very inefficient for big scenes.

If you want to record a hole branch of the scene you can turn the the record hierarchy button in the time line.

Bye,
Martin
 
Don't forget the other (more important) bug:

If I toggle on "Only key changed parameters" it simply won't key anything.
 
Hi,
did you turn on "Key all other parameters"? Otherwise only Position, Scale and Rotation tracks will be recorded.

Bye,
Martin
 

Attachments

  • Bild 1.png
    Bild 1.png
    13 KB · Views: 315
1) Why, yes I did :)

2) It doesn't (and shouldn't) matter if I'm explicitly recording position (right-clicking and selecting it)

3) It's not the problem -- see below:

Actually after more examination, it's not a "bug" per se so much as a subtle usability issue, i.e.:

"Only key changed parameters" prevents the first keyframe from being entered in any situation -- I guess you can't change away from not having saved a keyframe. This is a special case, but it's confusing.

And it's particularly confusing if, say, you've got keyframes aplenty, but none for the particular parameter in question.
 
Back
Top