[vtkusers] Dealing with 3D vectors
Andrew Maclean
a.maclean at cas.edu.au
Mon Nov 22 18:10:33 EST 2004
Look at vtkMath.
I would think that you would need to use a transform matrix.
Regarding computing rotation angles by projection, quaternions offer a
better way to do this. In "Real-Time Rendering" Moller, Hains edn2, pp51-53,
There is a nice method using quaternions for calculating the transform
rotating one vector to another. Look at:
http://www.acm.org/jgt/papers/MollerHughes99/ has some c-code to get you
started.
Andrew
-----Original Message-----
From: Jean-Marie Normand [mailto:normand at lina.univ-nantes.fr]
Sent: Tuesday, 23 November 2004 01:44
To: vtkusers
Subject: [vtkusers] Dealing with 3D vectors
Hi,
I'd like to know if there is a class designed to deal with 3D
(normalized) vectors. Basically I'd like to rotate a vector ((1,0,0) for
example) to make it fit another (normalized) vector which X,Y and Z
components (vx,vy,vx) are known. That is to say (1,0,0) should become
(vx,vy,vz) after the rotations.
I should be able to compute the rotation angles by projection on the OXY
and OXZ planes and then rotate the vector.
Is there a way to handle the rotations of vectors in 3D or do I need to
use the transformation matrix ?
Thanks in advance.
Jim
More information about the vtkusers
mailing list