[vtkusers] What co-ordinate system does the return value ofcamera->GetViewTransformMatrix() represent?
Veerapuram Varadhan
v.varadhan at gmail.com
Fri Jul 16 14:30:53 EDT 2004
Hi Drew,
Thanks for your time and explanation.
Though, I am confused with the values in the transformation matrix.
For ex: Let us consider a point in world co-ordinate system, say,
(100,100,0). Now, I perform a rotation. Now, I want to see the
transformed position of the point (100,100,0). Now, I get the
transformation matrix from the active camera.
Suppose, if I get values like
tM->Element[1] = {-0.900863, 0.2854167, -0.327081}
tM->Element[2] = {-0.196284, 0.9398594, -0.279532}
tM->Element[3] = { 0.381930, -0.1876199, -0.902707}
When I do,
newPoint[0] = tM->Element[0][0] * 100+tM->Element[0][1] *
100+tM->Element[0][2]*0;
newPoint[1] = tM->Element[1][0] * 100+tM->Element[1][1] *
100+tM->Element[1][2]*0;
newPoint[2] = tM->Element[2][0] * 100+tM->Element[2][1] *
100+tM->Element[2][2]*0;
will newPoint have the correct transformed co-ordinate of the point (100,100,0)?
Am I missing anything?
TIA,
V. Varadhan.
On Fri, 16 Jul 2004 14:02:58 -0400, Andrew J. Dolgert
<ajd27 at tc.cornell.edu> wrote:
> Maybe I can answer this while my contour filter renders...
>
> There are three coordinate systems you usually work with: camera,
> world, and actor. The view transform expresses world coordinates in the
> view space. The actor transform expresses coordinates in the view
> space. You specify the location of actors and cameras using world
> coordinates, though.
>
> In math lingo, you might picture the transformation matrices, M, like
> this:
>
> Camera - c_M_w - World - w_M_a - actor
>
> Call our coordinate vector by v_w for a world coordinate, v_c for
> camera, and v_a for actor.
>
> v_c = c_M_w * v_w and v_a = a_M_w * v_w
>
> The view transform is c_M_w. It's inverse we call w_M_c, but it's
> really (c_M_w)^-1.
> The actor transform is a_M_w. When VTK displays a point on the screen,
> it multiplies the actor coordinate by c_M_w * w_M_a, which is (view) *
> (actor)^-1, and then it multiplies by other stuff you don't seem to be
> delving into now.
>
> I don't think of the transformation matrix as being in any particular
> coordinate system unless you want to think of that matrix as composed of
> vectors for dot products.
>
> In answer to your TIA, I HTH.
> Drew
>
> > -----Original Message-----
> > From: vtkusers-bounces at vtk.org
> > [mailto:vtkusers-bounces at vtk.org] On Behalf Of Veerapuram Varadhan
> > Sent: Friday, July 16, 2004 1:21 PM
> > To: VtkUsers
> > Subject: [vtkusers] What co-ordinate system does the return
> > value ofcamera->GetViewTransformMatrix() represent?
> >
> > Hi All,
> >
> > I am using camera->GetViewTransformMatrix() to get the
> > current tranform matrix of the view. According to
> > vtkCoordinate documentation, camera values are represented in
> > "VIEW" co-ordinate system. Is it correct? or Did I mis-interpret it?
> >
> > To find out the transformation of a point in
> > World-Co-ordinate system, should i need to convert the
> > camera->GetViewTransformMatrix() values to World-Co-ordinate system?
> >
> > Any help is deeply appreciated.
> >
> > TIA,
> >
> > V. Varadhan.
> > _______________________________________________
> > This is the private VTK discussion list.
> > Please keep messages on-topic. Check the FAQ at:
> > <http://public.kitware.com/cgi-bin/vtkfaq>
> > Follow this link to subscribe/unsubscribe:
> > http://www.vtk.org/mailman/listinfo/vtkusers
> >
>
More information about the vtkusers
mailing list