Simply Maya User Community

Simply Maya User Community (https://simplymaya.com/forum/index.php)
-   Programming (https://simplymaya.com/forum/forumdisplay.php?f=32)
-   -   Object placement on a curve no aninimation (https://simplymaya.com/forum/showthread.php?t=5189)

nix21 15-04-2003 01:44 AM

Object placement on a curve no aninimation
 
I am currently working on a script where I place objects along a curve. This is not for animation, just placement on the curve.

Here is a snippet:

********************

float $pointOnCurve[] = `pointOnCurve -pr $tmp -p ($curveName[0])`;

move ($pointOnCurve[0]) ($pointOnCurve[1]) ($pointOnCurve[2]) ($nameObject[$temp-1]);

*******************

where $nameObject[] is the array containing the objects to be moved onto the curve.

My question is this---How do you get the objects to actually follow the curve, where rotation of object also goes with the curve, not just being placed on the curve?

Mabye this simple pic will clarify:

http://plaza.ufl.edu/nix21/melpic1.jpg

I basically want it to be like the "follow" commmand when attaching an object to a curve for animaion along the curve, however I don't want the animation.

Hope that's easy enough to understand.

thanks,
Nic

mark_wilkins 15-04-2003 05:25 AM

You can get the tangent to the curve by calling pointOnCurve with a -t flag, then rotate the objects to orient with that tangent direction.

-- Mark

nix21 16-04-2003 06:02 AM

thanks for the answer Mark. yeah I basically have been trying that and I at least have gotten the rotation working, using tangent constraint.

I actually saw something to that effect in your book with the helic particles around a curve. Great Book by the way, very helpful.

It works perfectly on a two dimensional curve, say in th xz plane, but when pulling up a point in the positive y direction it will cause the object to point outward(say down the z-axis, if the curve was made in the z direction).

-Is there anyway to force the object(say a cone) to remain pointing downward(down the y axis)?

thanks again,
Nic


All times are GMT. The time now is 11:27 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Simply Maya 2018