Original Post
🔒 Locked
getting transformation matrix
Advertisement
Quote:It could be defined through an infinite number of 4x4 matrices. So to give you a more useful answer, we need to know more - what you need the matrix for, what local space (if any) the quad vertices were originally defined in, etc. Is this for billboarding? Something else?
say i have a face (quad) in my 3d space, then its position + orientation can be defined through one 4x4 matrix, right?
Anyway, give us a little more info and I'm sure someone will be able to answer your question.
If you know the winding order of the face then it should be possible. The center of the face would be the position. The normal of the face would be the look vector. The first 2 vertices in the winding order can be used as the up or right vector(which can be determined if you also have the texture coordinates of the vertices). Take the cross product obtain the last missing vector, then you should have the 4x4 matrix.
The normal/look vector corresponds to r31, r32, r33.
You will need more information about the face to calculate the up(r21, r22, r23) and right(r11, r21, r31) vectors. If you know which vertex corresponds to which corner of quad, then it should be easy. For example, suppose vertex A is the top left corner and vertex B is the top right corner, the B-A will give you the right vector.
You will need more information about the face to calculate the up(r21, r22, r23) and right(r11, r21, r31) vectors. If you know which vertex corresponds to which corner of quad, then it should be easy. For example, suppose vertex A is the top left corner and vertex B is the top right corner, the B-A will give you the right vector.
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement