Hi Frederic,
On Wed, 2004-11-24 at 05:03, Frederic Devillers wrote:
> Thank you for the explanation. I use the traversal for transparency
> animation, and it works well.
>
> I have a few other chunk-related questions, my understanding of it is
> not so clear :
> - I animate the transparency, via a MaterialChunk modification.I do this
> with subChunk(myMaterialChunk), modifications of the alpha values and
> then addChunk(myMaterialChunk). Is it there an other way to do this,
> some kind off updateChunk ? For the moment I use a list of
> (ChunkMaterial,MaterialChunk) couples.
It's safe to change chunks that are in a material, you just have to call
rebuildState() on it. ChunkMaterials have become much more prevalent
than I initially expected, so the handling is a little more awkward than
it could be.
> - What is the chunk behaviour if I do successive addChunks with the same
> chunk type ? Do I retreive my first chunk when I sub the last one or is
> it released ? An example of that is transparency animation for
> transparent objects : I want to consult the MaterialChunk as a base
> value for alpha modification.
That depends on the Chunk type. For most chunks only one can be active
at any given time, the active one will be replaced by whatever other one
one you add. Some chunks (all related to Lights and Textures) have
multiple slots in the State, as multiple of those can be active at any
given time. For those the default is to add them to the first unused
slot, or replace the last slot if all are used.
If you don't want that behavior, addChunk has a defaulted second
parameter that allows you to specify the slot you want to change. The
default value is State::AutoSlotReplace, which does the above.
Alternative are State::AutoSlot, which only changes if no chunk of the
given type is present, or an arbitrary integer, which sets the chunk
specified slot, if the chunk type has that many slots.
Hope it helps
Dirk
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users