[vtkusers] Transform axes

Gib Bogle g.bogle at auckland.ac.nz
Wed Nov 5 23:36:36 EST 2014


Indeed, it is simple David, as I discovered after posting that query :)

Thanks
Gib
________________________________
From: David Gobbi [david.gobbi at gmail.com]
Sent: Thursday, 6 November 2014 5:34 p.m.
To: Gib Bogle
Cc: vtkusers at vtk.org
Subject: Re: [vtkusers] Transform axes

Hi Gib,

If I'm reading your question correctly, then what you are looking
for is very easy to achieve.

To transform an object from its canonical x,y,z axes onto a
new set of orthogonal axes, all you need is to set the first three
columns of a 4x4 matrix to those axes.

if the axis vectors are u, v, and w, then the transform matrix is

u_x, v_x, w_x, 0,
u_y, v_y, w_y, 0,
u_z, v_z, w_z, 0,
0, 0, 0, 1

No algebra involved!

 - David




On Wed, Nov 5, 2014 at 5:47 PM, Gib Bogle <g.bogle at auckland.ac.nz<mailto:g.bogle at auckland.ac.nz>> wrote:
Hi all,

This is a 3D geometry problem, one that many people must have solved.  I want to apply a transform to my actor to bring it's local axes (which are initially aligned with the global axes) into alignment with a specified triplet of orthogonal vectors.  In fact alignment with a pair is sufficient.  I'm hoping that somebody has done this in VTK and can save me the trouble of going through the algebra.

Thanks
Gib

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20141106/4263561e/attachment.html>


More information about the vtkusers mailing list