[vtkusers] how to Using OpenGL with VTK???????
叶元值
yeyuzh at 163.com
Tue Apr 22 03:22:51 EDT 2008
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
More information about the vtkusers
mailing list