[vtkusers] how to Using OpenGL with VTK???????

Utkarsh Ayachit utkarsh.ayachit at kitware.com
Tue Apr 22 08:49:59 EDT 2008


One possibility is to write your own subclass of vtkProp (or any of its 
subclasses) and then put the OpenGL code in overloaded 
"RenderOpaqueGeometry" or any of the other render methods.

Utkarsh

ҶԪֵ wrote:
> Hi,
>  	I would like to know if it is possible to use OpenGL commands in
>  conjonction with VTK. Where should I place OpenGL commands in a VTK
>  application ? For example, I would like to use fog and antialiasing.
> For example, if I wanted to draw a OpenGL circle on top of my VTK terrain
>  I would use this OpenGL code somewhere:
> 
>  				glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);	// 
>  				glLoadIdentity();							// Reset The matrix
>  				glColor3ub(255, 0, 0);
>      				glPushMatrix();
>     				glTranslatef(x, y, 0);
>    				glBegin(GL_LINE_LOOP);
>         				for( float ang=0; ang <= 2*3.141; ang += 0.1)
>  	   			{
>         				glVertex2d( radius * cos(ang), radius * sin(ang));
> 	   			}
>     				glEnd();
>     				glPopMatrix();
> 
> What calls do I have to make to the vtkRenderWindow, vtkRenderer objects
> to allow this to work, where would I place the OpenGL code?
> 
>  
>  Thanks
> 
> 
> 	
> 
> 
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
> 



More information about the vtkusers mailing list