OSG Switch
-
Documentation
- OSG BillBoard Helper
- OSG LOD Helper
- OSG NodeMask Helper
- OSG Impostor Helper
- OSG Visibility Group Helper
- OSG StateSet Helper
- OSG Sequence Helper
- OSG Switch Helper
- OSG Occluder Helper
- OSG Exporter
- CVS
- Download
- Changes
- WishList
- ToDo
- Compile Instructions
- Contact
- FAQ
- HOWTO(external page)
- Back to Plugins
- Back to Support
General
The Switch Helper can be used to add complex interactivity to the scene. The Switch can contain multiple objects (pieces of geometry or lights f.i.) that can be switched between using the Switch. In order to actively use it, the Switch must be accessible.
Possible usage
- Multiple design alternatives can be added to a scene and alternately shown in real-time.
- Change the way furniture is placed in the scene by providing several alternatives.
- Make things (dis)appear by providing a very small piece of geometry for them (such as a 1x1mm plane).
- Switch through the different options using the mouse wheel.
To create a Switch in MAX
- Create some geometry;
- Add a Switch Helper object to the scene;
- Use the Add-button on the Modfy Pane to add the geometry to the Switch;
Other options
- Add: add an object to the switch. The order in which objects are added is the order in which they will appear in the Switch
- Remove: remove the selected object from the Switch
- Add multiple: lets you add more then one object
Demonstration
First object in the Switch: a box
Second object in the Switch: a teapot
Third object in the Switch: a sphere
The example shows an implemented switch containing three objects. To view the different states of the switch you will need a viewer that supports the changing of switches. This example can be downloaded as an archive, containing the .MAX and the .OSG-files
Code Example
This example shows how the Switch-node is represented in an OSG-file. This particular node ("OSG_Switch01")allows you to switch between 3 pieces of geometry, namely GeoSphere01, Pyramid01 and TeaPot01. These are children-nodes of the Switch node.
...
Switch {
DataVariance STATIC
name "OSG_Switch01"
nodeMask 0xff
cullingActive TRUE
NewChildDefaultValue 1
ValueList {
1
1
1
}
num_children 3
MatrixTransform {
DataVariance STATIC
name "GeoSphere01"
nodeMask 0xff
cullingActive TRUE
referenceFrame RELATIVE_TO_PARENTS
...
}
MatrixTransform {
DataVariance STATIC
name "Pyramid01"
nodeMask 0xff
cullingActive TRUE
referenceFrame RELATIVE_TO_PARENTS
...
}
MatrixTransform {
DataVariance STATIC
name "Teapot01"
nodeMask 0xff
cullingActive TRUE
referenceFrame RELATIVE_TO_PARENTS
...
}
}
More information
Attachments
- dsSwitch.zip (45.9 kB) - added by martin on 07/11/07 12:52:52.
- OSGSwitchDemo1.png (2.4 kB) - added by martin on 07/11/07 12:53:13.
- OSGSwitchDemo2.png (8.7 kB) - added by martin on 07/11/07 12:53:26.
- OSGSwitchDemo3.png (8.6 kB) - added by martin on 07/11/07 12:53:43.
- OSGSwitchRollout.png (1.0 kB) - added by martin on 07/11/07 12:53:58.




