Hi Mikkel,
On Fri, 2003-10-17 at 03:38, Mikkel Steffensen wrote:
> Hi all,
>
> I have a question about the use of switch nodes. Previously I have used
> the switch node for loading geometry into a scene from multiple files
> and displaying these one at a time. Due to performance issues and due to
> the fact that my current geometry has 2 symmetry planes I would very
> much like to only load 1/4 of the geometry and then apply 4
> transformations on a switch node in order to obtain the complete
> geometry. The scene graph would look something like this:
>
> scene (- GroupPtr)
> / / \ \
> T1 T2 T3 T4 (- TransformPtr)
> \ \ / /
> sw (- Switch)
>
> I tried to implement this by using a for-statement when creating the
> scene - pretty much like given in tutorial example 03share.cpp. Doing
> this leaves me with a problem of not being able to control what is to
> shown from the transformed switch nodes (i.e. sw->setChoice) - I'm only
> able to control the last transformed switch node (T4).
>
> Any suggestions to how this problem can be solved?
it sounds like you're actually attaching the Node to different
transformations using addChild(). That won't work in OpenSG, you will
have to create separate Nodes and reuse the Core.
Maybe I'm just not understandig all you're trying to do, but I think you
want to share a set of geometries that are controlled by a switch node,
and the switch node should be used by 4 transformations to get you the
use of the symmetry you want.
To do that you would have to create a graph like the following:
Node
| +-- Group
_______________|____________________
/ / \ \
Node Node Node Node
| +- T1 | +- T2 | +- T3 | +- T4
| | | |
Node Node Node Node
| +-------+----------+---------+-------- Switch
/ \ /\ /\ /\
Node Node Node Node Node Node Node Node
| +-----+-----+------+----+-------+---+----- Geo Version
1
+----------+------------+------------+--------- Geo Version 2
The ASCII Art will probably come out pretty crappy, but the idea is that
under each Transformation you have a small subtree of Nodes, that all
use the same cores for every subtree. That way you share all the cores
and you only need to manipulate one to change every subtree.
Hope it helps
Dirk
-------------------------------------------------------
This SF.net email sponsored by: Enterprise Linux Forum Conference & Expo
The Event For Linux Datacenter Solutions & Strategies in The Enterprise
Linux in the Boardroom; in the Front Office; & in the Server Room
http://www.enterpriselinuxforum.com
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users