12.3.1 Design of the InterpolatorTest (Web page design) example The InterpolatorTestexample
12.3.1 Design of the InterpolatorTest example The InterpolatorTestexample creates a Switch Nodeand attaches a SwitchInterpolator. A custom Alphaclass (RandomAlpha) is used to generate Alpha values for the SwitchInterpolator. The RandomAlphagenerates a random Alpha value (between 0 and 1) every 10 seconds. This causes the SwitchInterpolatorto randomly switch between child Nodesevery 10 seconds. The Switch Nodehas six child Nodes: 1. Groupcontaining a ColorInterpolator: Operates on an Appearance. 2. Groupcontaining a PositionInterpolator: Operates on a TransformGroup. 3. Groupcontaining a RotationInterpolator: Operates on a TransformGroup. 4. Groupcontaining a ScaleInterpolator: Operates on a TransformGroup. 5. Groupcontaining a TransparencyInterpolator: Operates on an Appearance. 6. Groupcontaining a RotPosScaleInterpolator: Operates on a TransformGroup. Each Groupalso contains a Link Nodeto a common SharedGroup. The SharedGroupcontains a TransformGroupwith a child Shape3D. The parent TransformGroupis passed to each Interpolatorthat requires a TransformGroup, while the Shape3D s Appearanceis passed to each Interpolatorthat requires an Appearance. A Text2Dis also created with the name of the Interpolatoras text so that the current active Interpolatorcan be seen. See figure 12.4. Figure 12.4 The basic scenegraph design for the InterpolatorTest example The InterpolatorTestexample exploits a useful feature of Behaviors: when the Switchchanges its active child Node, the Behaviorsof the inactive child Nodesare no longer scheduled. In this way, the SwitchInterpolatorthat randomly selects child Nodes(using the RandomAlphaclass) also activates a single Behavior inactive Behaviorsare no longer processed even though they are still enabled. The RandomAlphaclass is very simple: //This class defines an Alpha class that returns //a random value every N milliseconds. 204
From our experience, we are can tell you that you can find a reliable and cheap webhost service at Java Web Hosting services.