07.12.2012 Views

Adobe Director Basics

Adobe Director Basics

Adobe Director Basics

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

ADOBE DIRECTOR BASICS<br />

3D: Controlling appearance<br />

You can drag the lines from the parent and rootNode boxes to any of the dots that indicates a node in the 3D cast<br />

member. This will change the relationship between the camera and the literality”) in the 3D world. Experiment with<br />

different settings.<br />

In the following illustration, the parent of the light(“RedLight”) has been set to the parent of the model(“Head2”).<br />

These two nodes share the same parent. However, the white light(“UIDirectional”) is nearer the head of the hierarchy.<br />

The model(“Head1”) is not in the same branch as the camera's rootNode.<br />

Only the model(“Head2”) and its children are rendered, and they are lit only by light(“Red Light”)<br />

For more information on parent-child hierarchies, see “Node hierarchy” on page 91.<br />

Sky box<br />

Imagine that you are traveling in a fast car along a straight road. Objects that are close to you, such as telephone poles<br />

along the sides of the road, appear to move past very fast in the opposite direction. The sky, on the other hand, is a huge<br />

distance away. Even if you travel fast, the moon and the clouds appear to travel with you. If you create a 3D world with<br />

an outdoor scene, you will want to be able to simulate this effect of a motionless sky. The solution is to create a sky box.<br />

The principle is to create a specific camera to render the image of the sky, and then to render the rest of the world on<br />

top of the sky image, using a different camera. You can do this with the techniques that you saw earlier in this section:<br />

sprite3d.addCamera() in “Multiple cameras” on page 103<br />

camera.rect in Multiple cameras<br />

camera.colorBuffer.clearAtRender in “Color buffer” on page 105<br />

camera.rootNode in “RootNode” on page 107<br />

You also need to:<br />

Synchronize the node.rotation of the camera that shows the sky with the rotation of the camera that shows the rest<br />

of the world. For more information, see “Rotating around an object” on page 218 and “3D mathematics” on<br />

page 361<br />

Change the natural parent-child hierarchy of objects. For more information on this, see “Node hierarchy” on<br />

page 91.<br />

To see a demonstration of a sky box, download the movie Skybox.dir and launch it. You can use the arrow keys to<br />

rotate the main camera or you can click on the 3D sprite, and then drag the mouse pointer in the direction in which<br />

you want the camera to turn. To move forward or back, you can use the I and O (in and out) keys, or the W and S keys.<br />

Last updated 8/26/2011<br />

108

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!