View Full Version : Evenly spaced points with hermite function?

02 February 2011, 06:56 AM
Run this code is script editor:

int $i=0;
vector $start=<<0,0,0>>;
vector $end=<<10,0,0>>;
vector $tan1=<<10,30,0>>;
vector $tan2=<<10,-30,0>>;

while ($i<=10)
float $pointOnCurve[]=`hermite $start $end $tan1 $tan2 ($i*0.1)`;

spaceLocator -p $pointOnCurve[0] $pointOnCurve[1] $pointOnCurve[2];

So i want evenly spaced locators along this curve.

I read little about this , and i think what i need to do reparameterization of this curve(based on lenght).
But i don't know where to find info about this.

For example maya don't allow to rebuild bezier curve(this actually like hermite as i understand) so i don't know this is possible or not.

02 February 2011, 07:34 AM
well if you don't need a dynamic implementation, then you can simply go with "convert bezier to NURBS", then rebuild that nurbs curve uniformly.

02 February 2011, 07:54 AM
I need this for some particle expression , and i want to adjust hermite tangents in this expression , so maya bezier to nurbs conversion is not best idea here.

03 March 2011, 10:29 AM
I haven't run the script, but if you've created a curve and want locators placed down it's length you can attach a locator to the curve by using "attach to motion path" and then break the connection of the U-value in the motionpath1 node of the locator. 0 is the start of the curve and 1 is the end.

so by inserting 0.5 for U-value the locator will be placed exactly in the middle of the curve's length.

CGTalk Moderation
03 March 2011, 10:29 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.