[vtkusers] Setting up camera for OpenGL render

Impdive thrawn.chimera at gmail.com
Fri Nov 28 23:43:22 EST 2014


I'm trying to do some volume rendering in OpenGL using 3D textures and
billboarding, and so I'm essentially drawing a series of planes along the
z-axis (or normal to the z-axis if you prefer).  I'm using VTK's windowing
and rendering tools for this, and I'm struggling to get my camera working
right.  My volume rendering is based on a 64x64x64 rectilinear grid, so I
thought I would use 
SetFocalPoint(32,32,32);
to set the focal point to the center of the grid, and then I could just have
my camera direction be something like SetPosition(0,0,-1) or
SetPosition(0,0,1).  That didn't work - I got a completely black screen, and
rotating the camera didn't seem to help.  

Doing something like this: 
  rens[0]->GetActiveCamera()->SetFocalPoint(32,32,32);
  rens[0]->GetActiveCamera()->SetPosition(100,100,100);
  rens[0]->GetActiveCamera()->SetViewUp(0,1,0);
  rens[0]->GetActiveCamera()->SetDistance(100);

(rens[0] is my vtkRenderer here)

would allow the planes to come onscreen if I scrolled on the trackpad
persistently enough, but they were still at an angle rather than facing me
dead-on.  Could anyone help me figure out why my initial understanding was
incorrect, and what I should be doing instead?  Thanks so much.



--
View this message in context: http://vtk.1045678.n5.nabble.com/Setting-up-camera-for-OpenGL-render-tp5729587.html
Sent from the VTK - Users mailing list archive at Nabble.com.


More information about the vtkusers mailing list