From guest  Tue May 17 10:04:16 1994
	id AA05253; Tue, 17 May 94 12:04:40 CDT  
From: aaron@skips.dseg.ti.com (Aaron M. Hightower)
Message-Id: <9405171704.AA05253@skips.dseg.ti.com>
Subject: Bounding boxes for dynamic GeoSets
To: iris-performer@sgi.sgi.com
Date: Tue, 17 May 94 12:04:40 CDT
X-Mailer: ELM [version 2.3 PL0]
Status: OR

I am doing some special effects that involve modifying the geometry of a
GeoSet

My dag looks something like this

	    ViewState->Scenegroup
		 |     |
(group1 = LoadFile()) group2 -+- pfSwitch - pfGeode - pfGeoSet -+- pfGeoState
			      |- pfSwitch - pfGeode - pfGeoSet -|
			      |- pfSwitch - pfGeode - pfGeoSet -|
			      |- pfSwitch - pfGeode - pfGeoSet -|
			      |- pfSwitch - pfGeode - pfGeoSet -|
			      |- pfSwitch - pfGeode - pfGeoSet -|
			      |- pfSwitch - pfGeode - pfGeoSet -|
						...
			      |- pfSwitch - pfGeode - pfGeoSet -|

Each GeoSet is being modified as needed via a pfList of a structure like
this:

typedef struct {
  pfSwitch *sw;                 /* Whether or not this thing is being drawn */
  pfGeoSet *gset;                                  /* Geoset for this strip */
  pfVec3 *p;                                                  /* Two points */
  pfVec4 *c;                                                  /* Two colors */
} Tracer;

-------------------------------------------------------------------------

This all worked fine, but only when the origin was in view.  So I
figured that the bounding box was not being set when I modified the
geometry.  So I tried using pfNodeBSphere().

No luck.

So I disabled culling on the pfGroup:

    pfNodeTravMask(group2,PFTRAV_CULL,0,PFTRAV_SELF,PF_SET);

that contains all of the pfSwitches.  This worked, so I thought.  And
was good enough for the demo.

But problems remain.  I still suffer from the Geode disappearing when the
group1 object gets too far away from a channel.  And I would prefer a more
efficient solution if such exists (more efficient than disabling culling on
the subgraph).

-------------------------------------------------------------------------

So my questions are:

(1) How do I recompute BSpheres when modifying pfGeoSets as illustrated in
    the figure above?
(2) Why, when I am completely disabling culling on group2, does the Geometry
    still disappear when it should not?

-------------------------------------------------------------------------
         _                                                      _
Thanks, | |    *-------------------------------------------*   | |  
      __| |___ |  Aaron.Hightower@dseg.ti.com 214.575.6759 | __| |___
      \      / |      Simulation & Planning Technology     | \      /
       \_   /  |       6620 Chase Oaks Blvd  M/S 8518      |  \_   /
         \ (   |               Plano TX 75023              |    \ (
          \/   *-------------------------------------------*     \/



From guest  Fri May 20 09:21:02 1994
From: jrohlf@tubes (John Rohlf)
Message-Id: <9305201619.AA01245@tubes.asd.sgi.com>
Subject: Re: Bounding boxes for dynamic GeoSets
To: guest (Aaron M. Hightower)
Date: Thu, 20 May 93 9:19:04 PDT
Cc: iris-performer@sgi.sgi.com
In-Reply-To: <9405171704.AA05253@skips.dseg.ti.com>; from "Aaron M. Hightower" at May 17, 94 12:04 pm
X-Mailer: ELM [version 2.3 PL8]
Status: ORS

> 
> I am doing some special effects that involve modifying the geometry of a
> GeoSet
> 
> My dag looks something like this
> 
> 	    ViewState->Scenegroup
> 		 |     |
> (group1 = LoadFile()) group2 -+- pfSwitch - pfGeode - pfGeoSet -+- pfGeoState
> 			      |- pfSwitch - pfGeode - pfGeoSet -|
> 			      |- pfSwitch - pfGeode - pfGeoSet -|
> 			      |- pfSwitch - pfGeode - pfGeoSet -|
> 			      |- pfSwitch - pfGeode - pfGeoSet -|
> 			      |- pfSwitch - pfGeode - pfGeoSet -|
> 			      |- pfSwitch - pfGeode - pfGeoSet -|
> 						...
> 			      |- pfSwitch - pfGeode - pfGeoSet -|
> 
> Each GeoSet is being modified as needed via a pfList of a structure like
> this:
> 
> typedef struct {
>   pfSwitch *sw;                 /* Whether or not this thing is being drawn */
>   pfGeoSet *gset;                                  /* Geoset for this strip */
>   pfVec3 *p;                                                  /* Two points */
>   pfVec4 *c;                                                  /* Two colors */
> } Tracer;
> 
> -------------------------------------------------------------------------
> 
> This all worked fine, but only when the origin was in view.  So I
> figured that the bounding box was not being set when I modified the
> geometry.  So I tried using pfNodeBSphere().
> 
> No luck.
> 
> So I disabled culling on the pfGroup:
> 
>     pfNodeTravMask(group2,PFTRAV_CULL,0,PFTRAV_SELF,PF_SET);
> 
> that contains all of the pfSwitches.  This worked, so I thought.  And
> was good enough for the demo.
> 
> But problems remain.  I still suffer from the Geode disappearing when the
> group1 object gets too far away from a channel.  And I would prefer a more
  ^^^^^^


	Do you mean group2? If group2 inherits the culling result of
group1, then a bug is likely.


> efficient solution if such exists (more efficient than disabling culling on
> the subgraph).
> 
> -------------------------------------------------------------------------
> 
> So my questions are:
> 
> (1) How do I recompute BSpheres when modifying pfGeoSets as illustrated in
>     the figure above?

	
	
	pfGSetBBox(gset, NULL);	// Force recomputation of bbox
	pfNodeBSphere(geode, PFN_BMODE_DYNAMIC, NULL);	// Force recomputation of bsphere



> (2) Why, when I am completely disabling culling on group2, does the Geometry
>     still disappear when it should not?

	The scene's bounding sphere is that of group1 + group2. If group2's
bounding sphere is bogus, then the scene's bound is bogus and you
won't event get to group2 when culling. If you still see group1 while
group2 disappears, then I suspect a bug. 






