[vtkusers] Customized Volume Rendering, and Camera Vision

Jeffrey Meng mengjinjie at gmail.com
Tue Mar 22 10:26:24 EST 2005


Thanks a lot, David. 

As a matter of fact, like what you pointed out, I figured I had to
override Render function to achieve my goal.

As for putting a light source at the camera spot, that will help to
give shadows to the far area, and it's really a good trick. However,
other than that, I will have to change the color of the visited area
permanently, so that I know I have been to such areas.

As mentioned above, I figured eventually, I have to manipulate the 3D
data on triangle level. Such that I could give the vertices of the
triangles different color as needed.  But I haven't found a better way
to do that.  Basically, I want to achieve my goal based on what VTK
has to offer, so that I don't have to write thousands of lines
source-code.  So I built VTK library in Debug mode, trying to trace
into it and find out the call stack of rendering process, hoping it
would eventually lead me to the triangle rendering spot. But I failed,
when I clicked F11 in Visual Studio, it just jumped over the current
instruction and got the next one, never got inside the VTK function
calls. :(

Thanks again, and I hope you guys could help me out with this.

Sincerely,
Jeffrey Meng



On Tue, 22 Mar 2005 09:38:25 +1200, David.Pont at forestresearch.co.nz
<David.Pont at forestresearch.co.nz> wrote:
> 
> 
> 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