[vtkusers] What co-ordinate system does the return value ofcamera->GetViewTransformMatrix() represent?
Veerapuram Varadhan
v.varadhan at gmail.com
Fri Jul 16 15:24:44 EDT 2004
What for the 4th row of the view matrix is used?
If my math looks ok, here is another question.
Suppose after transformation, my original point (100,100,0) gets
transformed into (-210,320,112). What does the negative value
signify?
> I'd post back to the mailing list, but I just switched email and can't
> get my return address correct for a little bit, so the mailing list
> won't accept my posts.
>
I am keeping all our conversation and cc'ing it to the mailing list as well.
V. Varadhan.
On Fri, 16 Jul 2004 15:08:08 -0400, Andrew J. Dolgert
<ajd27 at tc.cornell.edu> wrote:
> Your math looks correct. You can look in vtkMatrix4x4.cxx for
> vtkMatrixMultiplyPoint in order to see it typed out. The only
> difference is that the code uses 4x4 matrices instead of the 3x3 you
> show. Each tM->Element[i] is a row of the view matrix.
>
> I'd post back to the mailing list, but I just switched email and can't
> get my return address correct for a little bit, so the mailing list
> won't accept my posts.
>
> Drew
>
> > -----Original Message-----
> > From: Veerapuram Varadhan [mailto:v.varadhan at gmail.com]
> > Sent: Friday, July 16, 2004 2:31 PM
> > To: Andrew J. Dolgert
> > Cc: VtkUsers
> > Subject: Re: [vtkusers] What co-ordinate system does the
> > return value ofcamera->GetViewTransformMatrix() represent?
> >
> > 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} Element[2] =
> > tM->{-0.196284, 0.9398594, -0.279532} Element[3] = { 0.381930,
> > tM->-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