I'm writing a script to align sprite on selected faces of a object.
But I dont know how to rotate the sprites to align them to the face normal.
A friend talk to me about "quaterion" , I search on internet and MS ref but i'm not familiar with matrix (yes I know, its bad if i want to use MS but I begin ^^ ) so I dont know how to use it well to do what I want.
here is the fonction where I start working on my sprite:
function WorkOnSprite FaceID NumID ScaleVar = (
AttaSprite_Copy = copy AttachSprite_Sprite
AttaSprite_Copy.name = "Sprite_Face"+FaceID as string+"_"+NumID as string
--print ("Sprite copy name : "+AttaSprite_Copy.name)
AttaSprite_Copy.scale *= random (1-(ScaleVar/100)) (1+(ScaleVar/100))
--print ("getFaceCenter : "+polyOp.getFaceCenter AttachSprite_Source FaceID as string)
--print ("getFaceNormal : "+polyOp.getFaceNormal AttachSprite_Source FaceID as string)
--print ("getFaceArea : "+polyOp.getFaceArea AttachSprite_Source FaceID as string)
AttaSprite_Copy.pos = polyOp.getFaceCenter AttachSprite_Source FaceID
--here i want to rotate the sprite copy to align it with the normal of the face
I'll ask other question but I prefer solve this one first ;)
ps : sorry for my english, I'm a french user.