[vtkusers] Customized Volume Rendering, and Camera Vision

David.Pont at ForestResearch.co.nz David.Pont at ForestResearch.co.nz
Mon Mar 21 16:38:25 EST 2005





Hi Jeffery,

vtkusers-bounces at vtk.org wrote on 18/03/2005 09:23:25:

> Hi all,
>
> I am brand new to VTK, and I find it really extremely valuable as it
> encapsulate many useful tools and concepts into a bunch of C++
> classes.
>
> I am working on a research project for my course, and I have some
> questions that have been bothering me, I wish any of you guys could
> give me a hand here. Thanks in advance.
>
> The scenario is, put it a simple way, I am sending a camera into a
> colon volume (Built by vtkVolume16Reader), I want to color the area
> within camera's vision. Which requires me to:
>
> 1. Determine what the camera can see.  (Raycast with all the
> triangles? and how?)
> 2. Change the color of the area that the camera can see. (Change the
> color of the triangle votices? and how?)
>
> I am not sure if VTK has provided an easy way to do that. If it does,
> I will be more than joyful. If , unfortunately, it's not supported by
> VTK at present, please give me a hint of how to get it done based on
> what VTK has to offer right now.

Just a couple of crazy ideas...

There is info and source code on rendering shadows in OpenGL at:

http://www.opengl.org/resources/code/rendering/mjktips/rts/index.html

You could adapt these ideas so the area beyond the camera view is
'shadowed' thus emphasising the parts visible to the camera.
This uses some advanced tricks in OpenGL. It is possible to mix OpenGL
calls with vtk code... but it will probably  be difficult to get the
desired effect... I think you would have to get inside the vtkRenderer
code, it would do extra renders for light sources (other than the standard
vtk headlight at the camera) using stencil buffer magic to compose the
final scene.
In your application you would place a directional light source with a
'field of view' equating to your camera ?

As a quick hack in vtk you could try a directional light source at the
camera position (and opacity < 1 for the triangles ?) but I dont expect
this will give a good result?

  Dave P


>
> Thanks a bunch,
>
> Best,
> Jeffrey
> _______________________________________________
> 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