Welcome Guest | Signup | Login


Best Flash Components | Flash Gallery | Flash Audio & Video | Flash Menus | User Interface | Website Templates

Tutorials

 

Tutorials >> 3D Scene Component for Flash - Getting Started
Set up the 3D scene with a keyboard controlled camera

Posted by Flashtuning

The goal for the following example is to set up the 3D scene with a number of objects and a keyboard controlled camera.

1. Start Adobe Flash, open a new document and set a 30 fps in the Document Properties Panel to achieve a smoother animation.

obrazek

2. Open the Components Panel (Window/Components). You will find the component in the Flashtuning folder.

obrazek

3. Drag the 3D component (Ft3DScene) from the Components panel to the stage. The component graphic symbol should now be displayed on the stage.

4. Create a new object to be rendered in 3D:

=> Draw the object graphic appearance on the stage
=> Convert the graphics to a Movie Clip symbol (Modify/Convert to Symbol)
=> Give the new object an unique instance name (in the Properties panel)
=> Repeat this step to create as many objects as you want.

5. Create the component configuration file:

=> Make a copy of the basic_sample1_stage.xml file available in the basic_sample_stage_objects.zip package available in the Downloads area of the 3D Scene component (click here)
=> Configure the XML file by creating a new entry for each of the objects created in step 4
=> You need to specify the object's attributes, where: (source - represents the Movie Clip instance name from the stage and sourcetype represents the location of the object (in this case "stage") and the registration name regname is a unique name for identification within the component and set the coordinates where the object will be placed in the world (x, y and z)
=> Save the configuration file and make sure it is a valid XML file. Most web browsers (such as Internet Explorer or Mozilla Firefox) should be able to report any errors in the XML format

(!) Make sure to leave at least one camera entry in the configuration file. The default camera is defined by the line below:
<camera x="0" y="0" z="0" source="none" sourcetype="none" regname="your_camera_name" status="on" />

(i) Please refer to the 3D Scene component Flash Help Book for more information and options for adjusting the configuration file.

The component comes with a built in Help Book with all the supported methods/properties and events explained and you can access the files via the Flash Help Panel. You will find the book under the name Flashtuning 3D Scene or you can perform a search under the flashtuning or adjacent keyword and the documentation files will be automatically displayed.

6. Switch back to Adobe Flash, select the 3D scene component on the stage and configure its parameters in the Parameters Panel or in the Component Inspector Panel (Window/Component Inspector):

=> Instruct the component to use the newly created XML file as the data source (Scene Data)
=> Make sure Key Input is set to "true"
=> Note the camera control key settings (the Key Cam setting groups)
=> Leave the rest of the parameters unchanged, as they are already populated with default settings

7.
Test the scene (Control/Test Movie). Use the keyboard to move and rotate/pivot the camera to observe the 3D scene contents.

(i) The default camera is positioned at x=0, y=0 and z=0. In relation to the camera position and rotation, the X axis is oriented rightwards, the Y axis is oriented downwards and the Z axis is oriented forwards.