PDA

View Full Version : Allign multiple (instance) objects to spline


daytona
05-06-2005, 01:20 PM
Is there a way to attach hundreds of the same objject (cubes, that all sit on the same plain) to one spline ( that sweeps around in 'S' shapes on the same XZ plain)? Just to complicate matters I need the objects to all face the same way.Is this possible? Please help.Thanks very much.

Darter
05-06-2005, 02:17 PM
If I understand what you want to do correctly, this can be done in XPresso with a Hierarchy node and Spline node. The attached expression gives a simple example.

The latest 3D Attack magazine has some more advanced examples by base80 using the new Instance Maker node, which are well worth a look.

Yet another option is the SplineTrain node at http://www.geocities.jp/westy_net

AdamT
05-06-2005, 02:21 PM
Functions>Arrange>Mode [Along Spline]

Darter
05-06-2005, 02:52 PM
Sorry, I have objects moving along splines on the brain at the moment and it's almost 1:00 am.

daytona
05-06-2005, 03:56 PM
Thanks Darter that looks great and it is the sort of thing I meant, ( without the movement) but I'm afraid I don't understand Expresso. I had a look at the hierachy and I didn't understand how to chang it to what I need to do. The job I'm doing is on a very tight timeline so I don't think I've got time to try and figure the Expresso way out. I like the idea of Adams "arrange" option But I can't seem to get it to work. What am I doing wrong and how would I space them? 1) create box and make multiple instances of it 2) create spline 3) Hi lite box and instances and select Functions, Arrange. Under mode select ' along spline' then under tool select 'apply'. Well that what i tried and nothing happened . DOH! Any one know how to get it to work. Oh forgot to mention , they need to be equally spaced along spline. Thanks

Darter
05-06-2005, 04:28 PM
Did you drag the spline into the Spline field for the Arrange tool before applying? If you know how many boxes you want, apply the tool and they will be distributed evenly if Start Pos = 0% and End Pos = 100%. After applying the tool, you can adjust the scale of the box until you're happy with the spacing between the instances

AdamT
05-06-2005, 04:46 PM
You have to drag the spline object from the OM into the Spline box in the Arrange dialogue. Now that I think of it, if you're using instances you'd be better off using the Duplicate tool. It works the same way but generates the instances automatically.

Darter
05-06-2005, 05:15 PM
If you have the latest 3D Attack, there are expressions for evenly distributing a number of instances along the full length of a spline. The Instance Maker node changes the number of instances based on the specified number or the specified distance between them. As their numbers change, the instances dynamically adjust their spacing along the spline to remain evenly distributed.

This is easy to set up, it's not even necessary to open the XPresso editor. The User Data for the expression are accessed in the AM and you drag in objects and enter values as with any other tool.

daytona
05-06-2005, 07:32 PM
I got it working. Thanks a lot guys, you were a great help!! Exactly what I needed. I don't have the latest 3D Attack. Any chance of posting the expression? Thanks again

base80
05-06-2005, 09:11 PM
I am keeping the xpresso only for readers of the magazine. This is because it is a beta. The xpresso contains a node that has especially been programed for me (and for the readers of the mag) And I will distribute it at my own discretion. This node creates instances from the xpresso editor and that is totally new.

Please bye the magazine and enjoy the node and the xpresso for yourself.

Darter knows I am a a pain in the a- on this one.

daytona
05-06-2005, 10:52 PM
Until I googled I didn't have a clue what 3D Attack was. I do now. I've subscribed, paid my subscription and am now using the above mentioned beta. It is BRILLIANT!!! My problem has been completely solved. Thanks very much everyone!

base80
05-06-2005, 10:56 PM
Have fun with the xpresso.
There are some issues with non-closed splines and multi segment splines that I will solve for one of the next magazines.

CGTalk Moderation
05-06-2005, 10:56 PM
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.