Re: Start

New Message Reply Date view Thread view Subject view Author view

Ran Yakir (rany++at++bvr.co.il)
Fri, 30 Sep 1994 10:50:29 +0000


On Sep 29, 3:08pm, John C Vanderburgh wrote:
> Subject:
> Hey all,
> In my Performer application, I'm rendering some stars in a space
environment as point light sources.
> I use actual celestial coordinates converted to Earth-centered rectangular
> coordinates, so my stars end up as a "celestial sphere" surrounding the
> Earth. This was working well until I discovered that if I move far
> enough in my world, objects that aren't within my "celestial sphere" (such
> as the Sun or a distant planet, etc) will appear "behind" the stars. For
> various reasons, I don't want to increase the radius of my
> "celestial sphere" (in order to physically enclose all my objects).
> If I could somehow "clamp" the depth of the star pixels (in screen
> space) to the largest z-buffer value, it would
> seem that the stars would always appear "farther"
> than any other objects in my world. I read the man pages on
> "zbuffer", "zfunction", "zdraw", etc., but didn't find exactly what
> I was looking for. So, is there a way to alter the
> values used for z-buffer calculations for my stars? (or, for that matter,
> any other suggestions on how to solve this dilemma?)
>
> Thanks,
>
> John Vanderburgh
> AF Institute of Technology
> Wright-Patterson AFB, OH
> (jvanderb++at++afit.af.mil)
>
>
>-- End of excerpt from John C Vanderburgh

Hi John,

What you should do is

1. Have the distant starts arranged under a separate node, drawn first. This is
done by adding this node to the scene first :

        pfAddChild (scene, celestial_sphere_node);
        pfAddchild (scene, close_objects_node);

2. Assign a post draw callback to that node, which will clear the zbuffer :

        Assigning -

        pfNodeTravFuncs (celestial_sphere_node, PFTRAV_DRAW, NULL, clear_zbuf);

        function -

        long clear_zbuf (pfTraverser *trav, void *data)
        {
                zclear();
        }

Or else you can assign a pre draw callback to that node that will disable
zbuffer (zbuffer(0), zwritemask(0)) and z post draw callback that will enable
it.

Hope that helps

Ran

-- 
 __                                  | Ran Yakir
 /_)  _  __   \  / _   / o __        | Graphics App. Chief Engineer
/ )_ (_(_) )   \/ (_(_/<_(_)(        | BVR Technologies Ltd.
              _/                     |   
-------------------------------------+--------------------------------
Phone :                              | E-mail : rany++at++bvr.co.il
  Work : 972-3-5715671               |
  Res. : 972-3-6995364               |
Fax    : 972-3-5715668               |

New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:50:34 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.