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 #23554 is a reply to message #23547] Wed, 31 January 2001 09:37 Go to previous messageGo to previous message
Pavel A. Romashkin is currently offline  Pavel A. Romashkin
Messages: 531
Registered: November 2000
Senior Member
My personal opinion is that when Karl posts a reply, the text on the
screen deserves to be in gold (or at least bold red). Thanks Karl!

Pavel

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
[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: Fri Oct 10 15:17:31 PDT 2025

Total time taken to generate the page: 1.36152 seconds