object rotation according to a face normal

hi ,

I want to make a script to lay down a collection of object on a noisy floor
I partially do this by definig a ray and position my object at the intersection. This part works well. My problem is rotation of my object.
I would like to find a way to rotate my object accordingly to a face normal, for my object is perfectly parellel to this face.

Does anybody have a clue ?

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
schaf82's picture

Hallo MrGAG  If you open up

Hallo MrGAG

 If you open up your maxscript helpfile and look for

How do I align the UVW_Modifier's Gizmo to a selected face?

 your problems should get solved..

and since your intersectRay gives you the face_normal you shoudl have alle information you need

 maeh maeh

schaf

maeh maeh

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.