PDA

View Full Version : A slightly crazy idea..Aligning particle/object rotation to nearest spline tangent?


DaveWortley
01-07-2009, 08:21 PM
I'm doing a bit of an unusual project at the moment.

I've got a few thousand particles on a plane and at the moment their rotation is locked in 2axis but random in the 3rd. I'd like to influence this rotation value by getting the particle to look for the nearest spline and rotating to the tangent of the closest point.

I've tested one way that I thought I might be able to do it, by putting an extrude on the splines and using the MeshProjectionInterface.getclosestFace() then work out the angle of the face and translate that to the particle. But I haven't been able to get this to work. It loops through the particles and the GetFace always equals the same face, and for some reason even if I try assigning the particles' position to the GetHitPos value the particles stay where they were.

I'm lacking in a bit of knowledge on how the MPI works, only finding out through BoBo's latest scripting DVD.

I have thought about painting a map to define rotation using 2 colours but it's going to be a real pain to draw.

Any other ideas?

DaveWortley
01-07-2009, 09:27 PM
Or I could simply put on my dunce cap and realise I could do this all with Find Target instead! much quicker and easier! :)

JHN
01-08-2009, 07:39 AM
When do you know you're a technical artist: "You, most of the time, overcomplicate the obvious". ;)

-Johan

DaveWortley
01-08-2009, 09:44 AM
When do you know you're a technical artist: "You, most of the time, overcomplicate the obvious". ;)

-Johan

Haha, will remember that one!

Been watching too many scripting tutorials, getting dangerously close to scripting my entire flow.

LoneRobot
01-08-2009, 10:47 AM
When do you know you're a technical artist: "You, most of the time, overcomplicate the obvious". ;)

-Johan

darn it! i might have to stop working on my procedural teapot plugin! :D

JHN
01-08-2009, 11:01 AM
Yeah, I put my opensource maxscript raytracer back on the shelf too, when my collegue told me we were probably not going to use it in production, he showed me this tool called mentalray, seems to do the same thing I wanted to do....

-Johan

CGTalk Moderation
01-08-2009, 11:01 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.