comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Shadows (Yet Another Object Graphics Question)
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Shadows (Yet Another Object Graphics Question) [message #23547 is a reply to message #23546] Wed, 31 January 2001 16:49 Go to previous messageGo to previous message
Jason P. Meyers is currently offline  Jason P. Meyers
Messages: 24
Registered: September 2000
Junior Member
Karl Schultz wrote:
>
>
> The short answer is that there is no magic shadow switch in object graphics.
>
> But here is a reference that might be of help. There is a section on
> shadows in the OpenGL ("red book") Programming Guide about generating
> shadows. It involves computing a projection transform that projects your
> objects onto a plane along the light direction, which is exactly what you
> want. The book tells how to come up with the matrix given the plane
> equation of your ground plane and the direction vector of your light source.
>
> You can create an object graphics model structure where you have your
> objects and their "normal" transform in one model (IDLgrModel). You would
> also create an additional model whose parent is the first model, and add the
> same graphic objects (sans ground plane) to it with the /ALIAS keyword, to
> avoid complete duplication. Finally you adjust the transform in the second
> model using the transform derived from the red book. The intent is to draw
> the same objects twice, using a different transform each time.
>
> I haven't actually tried it, but I think it would work and would make an
> interesting project.
>
> There is one additional problem that you may run into. The shadow polygons
> will be drawn onto the same plane as the ground plane (we are trying to do
> this!), so you may get Z-buffer "fights" or stitching effects, because the
> rasterizer may not generate the same Z-coords for each pixel since the plane
> equations for the polygons may not be exactly the same. If you encounter
> this, I would try moving the shadow plane slightly away from the light
> source so that the shadow polygons sort of float over the ground plane. You
> would use the original ground plane plane equation when computing the shadow
> transform matrix, but actually draw the ground plane with a slightly
> different plane equation. If the ground plane is perpendicular to the light
> source direction, then it would be a simple matter of adjusting D in the
> ground plane plane equation.
>
> Hope this helps,
> Karl

Wow! This works great! I had already suspected the Z-buffer fight
problem and had pre-positioned the ground plane so it wouldn't be an
issue. It does help that I have a simple geometry case.

Once again thanks!
--
Jason Meyers
Ph.D. Student, Center for Imaging Science
Rochester Institute of Technology
jpm7934@rit.edu
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: VAX IDL save format
Next Topic: Re: Hi, My Name is Paul. And I'm a Fortran programmer..

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 00:24:53 PDT 2025

Total time taken to generate the page: 1.04307 seconds