How to set development environment with Sandy Flash 3D
Sandy is an object-oriented library, built entirely in Actionscript and allows you to program a 3D scene in Flash Player. It is still in development, at the time of writing the version available is 1.1 (built in Actionscript 2) and a version 1.2 is under development. But I am not knowing how to set development environment with Sandy Flash 3D? So hoping that you members will help me soon as possible.
Re: How to set development environment with Sandy Flash 3D
Quote:
It is still in development, at the time of writing the version available is 1.1 (built in Actionscript 2) and a version 1.2 is under development.
There is an update made Actionscript 3, which probably will simplify some aspects and almost certainly will be faster thanks to new features of the player. To work with Sandy you must download the library at the official site, it is also recommended reading the documentation. To understand the structure of a scene (or "world" 3D, as we often define it in the guide) you must describe it in some way. We will use a graphical representation of the tree to show relationships between the different components that compose the scene. The main object is just the "world", which in turn includes other parts in our tree representation of these other items will be the branches and leaves. The first branch from the main body part (root node) in the world of Sandy, and contains other classes (groups) with different properties and different purposes. There are mainly three types of nodes in Sandy: Groups (Group), groups of processors (TransformGroup) and objects (Object3D).
Re: How to set development environment with Sandy Flash 3D
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 ();
Re: How to set development environment with Sandy Flash 3D
Before you start writing our code, we need to set the development environment and make sure we have everything you need. First, download the library from Sandy and the library PixLib. In both cases, we must be sure to set the paths for the classes and Sandy PixLib, we copy the libraries in the directory of our project, but it is a solution that I personally do not like because you have to keep a copy of the library for each project. Better to put the libraries in a separate directory and then tell Flash where to find them. The first path, indicated with a dot, tells Flash to look for classes in your project directory.
Re: How to set development environment with Sandy Flash 3D
Sandy is a library object, created in Actionscript 2, so we wanted to use it with the object-oriented programming, but the examples I used the method of procedure, so as to include only the code necessary to provide greater clarity to the readers and avoiding functions , or other private and public methods that could create confusion. Council, however, object to the approach pass if you use Sandy in work projects. All sample files are written entirely in Actionscript and saved as separate files. Inside the fla file is only the command of inclusion, for example, the file would CubeTest:
Code:
# Include "CubeTest.as"