From: Mario Veraart (Veraart++at++fel.tno.nl)
Date: 02/20/2001 03:23:35
DANIEL BASS wrote:
>
> Question: Is it possible to change the value of the ChanTravMask during a traversal?
>
> Here is what I am really trying to do:
> I have many models, say cars, each with several sub-assemblies , say tires. Each model
> has several LOD's and each LOD will have the sub-assemblies. The application can
> state which (none, some, all) of the sub-assemblies are shown for each model.
>
> My thought was to set unique NodeTravMasks for each "tire", though the masks would
> be consistent from model to model (e.g. Left Front = 0x01, Right Front = 0x02,
> Left Rear = 0x04, Right Rear = 0x08). Then I would set a callback in each model instance
> to set the ChanTravMask, e.g. Model 1 sets the ChanTravMask to 14 and all but the lft front are drawn,
> while Model 2 sets the ChanTravMask to 3 and only the front tires appear.
>
> However when I tried doing this, it seemed that all changes to the ChanTravMask were
> ignored during the traversal, except that the last value set was used in the subsequent traversal.
>
> Is this not a valid use of the ChanTravMask ?
> Is the ChanTravMask tucked away somewhere at the beginning of the channel
> and not loaded again until the next channel?
> Could I be putting the callbacks on the wrong
> traversal? (I think I used a pre-draw callback.)
If I think what you want you can do it in the following way
1) put a cull callback on any model-node and subassem-node
2) put your masks in the userdate section of the model-nodes and subassem-nodes
3) all model-node and subassem-node performer-cullmasks are 0xffffffff
the channel must pass this node
4) the model-node cullcallback copies the dynamic mask into the userdata portion of the
cull traverser
5) all subassem-node cull callbacks check the dynamic mask (step4) against the userdata mask (step 2)
return a prune or continue result
Mario
>
> If I can't do this, can anyone offer an alternative to mask out portions of the model? My next
> thought is to using pfSwitch nodes, but it seems that I would need one switch for each
> sub-assembly child of each LOD, that could make for a lot of switches and redundant switch
> setting.
>
> Thanks,
>
> --daniel
This archive was generated by hypermail 2b29 : Tue Feb 20 2001 - 03:24:47 PST