The following example is for illustrative purposes only. I am sure that you will understand after checking this example. The below code needed to create a scene in Sandy.
Code:
var world: World3D World3D.getInstance = () // main action of the 3D world
var root: Group = new Group () // Create a new group
world.setRootGroup (root), // Set the primary group
// === === Branch of visible objects
// create a transform group
var tGroup: TransformGroup = new TransformGroup ();
var rotation: Transform3D = new Transform3D ();
// Set the rotation of the elements contained in the group
rotation.rot (40, 30, 0);
// Associate the transformation to the transformation set
tGroup.setTransform (rotation);
// create a cube
var cube: Obj3D = new Box (50, 50, 50, 'tri');
// add the cube to the group
tGroup.addChild (cube);
// add the group transformation of the main group (rootNode)
root.addChild (tGroup);
// === Branch object "invisible" ===
// create the ClpScr on which to draw
var screen: ClpScr = new ClpScr (this.createEmptyMovieClip ('screen', 1), 400, 400);
// create the camera (associated with ClpScr)
var room: Cam3D = new Cam3D (900, screen);
// Set the camera position
camera.setPosition (0.0, -500);
// add the room in the scene
world.addCamera (room);
// Render the scene
world.render ();
Bookmarks