# The Industry's Foundation for High Performance Graphics

1. ## matrix and rotation

Hy.
I have little mesh of 6 3dpoints(x,y,z) and i would rotate these 6 point by the 2 input axis direction.
I try to create a 3x3 rotation matrix and multiply it by 3dpoints
.
I transform all 3dpoint to a vector and multiply it by a matrix create from the axis.
but how i can create this matrix?
I have y axes and z axes directions.
is possible?
Thanks.

2. ## Re: matrix and rotation

First, obtain the X axis from the Y and Z:
Code :
`X = crossProduct( Y, Z )`

Then simply:
Code :
```matrix[0,i] = X.i
matrix[1,i] = Y.i
matrix[2,i] = Z.i```

Where i takes the values 0, 1 and 2

Note that you must normalize Y and Z first of all (before calculating X), and of course Y and Z must be orthogonal.

If Y and Z are not orthogonal, the solution is simple: once you have calculated X, recalculate Z with: Z = crossProduct( X, Y ). If you want to modify Y instead of Z, then do Y = crossProduct( Z, X ).

If it doesn't work, try swapping the matrix indexes, i.e. instead of matrix[0,i] = X.i try matrix[i,0] = X.i, because it depends on the language you're programming on.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•