f97ao
09-21-2004, 11:26 PM
Well this should be very simple, but I kept banging my head against it last night and couldn't get it to work.
What I want to do is to place an object and rotate it correctly onto a face of an poly. So exactly like the autogrid.
This is what I write:
tPos=polyOp.getFaceCenter $ iFace node:#World
tNormal=polyOp.getFaceNormal $ iFace
tm=matrix3 1
tm=matrixFromNormal tNormal
newObject.rotation=inverse tm-rotationpart
newObject.pos=tPos
I'm thinking that perhaps I'm mixing coordinate systems or something like that.
/Andreas
What I want to do is to place an object and rotate it correctly onto a face of an poly. So exactly like the autogrid.
This is what I write:
tPos=polyOp.getFaceCenter $ iFace node:#World
tNormal=polyOp.getFaceNormal $ iFace
tm=matrix3 1
tm=matrixFromNormal tNormal
newObject.rotation=inverse tm-rotationpart
newObject.pos=tPos
I'm thinking that perhaps I'm mixing coordinate systems or something like that.
/Andreas
