hello eppo i find now your solution, is the :
Q39. How do I generate a rotation matrix to map one vector onto another?
then i can find the rotation axis(with the cross product) and the angle(with dot product) and use the generic formula for rotate around an arbitrary axis?
and, in base at my last post i can rotate also the 2d shape in 3d with the same process?
thanks guys, very kind of you for your help.
now i wish express better my problem:
1)i have a 2d shape that i must extrude
2)i have an extrude direction that can be any normalized dir.
3)the 2d shape in 3d is flat, i must rotate it before extrude it and i must rotate ortogonal at the extrusion direction but how?
in the first 2 topics i would rotate the extrusion of a flat 2d shape in the z axis, but i understand haegarr and i would rotate the 2d shape before extrude the solid.
But i not understand haegarr about the inverse matrix, can you explain me better this trick?
1)is better do the extrusion of the 2d shape on the z axis then rotate the solid by the direction of the extrusion?
2)or is better rotate the 2d shape in 3d then do the extrusion by the extrusion direction?
these are the questions, how i can do that?
eppo i don't find your advice in your link.
but my problem is that the dir vector can be in any direction, also can have a rotation component in all the planes, es 30° in xy plane, 12 ° in yz , 24° in xz plane ecc....
i must find a rotation matrix for all the rotation components in all the planes for the dir vector and i not know how.