Where is the sky polygon?

New Message Reply Date view Thread view Subject view Author view

Troy Stephen (troys++at++wormald.COM.AU)
Mon, 15 May 1995 10:39:00 +1000 (AEST)


Hi all,

I've been attempting to add a sun and moon to our visual simulation. I have
been using point rotating billboards and positioning them just inside the far
clip plane.

Everything works great when my Earth-Sky mode is set to PFES_FAST. However,
when using PFES_SKY_GRND or PFES_SKY_CLEAR, the celestial objects become
occulted by the sky polygon which it seems is being rendered well inside the
viewing frustum.

In fact, with a far clip plane set to 50,000 metres (and a near clip plane
set to 100 metres), even if I position the billboard at 45,000 metres from
the eyepoint, I still get some occulting occurring.

This leads me to think that our terrain is also being clipped by the
sky/horizon polygons and not the far clip plane as one would expect. I would
have thought that when Performer draws the Earth-Sky model it would force all
the pixels to the maximum zbuffer value.

If this is not possible, could I somehow calculate the exact position of the
polygons used by the Earth-sky model so that I can more accurately control
the visual range in our simulation?

If anyone is interested I have attached a copy of earthsky.c (which comes as
a sample program with Performer) to demonstrate the problem. I have modified
it so that it uses the PFES_FAST mode for 10 seconds and PFES_SKY_GRND for 10
seconds. The far clip plane is set to 100 metres and the object is displayed
100 metres from the viewpoint. When PFES_FAST is used, the object gets
clipped exactly through its origin as expected. However, when PFES_SKY_GRND
is used, the object is completely occulted by the sky polygon.

Any ideas would be appreciated.

Troy Stephen
troys++at++wormald.com.au

#include <stdlib.h>
lude <string.h>
<gl/device.h>
include "pfsgi.h"
ne (pfPipe *p);
hannel *chan, void *data);
age (void)
rthsky file.ext ...\n");
  int
float t = 0.0f;
;
;
    pfEarthSky *esky;
Usage();
   pfInit();
essing mode based on number of
sors.
LT);
ode and start parallel
   */
 PFPATH additional standard directories where
        * geometry and textures exist
*/
");
n type. */
 NULL)) == NULL)
1);
pfScene. */
fAddChild(scene, root);
LightSource and attach it to scene. */
fAddChild(scene, pfNewLSource());
onfigure and open GL window */
Pipe(0);
      /* Create and configure a pfChannel. */
      chan = pfNewChan(p);
chan, scene);
100.0f );

  esky = pfNewESky();
FES_BUFFER_CLEAR, PFES_FAST);
(esky, PFES_GRND_HT, -10.0f );
or(esky, PFES_GRND_FAR, 0.3f, 0.1f, 0.0f, 1.0
f);
5f, 0.3f, 0.1f, 1.0f);
esky);
 (t < 10.0f)
ord view;
ame time. */
 view position. */
Cos(45.0f*t, &s, &c);
5.0f*t, -5.0f, 0);
0f * s, -100.0f *c, 10.0f);
, view.xyz, view.hpr);
raw for this frame. */

ES_SKY_GRND);
          float s, c;
 Go to sleep until next frame time. */
nc();

);

 10.0f);
r);
 */
 parallel processes and exit. */
);
Pipeline (pfPipe *p)
 window. */
ion(100, 500, 100, 500);
erformer");
easonable defaults. */
    /* Create and apply a default material fo
r those models

;
*/
Arena()));

id *data)
Draw ();


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:51:29 PDT

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