[vtkusers] VTK Stereo - Help Rendering Left & Right Eye Separately
David Cole
DLRdave at aol.com
Tue Jun 13 11:55:34 EDT 2017
Another thing to recognize is that VTK camera space and zSpace camera
space are aligned with each other, but possibly at different scales,
depending on the physical meaning of your VTK world coordinates. But
they share the same origin, and point in the same directions. So if
you have coords in zSpace camera coords, you can just scale them to
get corresponding VTK camera coordinates.
VTK camera space is at the same scale as VTK world coordinates, but
the origin of the camera space is at the camera itself, and the axes
are defined as: +x to the right, +y up, +z is the cross-product of
those two (+x cross +y).
The camera's position is expressed in VTK world coords, and
corresponds to the camera origin, so the position is the translation
between camera space and world space. The rotation is whatever it
takes to align the x, y, and z axes given the above definition, and
the camera's ViewUp and ViewNormal vectors (also expressed in world
coords).
There's a matrix in the camera class which does this transform
already. If I'm looking at and interpreting the source code correctly,
it's the ViewTransform, computed in this method:
https://github.com/Kitware/VTK/blob/635e45b/Rendering/Core/vtkCamera.cxx#L349
You could empirically check that by getting that transform (or its
inverse) and calling TransformPoint, and observing the results using
(0,0,0) and camera->GetPosition(), and/or TransformVector and the
ViewUp and ViewNormal vectors.
HTH,
David C.
On Tue, Jun 13, 2017 at 10:50 AM, Teek <EZ7543 at wayne.edu> wrote:
> Okay I'm not quite sure what you mean when you say the coordinates for camera
> space.
> Would I be able to convert world coordinates to camera coordinates in any
> way?
>
> I can't seem to find any reference to SetEyePosition in the archive of the
> mailing list either.
> I've just been trying to set the camera position so I could see the cube
> source, however it seems that by default the camera locates itself at (0, 0,
> 0). Can't seem to figure out how to push it back to see the object using
> SetEyePosition.
>
> Let me know if I misunderstood something.
>
> Regards,
> Teek
>
>
> VTK - Users mailing list wrote
>> The trick with SetEyePosition calls is that they coordinates have to
>> be in **camera** space, not world space.
>>
>>
>> HTH,
>> David C.
>
>
>
>
>
> --
> View this message in context: http://vtk.1045678.n5.nabble.com/VTK-Stereo-Help-Rendering-Left-Right-Eye-Separately-tp5743559p5743635.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
More information about the vtkusers
mailing list