www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: Dinin on May 09, 2012, 03:10:57 pm

Title: Rotate SimpleVector around arbitrary axis
Post by: Dinin on May 09, 2012, 03:10:57 pm
Hi !

I want to rotate a SimpleVector around a arbitrary axis.
Matrix and Object3D has already a Rotate with a parameter SimpleVector for a arbitrary axis, but SimpleVector not.
So i tried to get Rotationmatrix from the Vector to rotate, rotate the matrix around my axis and then ...

SimpleVector has no SetRotationMatrix and so i dont know how to get the rotationmatrix back to SimpleVector.
Perhaps i can use SimpleVector.Rotate(Matrix), but for that i need a 'differenz Matrix' of the old and new (after Rotation of matrix) Matrix, and i dont know how to get.
A simple minus of the 2 Matrix did not work.

Any suggestions how to solve this ?

Thanks and greeds
Dinin
Title: Re: Rotate SimpleVector around arbitrary axis
Post by: EgonOlsen on May 09, 2012, 08:45:46 pm
Just matMul the SimpleVector with a rotated Matrix.
Title: Re: Rotate SimpleVector around arbitrary axis
Post by: Dinin on May 19, 2012, 07:35:02 pm
 :) thanks for help.