[vtkusers] Need help integrating VTK with an existing OpenGL application (translating glFrustum and gluLookAt calls to VTK)

Lasso, Andras (GE Healthcare) Andras.Lasso at med.ge.com
Tue Jan 15 05:23:31 EST 2008


Mark,

You can create your own camera class based on vtkCamera (or
vtkMesaCamera) and override GetPerspectiveTransformMatrix to set any
arbitrary perspective transformation.

Andras


On Thu, 3 Jan 2008, Alethea Bair wrote:

> That's not quite correct. There is no way to use glPerspective to get 
> non-regular trapezoids for the frustum shape. glFrustum does allow
this.
> Unfortunately, I don't know enough about vtkCamera to give advice
there.
>
> -Alethea
>
>> You can calculate the values of six arguments of glFrustum from the 
>> four arguments of gluPerspective, and vice versa.
>>
>> Weiguang
>>
>> On Thu, 3 Jan 2008, Mark Waligora wrote:
>>
>>> Weiguang,
>>>
>>> Thanks for the reply.  I have no problem using the vtk classes in 
>>> place of code that I already have.  My issue is that I'm not certain

>>> how to use the vtkCamera in place of my glFrustum call when I am 
>>> creating a frustum where, for example, both the left and right sides

>>> of the front face of the frustum volume lie on the negative side of 
>>> the y axis.  From what I can tell, the vtkCamera can be given a 
>>> viewing angle and a near and far plane, but that gives me the 
>>> equivalent control of a gluPerspective call, which is more limited 
>>> than the functionality that glFrustum provides.  I noticed there was

>>> a function to multiply in additional matrices to the camera's 
>>> transformation matrix, but I don't think that would be quite what I 
>>> want either.
>>>
>>> -Mark Waligora
>>>



More information about the vtkusers mailing list