Notifications
Clear all

[Closed] A slightly crazy idea..Aligning particle/object rotation to nearest spline tangent?

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?

5 Replies

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

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.

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

 JHN

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