Align to QUAD not Poly?
Dont feel I explained what im trying to clearly so changed the title, I want to align objects to the centre of a quad's face, every time I try aligning to face it picks up the the two triangle faces.
vertexCount = getNumVerts $.mesh for i = 1 to vertexCount do ( my_House = Box name: "my_House" randomScale = [random 1 3, random 1 3, random 1 4] my_Copy = copy my_House my_Copy.rotation.controller.z_rotation = random 0 360 my_copy.Scale = randomScale newPos = getVert $.mesh i newPos = newPos * $.Transform my_Copy.pos = newPos )
I guess I need some way of collecting all the faces, finding their center point and normal direction then applying an object to those coordinates.
Thanks folks :)
Comments
Hei Vapourise, basically
Hei Vapourise,
basically you'd need some matrix-calculations to achieve this.
An easier way to do this might be that:
-----------------------------------
objsource = $Sphere001
obj2bealigned = $Box003
facenumber = 178
obj2bealigned.pos = polyOp.getFaceCenter objsource facenumber
obj2bealigned.dir = polyOp.getFaceNormal objsource facenumber
-----------------------------------
For testing purpose I wanted to align a Box (obj2bealigned) to a face of a sphere (objsource).
First I get the position of the center of that face.
And then I align the object onto the face-normal by using its "dir" property that faces always in the Z direction of the object.
-k.
"Arrogance kills."