[vtkusers] VTK Stereo - Help Rendering Left & Right Eye Separately

Teek EZ7543 at wayne.edu
Tue Jun 13 17:41:54 EDT 2017


I actually just left out zSpace for now so I could understand how to use the
SetEyePosition properly.
See Code <https://app.box.com/s/mj3dxeu64rmjpvxvdnf1qho88dugyzyn>  

I essentially am just trying to create a cube in stereo and then use
SetEyePosition to set the left and right camera views in stereo rendering.
I'll probably incorporate zSpace once I can figure this out.
Thanks again for you help thus far.

So if the camera is also the origin in camera space, I'm confused as to how
you can SetEyePosition (of the camera) using camera coords since it will
always be the center. This also explains why if I create a camera and set
the eye position, it seems to just be at the center of the cube.

Unless, you mean to say that the camera is originally at an arbitrary
location which is defined as camera space. Then those coordinates are
transformed into VTK world space coordinates.

--

I also tried:
/camera->GetEyePosition(eyePosition);
cout << eyePosition[0] << ", " << eyePosition[1] << ", " << eyePosition[2]
<< endl;

renderer->SetActiveCamera(camera.GetPointer());
renderer->ResetCamera();

camera->GetEyePosition(eyePosition);
cout << eyePosition[0] << ", " << eyePosition[1] << ", " << eyePosition[2]
<< endl;/

However it returns 0, 0, 0 for both even though the views are different
before and after I reset the camera.


VTK - Users mailing list wrote
> 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.





--
View this message in context: http://vtk.1045678.n5.nabble.com/VTK-Stereo-Help-Rendering-Left-Right-Eye-Separately-tp5743559p5743639.html
Sent from the VTK - Users mailing list archive at Nabble.com.


More information about the vtkusers mailing list