[vtkusers] OpenGL with VTK

Rocco Gasteiger post at rocco-gasteiger.de
Mon May 7 08:28:07 EDT 2012


Hi Rakesh,

 

Yes, the pipeline is still the same. Your derived mapper is the input of a
vtkActor, which calls the render method of your mapper. There should be
nothing to worrying about . In the attachment, you find one of my own vtk
mappers as an example (it uses also VBOs and shaders). I think this helps
you to understand the concept and incorporate you own code. Instead of the
vtkgl-namespace you can also use the glew library directly for advanced
OpenGL functionality. But you have to initialize it in the
InitializeGrapicsResources-method.

 

Cheers, Rocco

 

Von: rakesh patil [mailto:prakeshofficial at gmail.com] 
Gesendet: Montag, 7. Mai 2012 13:49
An: Rocco Gasteiger
Cc: vtkusers at vtk.org
Betreff: Re: [vtkusers] OpenGL with VTK

 

Thanks Rocco,

 

I have taken the same approach. But was little bit confused. The procedure
(Pipeline) will remain same right? So I'll pass the polydata object to
derived mapper and then write the rendering code, and set this mapper to a
normal actor. Am I correct? Do I have to use normal actor or an OpenGL
actor..??

 

Thanks

 

Regards

 

 

On Mon, May 7, 2012 at 4:34 PM, Rocco Gasteiger <post at rocco-gasteiger.de>
wrote:

Hello Rakesh,

 

Yes you can! ;-) You can use OpenGL rendering calls in the "Render"-function
of a derived Mapper class. For example, you can derive your own
MyPolyDataMapper from  vtkOpenGLPolyDataMapper class (or vtkPolyDataMapper)
to render polydata in a given vtk render window. In the "Render"-function
you place your own OpenGL-Code, e.g., display lists, VBO calls, shader
programs. Be sure to initialize all things properly before you call the
rendering. In doing so, you can use all OpenGL possibilities because you are
responsible for rendering the input dataset...not VTK anymore.

 

Cheers, Rocco

 

 

 

Von: vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] Im Auftrag
von rakesh patil
Gesendet: Montag, 7. Mai 2012 10:29
An: Hellice
Cc: vtkusers at vtk.org
Betreff: Re: [vtkusers] OpenGL with VTK

 

Thanks Hellice

 

In that example, VTK objects are rendered in OpenGL context. What I am
looking is to use OpenGL code in VTK and render in vtk's rendering window.
Is that possible..??

 

Thanks

 

Regards

Rakesh Patil

 

On Fri, May 4, 2012 at 6:53 PM, Hellice <saouli-abdelhak at hotmail.com> wrote:

http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/RenderPassExistingCon
text
tyr to see what yoiu can get from that code example if you found more plz
post it here

--
View this message in context:
http://vtk.1045678.n5.nabble.com/OpenGL-with-VTK-tp5685633p5685857.html
Sent from the VTK - Users mailing list archive at Nabble.com.
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at:
http://www.vtk.org/Wiki/VTK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers

 


_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at:
http://www.vtk.org/Wiki/VTK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120507/d27a1cf2/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MyMapperExample.zip
Type: application/octet-stream
Size: 10207 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120507/d27a1cf2/attachment.obj>


More information about the vtkusers mailing list