Re: Depth shading question

New Message Reply Date view Thread view Subject view Author view

Dave Akers (dla)
Wed, 3 Nov 1999 11:16:37 -0800


Mark,

  Just to expand a bit on Chikai's remarks.. OpenGL fog allows you to
specify a fog color, a fog density, and a fog mode. Your objects will fade
toward the fog color in the distance, and the fog density controls how
fast the fade happens. The fog mode controls the type of ramp-function
that is used (exponential, or linear). So if you specified a fog color of
black, you'd have "black fog," which sounds like it might be what you're
looking for. See any OpenGL reference book for details on the syntax of
the actual commands.

  If you want something more complicated than fog (i.e., an arbitrary
assignment of colors to depths), you'll have to search elsewhere. If you
aren't using textures already, you can specify a 1-D texture map
containing the colors/opacities you want to apply to different depths.
Then use glTexGeni with an argument of GL_EYE_LINEAR to apply the texture
map to the view.

  By the way, you can get the position of the camera in model coordinates
by using voGeometryActions::findCameraPosition(). (Then both your polygons
and your camera eye position are in the same reference frame, which should
make computing distances easy.)

-Dave

On Wed, 3 Nov 1999, Mark Davey wrote:

> Hi....
> I wish to change the default volume rendering technique given in the
> demos so that parts of the rendered object that are further away from
> the camera appear darker. In this way I hope to give the user depth
> information which can be useful in interpreting certain types of image.
>
> I can change the colour of each polygon thats goes to make up the volume
> rendered image. I now need to find out the distance of the polygon from
> the camera. The polygons generated using the
> voGeometryActions::polygonize command have their coordinates relative to
> the volume and not the world coordinates. I could transform these so
> that they are in world coordinates, but by now, I am wondering if there
> is an easier way of generating a depth enhanced image!!!!
>
> So does anyone have any ideas??
>
> Regards
> Mark...
>
> --
> From: Mark Davey
> Dept. of Medical Physics, UCL.
>
> TEL: +44 (0)171 915 1673.
> FAX: +44 (0)171 837 9279.
>
> Institute of Laryngology and Otology,
> 330 Gray's Inn Road,
> London.
> WC1X 8GE.
>
>
>


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Wed Nov 03 1999 - 14:56:49 PST