Вы находитесь на странице: 1из 390

Adobe Atmosphere

User Guide

Adobe Atmosphere

User Guide

2003 Adobe Systems Incorporated. All rights reserved. Adobe Atmosphere User Guide for Windows If this guide is distributed with software that includes an end user agreement, this guide, as well as the software described in it, is furnished under license and may be used or copied only in accordance with the terms of such license. Except as permitted by any such license, no part of this guide may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, recording, or otherwise, without the prior written permission of Adobe Systems Incorporated. Please note that the content in this guide is protected under copyright law even if it is not distributed with software that includes an end user license agreement. The content of this guide is furnished for informational use only, is subject to change without notice, and should not be construed as a commitment by Adobe Systems Incorporated. Adobe Systems Incorporated assumes no responsibility or liability for any errors or inaccuracies that may appear in the informational content contained in this guide. Please remember that existing artwork or images that you may want to include in your project may be protected under copyright law. The unauthorized incorporation of such material into your new work could be a violation of the rights of the copyright owner. Please be sure to obtain any permission required from the copyright owner. Any references to company names in sample templates are for demonstration purposes only and are not intended to refer to any actual organization. Adobe, the Adobe logo, Acrobat, Adobe Reader, GoLive, Illustrator, InDesign, Photoshop, Minion, and Myriad are either registered trademarks or trademarks of Adobe Systems Incorporated in the United States and/or other countries. Microsoft, DirectX, Direct3D, Windows, and Windows NT are registered trademarks of Microsoft Corporation in the U.S and/or other countries. Apple, Macintosh, and QuickTime are trademarks of Apple Computer, Inc. registered in the U.S. and other countries. QuickTime and the QuickTime logo are trademarks used under license. Pentium is a registered trademark of Intel Corporation. 3ds max is a registered trademark of Autodesk Corporation. Maya is a registered trademark of Alias Systems. SoftImage is a registered trademark of Avid Technology. LightWave is a registered trademark of NewTek. Bryce is a registered trademark of Corel Corporation. Poser and Avatar Lab are registered trademarks of Curious Labs and EGISYS AG. TrueSpace is a registered trademark of Caligari Corporation. GeForce and Quadro are either registered trademarks or trademarks NVIDIA Corporation. Radeon, Mobility, and All-In-Wonder are either registered trademarks or trademarks ATI Technologies. Macromedia and Flash are trademarks or registered trademarks of Macromedia, Inc. in the United States and/ or other countries. All other trademarks are the property of their respective owners. Contains an implementation of the LZW algorithm licensed under various patents. Adobe Systems Incorporated, 345 Park Avenue, San Jose, California 95110, USA. Notice to U.S. Government End Users. The Software and Documentation are Commercial Items, as that term is dened at 48 C.F.R. 2.101, consisting of Commercial Computer Software and Commercial Computer Software Documentation, as such terms are used in 48 C.F.R. 12.212 or 48 C.F.R. 227.7202, as applicable. Consistent with 48 C.F.R. 12.212 or 48 C.F.R. 227.7202-1 through 227.7202-4, as applicable, the Commercial Computer Software and Commercial Computer Software Documentation are being licensed to U.S. Government end users (a) only as Commercial Items and (b) with only those rights as are granted to all other end users pursuant to the terms and conditions herein. Unpublished-rights reserved under the copyright laws of the United States. Adobe Systems Incorporated, 345 Park Avenue, San Jose, CA 95110-2704, USA. For U.S. Government End Users, Adobe agrees to comply with all applicable equal opportunity laws including, if appropriate, the provisions of Executive Order 11246, as amended, Section 402 of the Vietnam Era Veterans Readjustment Assistance Act of 1974 (38 USC 4212), and Section 503 of the Rehabilitation Act of 1973, as amended, and the regulations at 41 CFR Parts 601 through 60-60, 60-250, and 60-741. The afrmative action clause and regulations contained in the preceding sentence shall be incorporated by reference. Part Number: 90047303 (11/03)

ADOBE ATMOSPHERE i User Guide

Contents
Chapter 1: The Atmosphere Platform
Platform Features. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1 The Atmosphere Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1 Why 3-D?. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5

Chapter 2: Exploring Atmosphere Environments


Using the Atmosphere Player . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7 Tutorial: Visiting Atmosphere Environments at Adobe.com . . . . . . . . . . . . . .8 Tutorial: Viewing Atmosphere Environments in Photoshop Album. . . . . . .9 Tutorial: Viewing Atmosphere Environments in PDF Documents. . . . . . . 10 Navigating Atmosphere Environments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 Tutorial: Practicing Navigation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 Using the Toolbar. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 Tutorial: Moving to an Overhead View of the Environment . . . . . . . . . . . . 16 Working with Bookmarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 Tutorial: Bookmarking New Environments . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 Understanding and Using Avatars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 Tutorial: Swapping Your Avatar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 Setting Player Preferences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

Chapter 3: Interacting with Atmosphere Environments


Moving Through Portals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 Tutorial: Jumping Between Environments . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 Understanding Entry Points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 Communicating and Collaborating with Other Visitors . . . . . . . . . . . . . . . . 29 Tutorial: Communicating with Other Users. . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 Interacting with the Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 Using Custom Controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34

Chapter 4: Atmosphere Overview


Scene Object Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

Chapter 5: Exploring the Interface


Using the Menus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44

ii

CONTENTS

Learning the Toolbars. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 Working with Palettes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 Tutorial: Maximizing Screen Space by Docking. . . . . . . . . . . . . . . . . . . . . . . . 50 Tutorial: Positioning and Combining Palettes . . . . . . . . . . . . . . . . . . . . . . . . . 56 Using context menus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 Using Undo and Redo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 Customizing Atmosphere . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57

Chapter 6: Working with Files


Understanding the Atmosphere Formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 Opening Environment Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 Tutorial: Viewing Sample Environments. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 Saving Environments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 Closing Environments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 Importing Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 Tutorial: Importing a Viewpoint Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 Importing to Preset Palettes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 Tutorial: Importing Wood Textures. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 Managing Object Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 Exporting Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 Saving World Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 Publishing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69

Chapter 7: Views
Introduction to Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 Working with the View Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 Working with the Actor Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 Using the Reference Point Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 Working with Views. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 Controlling the View . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 Zooming to t Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 Tutorial: Viewing a Characters Good Side . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82

Chapter 8: Using Scene Objects


Positioning Models as Scene Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 Positioning Solid Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 Adding Scripts to the Scene . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 Using Viewpoint Objects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86

ADOBE ATMOSPHERE iii User Guide

Tutorial: Adding a Viewpoint Object to a Scene . . . . . . . . . . . . . . . . . . . . . . . 87 Tutorial: Adding a Viewpoint Object from the Object Presets palette. . . 88 Tutorial: Scaling a Viewpoint Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 Converting 3-D Files for Import into Atmosphere . . . . . . . . . . . . . . . . . . . . . 91 Converting Viewpoint Objects to Surface Objects. . . . . . . . . . . . . . . . . . . . . 91 Creating Avatars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 Creating a Portal. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 Positioning an Entry Point. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 Using Anchors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96 Naming Scene Objects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96 Locking Scene Objects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96 Setting Visibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97

Chapter 9: Assembling Solid Objects


Understanding Solid Objects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 Understanding Boolean Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 Connectors, Welding, Constraints and Layouts . . . . . . . . . . . . . . . . . . . . . . . 101 Naming Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 Tutorial: Creating a Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 Learning the Primitive Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104 Triangular Slab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106 Deleting Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110 Duplicating Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110 Grouping Objects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 Ungrouping Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117 Locking Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117 Hiding Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118

Chapter 10: Selecting and Editing Objects


Selecting Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121 Moving Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124 Editing using Connectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126 Snapping to a Grid. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130 Tutorial: Building a Chess Board . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132 Rotating Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133 Tutorial: Tilting a Top . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134 Clearing Transformations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135 Subtracting Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135

iv

CONTENTS

Tutorial: Making Alphabet Letters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136

Chapter 11: Applying Colors and Textures


The Appearance Editor. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139 Adding Color . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139 Tutorial: Coloring Chess Pieces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142 Adding Preset Colors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143 Texture Formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145 Applying Textures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145 Tutorial: Adding Textures to an Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146 Working with Movies and Sound . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147 Tutorial: Making a Television Come Alive. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148 Removing Textures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149 Sampling and Editing Colors and Textures . . . . . . . . . . . . . . . . . . . . . . . . . . . 149

Chapter 12: Manipulating Textures


Editing Textures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151 Tutorial: Applying a texture to a single face . . . . . . . . . . . . . . . . . . . . . . . . . . 152 Tutorial: Scaling a Texture to Fit. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156 Tutorial: Creating Seamless Textures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159 Positioning Projective Textures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160 Creating Billboards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161 Tutorial: Making a Billboard object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161

Chapter 13: Lighting a Scene


Understanding Lighting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166 Working with Emissive Surfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167 Pre-Computed Lighting. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168 Tutorial: Making a Light Bulb . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169 Setting Light Parameters. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170 Tutorial: Changing Scene Brightness. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173 Using Sunlight. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174 Tutorial: Coloring the Sun . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176 Using the Background as a Light Source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176 Tutorial: Creating a Sky Cone . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177 Using Object Light Maps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178 Using Dynamic Lighting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178 Effective Lighting Techniques . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179

ADOBE ATMOSPHERE v User Guide

Tutorial: Preparing Textures for Lighting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180

Chapter 14: Adding Interactivity


Drag and Drop Scripting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181 Tutorial: Adding Fog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183 Dening Properties and Setting Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185 Tutorial: Adding Background Sound . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186 Adding New Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187 Associating a Script with an Object. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188 Tutorial: Making a Showroom Car Rotate . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190 Tutorial: Creating a Free Moving Soccer Ball. . . . . . . . . . . . . . . . . . . . . . . . . . 191 Linking a Script to a Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193 Tutorial: Starting Rotation with the onClick Script . . . . . . . . . . . . . . . . . . . . 193

Chapter 15: Publishing


Testing and Debugging Environments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195 Testing the Final Environment. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196 Using World Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196 Publishing an Atmosphere Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197 Publishing a Single Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198 Publishing Preferences. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198 Embedding within a Web Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199 Tutorial: Adding an Atmosphere Scene to an Existing Web Page . . . . . . 199 Publishing in a PDF Document . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200 Tutorial: Adding an Atmosphere environment to a PDF Document . . . 200 Optimization Techniques . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201

Appendix A: Installing and Conguring


Installing the Atmosphere Player . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203 Installing Atmosphere . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203 Using Hardware Acceleration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203 Tutorial: Helping Atmosphere Recognize Your Card . . . . . . . . . . . . . . . . . . 206 Supported Video Cards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208

Appendix B: Keyboard Shortcuts Appendix C: Resource Libraries


Textures Set 1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214

vi

CONTENTS

Textures Set 2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223 Objects Set 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227 Objects Set 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229 Objects Set 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231 Scripts - Set 1 - Basic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232 Scripts - Set 2 - Intermediate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233 Scripts - Set 3 - Advanced . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234

Appendix D: JavaScript API Overview


Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235 SceneGraph Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235 Physical Simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238 JavaScript Interpreter Information. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240 Script Context . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241

Appendix E: JavaScript API


JavaScript API Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243 Utility Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243 Application. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248 Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248 View . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250 Button . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251 Slider . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253 PrintDevice & Object Synchronization. . . . . . . . . . . . . . . . . . . . . . . . . . 254 Math . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257 Rotation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257 Transform . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259 Vector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261 Effects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263 Fog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263 Glare. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264 Sound . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265 Event Handlers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267 CollisionEventHandler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267 KeyEventHandler. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268 KeyEvent. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270 MouseEventHandler. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272 MouseEvent. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274

ADOBE ATMOSPHERE vii User Guide

OverlapEventHandler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275 Scene Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277 Actor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277 Anchor. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285 Camera . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286 EntryPoint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290 PhysicalModel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291 ReferencePoint. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302 SceneGroup. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303 Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312 SolidObject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315 SurfaceObject. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321 ViewpointObject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325 Solid Object Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 330 Face . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 330 Primitive . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332 Materials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 336 SurfaceTexture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 336 Texture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 337 Viewpoint Object Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339 MTSBaseObject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339 MTSImageStream . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 340 MTSScene. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 341 MTSGeometry. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343 MTSInstance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343 MTSTexture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346 MTSInstance2d. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347 MTSMaterial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 350 MTSTimeElem. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351 MTSTimeElemSWFView . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 353 Physics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355 FastConstraintSolver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355 AngularDashpot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 359 Actions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 360 DragAction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 360 FluidAction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361 MagneticAction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 362 MotorAction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364

viii

CONTENTS

SingleDragAction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365 SimpleRigidWindAction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366 Constraints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367 BreakableConstraint. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367 HingeConstraint. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 368 PointToPointConstraint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369 PrismaticConstraint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 370 StiffSpringConstraint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371 WheelConstraint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 373

Colophon

ADOBE ATMOSPHERE 1 User Guide

Chapter 1: The Atmosphere Platform


Welcome to the Adobe Atmosphere platform revolutionary software for creating immersive 3-D multimedia rich stage sets for delivery on the web and within PDF documents.

What is Atmosphere?
The Adobe Atmosphere platform is a completely integrated end-to-end solution for creating 3-D interactive environments, delivering them over the web or within PDF documents, and allowing users to collaborate within them. The Atmosphere embedded multimedia type gives the web or document designer the ability to present a rich variety of interactive content, including three-dimensional objects, directional sound, streaming audio and video, SWF animations, and physical behaviors, all within the context of a live theater performance. Viewers of Atmosphere environments can move and interact freely within these spaces, and collaborate with each other. Atmosphere is different from other multimedia authoring tools in that it provides all of the tools and capabilities needed to author and play back realistic, immersive experiences within a 3-D stage set.

Platform Features
The Atmosphere platform integrates many features into a single application:
Immersion Create environments with dramatic lighting, animated 3-D objects, real-time behavior, video and audio in small les embedded in a PDF or HTML doucment. Interactivity Atmosphere users can easily create realisitc enivronments and behavior thanks to the built-in JavaScript API and integrated physics engine. Users can interact realistically with environments, objects and avatars that can behave independently or under user control. Multimedia Atmosphere supports directional sounds, streaming video and audio, SWF animations and high

denition 3-D objects including animations.


Collaboration Add multi-user interaction with text chat, avatar motion and gestures, shared object synchronization and message passing, without additional server software or hardware. An HTTP server is all thats required.

The Atmosphere Architecture


The Atmosphere platform consists of 3 parts:
Atmosphere An easy to use, powerful authoring application that can be used to create, import and manipulate

3-D objects, light, sound, images, textures, video and other multimedia; attach scripted behaviors to objects and environments; and securely publish these environments to the Web or PDF.

CHAPTER 1

Atmosphere Player A web browser plug-in that allows users to interactively view and navigate Atmosphere

environments embedded in web pages. Atmosphere Player for Adobe Reader enables users to access Atmosphere environments embedded in PDF documents.
Atmosphere Collaboration Server A publicly available server, which allows messaging, object synchronization and interactivity between users of Atmosphere environments.

Atmosphere Player
The Adobe Atmosphere Player is a free application that allows users to view, interact, and collaborate with others in environments created with Atmosphere and published online or within PDF documents.

Atmosphere environments can be viewed within a web page using the Player plug-in.
Web Page Integration Atmosphere Player supports communication between web page HTML, Java and JavaScript

allowing web designers full control of user experience using the Players JavaScript API.
A Multimedia Experience The Atmosphere Player offers the user a rich and interactive multimedia experience without

requiring a high-bandwidth connection (56K normally sufces). Atmosphere environments can also be viewed in PDF documents using Atmosphere Player for Adobe Reader.

ADOBE ATMOSPHERE 3 User Guide

Atmosphere Player System Requirements:

Intel Pentium II or faster processor Microsoft Windows 98SE, Windows ME, Windows 2000, Windows XP Home or Pro 64 MB of available RAM (128 MB recommended) 14 MB of available hard-disk space 16-bit color (32-Bit Color recommended) 56K modem or faster Internet connection Microsoft Internet Explorer 5.00.2614.3500 and above. Graphic Card Support: Radeon 7500 or higher, GeForce 2 or higher

Atmosphere
Adobe Atmosphere is a professional authoring tool for assembling and creating 3-D interactive environments. This new embedded multimedia type offers a unique way to present a rich variety of interactive content, including three-dimensional objects, sound, streaming audio and video, SWF animations, and physical behaviors. Atmosphere enables the designer to easily and quickly create content using intuitive tools. Users can import objects created with other 3-D authoring applications, add texture, media, interactivity and lighting and then publish the environment for use on the web or in PDF documents.

CHAPTER 1

Atmosphere offers powerful, intuitive creation tools.


Import Standard Formats Atmosphere supports importing 3-D assets from applications, libraries and other sources

via the Viewpoint media format (MTX, MTZ). Atmosphere also supports wide range of standard graphics and multimedia formats.
Scene Modeling Create objects and combine them with imported assets to build a seamless environment. Apply

global appearance properties such as lighting. Texture and fog using intuitive tools.
Interactivity Add interactive elements to the environment using JavaScript and a real-world physics simulation

engine.
Publishing Output the resulting environment in a form that can be embedded in either a web page or a PDF document. Published worlds cannot be re-opened in Atmosphere, thus securing the authors intellectual property. Atmosphere System Requirements Atmosphere, like the Atmosphere Player, can run well on a minimal system conguration, but more powerful systems will improve the authoring experience. System requirements for Atmosphere are:

Intel Pentium III or faster processor Microsoft Windows XP Home or Pro

ADOBE ATMOSPHERE 5 User Guide

128 MB of available RAM (256 MB recommended) 50 MB of available hard-disk space 1,024x768 screen resolution 16-bit color (32-Bit Color recommended) Graphic Card Support: Radeon 7500 or higher, GeForce 2 or higher

Atmosphere is only available for the Windows XP platform.

Atmosphere Collaboration Server


The Atmosphere Collaboration Server is a publicly available server that offers messaging and collaboration within any Atmosphere environment. The source code for the Atmosphere Collaboration Server is available at no cost under a simple license from Adobe System.

Why 3-D?
The Atmosphere platform is designed to make the power of immersive media rich environments available to a much wider audience than has been previously possible. The web is a very popular way for individuals and organizations to present information, but until now, it has largely been limited to the same kinds of 2-D information that can be presented on a printed page. People are accustomed to a world that has height, width and depth. Technologies like the telephone, television and the web offer only a limited lower number of dimensions. Consider the difference in trying to learn to navigate an unfamiliar place like an airport: directions given over a telephone (1-D), via a map (2-D) or by means of a video ythrough (3-D) represent successively easier ways to learn an unfamiliar space. By making it possible to easily create 3-D environments that can be navigated online, Atmosphere extends a powerful medium to a much wider audience and range of applications.

CHAPTER 1

ADOBE ATMOSPHERE 7 User Guide

Chapter 2: Exploring Atmosphere Environments


Before we turn our attention to learning how to create interactive environments in Atmosphere, lets learn how to use the Atmosphere Player. The Player is a free plug-in that allows people to view and interact with Atmosphere environments embedded in web pages and PDF documents.

Using the Atmosphere Player


When you installed Atmosphere, the Player was installed automatically. If you need help with Atmosphere installation, please see Appendix A, Installing and Conguring Atmosphere. Once installed, Atmosphere environments will be loaded in the Player automatically when you navigate to a web page or open a PDF document that contains an Atmosphere .aer le. If the Player isnt installed, a dialog box will appear asking if you wish to install it.

The Atmosphere Player features support for hardware acceleration. If the Player detects a supported video card, it will enable hardware acceleration automatically.

This animated spinning globe icon and a progress bar will appear as the Atmosphere environment is loading.

When the spinning globe icon disappears, the geometry for the environment has completed loading and will be displayed. Textures and multimedia les will continue to download.

Opening Local Atmosphere Files


In addition to Atmosphere environments that are posted online, you can also open environments that are saved locally. To open a local environment, right-click in the Player window and select File > Open from the pop-up menu. This will open a le dialog box where you can select an Atmosphere environment to open. The Player can only open and view AER les, not ATMO les.

CHAPTER 2

Tutorial: Visiting Atmosphere Environments at Adobe.com


You can begin to explore Atmosphere environments on the Atmosphere product pages at Adobe.com. You can nd these pages at www.adobe.com/products/atmosphere. To browse the Atmosphere environments at Adobe.com, follow these steps: 1 Open a web browser and enter the URL http://www.adobe.com/products/atmosphere/. 2 The Adobe Atmosphere web pages will open. Click on one of the links under the Atmosphere Showcase heading in the left column. 3 The Atmosphere environment will load within the web page if the Player is installed. If not, you will be asked if you wish install the Player. Click Yes to install the Player if necessary. Once downloaded and installed, you will be able to view the Atmosphere environment.

Atmosphere environments can be viewed from within a web page. Above is an environment built using Atmosphere and showcased on the Adobe site.

ADOBE ATMOSPHERE 9 User Guide

Tutorial: Viewing Atmosphere Environments in Photoshop Album


Even if youve never surfed the web, you may have seen Atmosphere if you use Adobe Photoshop Album. All the 3-D galleries in Photoshop Album are Atmosphere environments. Photoshop Album is available from the Adobe Store online as well as from authorized Adobe resellers. To explore the Atmosphere environments in Photoshop Album, follow these steps: 1 Open Photoshop Album and select several images you would like to place in a 3D gallery. 2 Select Adobe Atmosphere 3D Gallery... under the Creations menu. 3 Select the gallery you want from the Gallery Style list.

Click OK and the 3D Gallery will load within a web browser.

10

CHAPTER 2

An Atmosphere environment created using Photoshop Albums 3D gallery plug-in.

Tutorial: Viewing Atmosphere Environments in PDF Documents


Atmosphere environments can be embedded in PDF documents, providing readers a much richer experience than static images. To explore the Atmosphere environments in a PDF document, follow these steps: 1 Open a PDF document that includes an Atmosphere environment.

The Atmosphere web pages at http://www.adobe.com/products/atmosphere/ include an example PDF of Lewis Carrolls classic Alice in Wonderland that includes Atmosphere environments.

2 Scroll the document until you locate a Atmosphere environment and click on it 3 The Atmosphere environment will load within the document.

ADOBE ATMOSPHERE 11 User Guide

The Mad Haters Tea Party Atmosphere environments within a PDF document.

Navigating Atmosphere Environments


There are several ways to navigate in Atmosphere Player, using the mouse or keyboard.

Before you can navigate an Atmosphere environment, the environment must be the focus of the web page. You can give the environment focus by clicking on it.

Using the Mouse


Moving about an Atmosphere environment is straightforward. Dragging (moving the mouse with the left button held down) the mouse forward will move you forward in the environment and dragging backwards will move in reverse. Dragging the mouse to either side will rotate the view to that side. Holding down the Shift key while dragging forward will move you upward in the environment. If gravity is enabled, youll descend back to the ground when you release the mouse button. Otherwise, you can move back down by holding down the Shift key and dragging the mouse backwards.

12

CHAPTER 2

Holding down the Ctrl key while dragging the mouse forward will tilt the view perspective up towards the ceiling or sky, while dragging backwards will tilt down.

Using the Ctrl key to tilt the view will not change your horizontal or vertical movements. For example, if you rst hold down Ctrl and drag the mouse backwards so that you are looking at the ground and then, releasing the Ctrl key, drag the mouse forward, you will still move in a forward direction even though youre looking at the ground. You will not move closer to the ground.

There is one other movement associated with the Shift key. Holding down the Shift key and moving the mouse to the side will shufe your view horizontally. This movement is called a strafe and it allows you to move linearly to either side. The strafe movements is very useful if you want to look at pictures, like those in a gallery, that are lined up on a wall side by side. These are all the movements possible within the Player. With a little practice, you will nd that you can combine movements to navigate wherever you wish to go within an environment.

Using the Keyboard


If you prefer, you can use the keyboard to navigate instead of the mouse, the arrow keys work just like mouse dragging. The up arrow will move you forward in the environment and the back arrow will move you backwards. The side arrows will rotate the view to the side and the Shift and Ctrl keys along with the arrows allow you to move upwards, strafe to the side and tilt your view.
Atmosphere Player Navigation Movement Move forward Move backwards Turn to left Turn to right Ascend upward Descend downward Tilt view up Tilt view down Strafe left Strafe right Mouse motion Drag mouse forward Drag mouse backwards Drag mouse to left Drag mouse to right Shift+drag mouse upward Shift+drag mouse downward Ctrl+drag mouse upward Ctrl+drag mouse downward Shift+Drag mouse to left Shift+Drag mouse to right Keyboard Up arrow Down arrow Left arrow Right arrow Shift+up arrow Shift+down arrow Ctrl+up arrow Ctrl+down arrow Shift+Left arrow Shift+Right arrow

Tutorial: Practicing Navigation


The best way to learn how to navigate Atmosphere environments is to practice.

ADOBE ATMOSPHERE 13 User Guide

To practice navigating within Atmosphere Player, follow these steps. 1 Load an Atmosphere environment, one can be found in the Help\Tutorials\Gallery folder under the directory where Atmosphere was installed. It should be a path similar to c:\Program Files\Adobe\Atmosphere\Help\Tutorials\ Gallery. After navigating to your folder in the open dialog, select the le Gallery.html and press Open. 2 Click on the Atmosphere environment to active it, then hold down the up arrow to move forward into the environment.

A simple environment in a web browser as it appears when rst loaded.

The scene changes after moving forward into the environment. 3 Return to your starting point by holding down the down arrow to move backwards through the environment. 4 Next hold down the left arrow key and youll spin around in the environment to the left. The right arrow key will do the opposite. 5 If youd like some elevation, hold down the Shift key while pressing the up arrow and youll ascend in the environment. When you release the up arrow, youll descend again if gravity is enabled.

14

CHAPTER 2

6 Holding down the Ctrl key while pressing the up arrow will tip your view up towards the ceiling. Holding the Ctrl key while pressing the down arrow will tip your view down towards the ground. 7 The last move to practice is a strafe. Hold down the Shift key and press the left arrow key. This will move you sideways to the left. Try it with the right arrow key to return to the original location.

The view after moving further into the scene.

Using the Toolbar


If you look in the lower left corner of an Atmosphere environment, you may see a toolbar of icons. The Atmosphere Player toolbar includes several icon buttons that toggle properties and open palettes. You can control several settings using these icon buttons. If you forget which button does what, hold the mouse cursor over the top of the button and a tooltip will appear with the button name. You can turn this toolbar on and off using the Contextual menu right-click to bring up the pop-up menu and choose Toolbar to make the icons appear or disappear You can also access all the toolbar commands from the Contextual menu, which is convenient if the toolbar is hidden.

The Player toolbar.

ADOBE ATMOSPHERE 15 User Guide

Atmosphere Player Toolbar Buttons Icon Name Collide toggle Gravity toggle Show My Avatar toggle Chat Controls Preferences Users Avatars Bookmarks Description Enables collision detection in the environment Enables gravity in the world Shows your avatar in the environment Enables chat mode and opens the Chat palette Opens the Controls palette which may include custom controls Opens the Preferences palette for setting Player preferences Opens the Users palette which lists the other users in the current environment Opens the Avatar palette where you can change the current avatar Opens the Bookmarks palette which stores bookmarks of favorite sites

Toggle buttons are enabled when they are indentedhighlighted in white.

Detecting Collisions
You may notice as you move through Atmosphere environments, that you cannot move through solid objects such as walls and pillars. This is because the Collide option is enabled. The Collide button allows you to toggle this feature, enabling movement through solid objects when turned off. If you have trouble navigating a particular environment, you can disable the Collide button to m ake it easier to move around.

Setting Gravity
Another physical constraint in Atmosphere environments is gravity. If the Gravity toggle button is enabled while you are higher than the oor of the environment, then you, and avatar - if turned on, will descend until you come to rest on a solid object.

You wont descend unless both the Gravity and Collide button are enabled.

If there is no solid object underneath you, then you will continue to descend until the entire environment is out of site. If the Gravity toggle button is disabled, then you will hang in the air after releasing the mouse. If you ever nd yourself falling off the edge of environment, you can right click on the environment and select Navigation > Reenter World from the pop-up menu to restore yourself to the Entry Point location.

16

CHAPTER 2

Tutorial: Moving to an Overhead View of the Environment


Using the Shift and Ctrl keys, you can quickly get a birds-eye view of the environment. This overhead view will give you a good perspective of the entire environment. To move to an overhead view of an environment, follow these steps. 1 In the Player toolbar, click on the Gravity and Collision buttons to disable them. 2 From a point near the center of the environment, hold down the Shift key and press the Up arrow (or drag the mouse forward) to ascend upwards. 3 When you ascend sufciently, hold down the Ctrl key and press the Down arrow (or drag the mouse backward) until the environment tilts into view.

Disabling Gravity and Collisions lets you easily ascend high above an environment.

ADOBE ATMOSPHERE 17 User Guide

Working with Bookmarks


You can bookmark scenes that you would like to revisit. Bookmarks arent enabled by default. To enable bookmarks, open the Preferences panel, click the Chat tab and check the Enable Bookmarks box. Once enabled, a Bookmarks icon button appears in the Player toolbar. Clicking this button will open the Bookmarks palette.

The Bookmarks palette holds snapshots of your favorite Atmosphere environments.

The Bookmarks palette


The Bookmarks palette shows a snapshot of the current environment in the box labeled Current World. If you drag the environment displayed in the Current World box to the My Bookmarks section, a bookmark to the scene will be created. You can revisit the bookmarked environment by dragging it from the My Bookmarks section to the Current World box at the top of the palette. If you move the mouse over the top of a bookmarked environment, a tooltip will appear that lists the URL to the bookmarked le. You can delete bookmarks by selecting them in the My Bookmarks section and pressing the Delete key. If you right click in the My Bookmarks section, a pop-up menu will let you change the thumbnail size to Small, Medium or Large.

You can also share Bookmarked environments with others during a Chat session. Sharing bookmarks is covered in Chapter 3, Interacting with an Atmosphere Environment.

18

CHAPTER 2

Tutorial: Bookmarking New Environments


If you nd an environment that you would like to return to, you can bookmark it. Bookmarks appear in the Bookmarks palette. To bookmark an environment, follow these steps. 1 Visit an Atmosphere scene that you wish to bookmark. Right-click in the environment and select Window > Bookmarks from the pop-up menu to open the Bookmarks palette. The current environment will be displayed in the Current World box of the Bookmarks palette. 2 Drag the thumbnail of the current environment and drop it in the My Bookmarks section of the palette. This will add the environment to your list of bookmarks. 3 You can revisit the bookmarked environment at any time by double clicking on it in the Bookmarks palette.

Understanding and Using Avatars


As you move around in public Atmosphere environments on web sites, you may see other characters moving about. These characters are called avatars and they provide a visual representation of visitors to the environment. Each visitor has her own avatar. To see your avatar, click on the Show My Avatar button in the Player toolbar.

An environment with the default avatar visible. Click the Show My Avatar button on the toolbar to see the avatar.

ADOBE ATMOSPHERE 19 User Guide

The Avatars palette


You can load different avatars using the Avatar palette. Clicking the Avatar button in the Player toolbar will open the Avatar palette. The top of the Avatar palette includes a box that shows a snapshot of your Current Avatar, another box that holds an avatar that you can send to others, and a series of snapshots labeled My Avatars that holds a library of avatars that you can swap at any time.

Avatars, like bookmarks, can be shared with other users in an environment during a Chat session. Chapter 3, Interacting with an Atmosphere Environment, explains how to do this.

To change your avatar, simply select one from the library in My Avatars and drag it to the Current Avatar box. Atmosphere will load the new character and present it in the Atmosphere window. You can delete an avatar by selecting it in the My Avatars sections and pressing the Delete key. If you right-click in the My Avatars section, a Contextual menu will let you change the thumbnail size to Small, Medium or Large. If you delete one of the default avatars from the My Avatars section there is no way to recover it unless you reinstall Atmosphere.

20

CHAPTER 2

The Avatar palette lets you change characters at any time.

Tutorial: Swapping Your Avatar


You can change avatars easily to suit your whim. The Avatar panel holds several different characters that you can use. To change your character, follow these steps. 1 Click the Avatar button in the Player toolbar to open the Avatar palette. 2 From the My Avatars section, drag the new avatar that you wish to use to the Current Avatar box at the top of the panel. 3 Enable the Show My Avatar button in the Player toolbar to see the new avatar.

ADOBE ATMOSPHERE 21 User Guide

After switching avatars, the new avatar shows up immediately.

Setting Player Preferences


The Preferences button in the Player toolbar will open a palette with three separate tabs General, Display and Chat. Each of these tabs includes settings which change how the Player works.

General Preferences
The General tab of the Preferences palette includes settings for the avatar Nickname and URL under the Personal Defaults heading. The Nickname will appear in the Chat palette along with any message you type when youre in Chat mode. It will also identify you in the Users palette to other visitors in the environment. To load a new avatar, simply enter the avatars URL into the Avatar URL eld and the avatar will show up as the Current Avatar in the Avatar palette. From here you can drag it into the My Avatars section. There is also a Show My Avatar option to make your avatar visible in the Atmosphere Player, which works the same way as the Show My Avatar button in the toolbar.

22

CHAPTER 2

The Preferences panel includes controls for dening Player behaviors. You can enable Collisions and Gravity and set values for Acceleration and Maximum Velocity under the Navigation heading. These options work the same as their respective toolbar buttons. The Acceleration value determines how quickly your avatar begins to move. A low Acceleration value will cause your avatar to start moving slowly and pick up speed the longer the arrow key is held down. A high Acceleration value will cause the avatar to move with Maximum Velocity as soon as one of the arrow keys is pressed.

The Acceleration and Maximum Velocity values are only used when navigating with the keyboard.

The Maximum Velocity value is the fastest speed that the avatar will move, regardless of how long the arrow key is held down. Both Acceleration and Maximum Velocity can range from 1 to 100. Dont be tempted to set the Acceleration and Maximum Velocity to their maximum value. Unless you are navigating a very large environment, maximizing these values will make the avatar motion difcult to manage.

Display Preferences
The Display tab of the Preferences palette lists and lets you choose your Preferred Renderer. Options include Hardware (Direct3D) and Software. If your computer system has a video card that supports hardware rendering, then you will see better performance and image quality by selecting the Hardware (Direct3D) option as the Preferred Renderer. Software rendering, although slower, will always work regardless of your system.

Even if you select the Hardware (Direct3D) option, hardware rendering may be unavailable if Atmosphere is unable to recognize your video card. Appendix A, Installing and Conguring Atmosphere, includes information on conguring Atmosphere to recognize your video card as well as a list of supported video cards.

ADOBE ATMOSPHERE 23 User Guide

The Display tab of the Preferences panel lets you choose to activate hardware rendering. The General Rendering Options let you select to Throttle When Not Active. This option will lower the frame rate of the Atmosphere environment when it is not the active window. By enabling this option, you are allowing your video card to perform other tasks when it is not being used to render the Atmosphere environment. The Use 24-bit Textures options allows higher resolution textures that support photo-realistic color. If disabled, the Atmosphere Player will use lower resolution images. This reduces image quality, but results in an environment that is rendered more quickly, which may be necessary on older systems with slower processors. This option requires that you restart Atmosphere. If you are viewing Atmosphere environments on an older system like a Pentium II, then the frame rate for the Player may be slow. There are several options in the Display tab of the Preferences palette that can help speed up Atmosphere. For the Software Rendering Options section, you can select to Use and/or Smooth Textures and Light Maps. Disabling these options will make the environment render more quickly, but will sacrice image quality.

i i

These options have no effect if the Hardware (Direct3D) option is enabled. Disabling textures will not cause the environment to load any faster. Even if textures are disabled, they will still be downloaded. The performance increase that comes by disabling textures is an increase in frame rate as you navigate the environment.

24

CHAPTER 2

To speed up the Player, you can turn off textures.

To further speed the Players performance, you can also disable Light Maps. The Smooth Textures and Smooth Light Maps options will cause Player to anti-alias textures and light maps. To see the impact of smoothing textures, zoom in close to a texture.

ADOBE ATMOSPHERE 25 User Guide

By enabling the Smooth Textures option, the pixels in the textures are smoothly blended.

With the Smooth Textures option disabled, the Player performance is increased, but the textures will appear jagged.

26

CHAPTER 2

Chat Preferences
The Chat tab of the Preferences palette, includes options to Enable Chat, Enable Chat Logging, Print URLs of Shared Links and Enable Bookmarks. At times, you may wish to turn off some of these options to maintain privacy. Note that by right-clicking in an environment, a Chat item appears in the pop-down menu. You can control the behavior of the Chat window whether it appears at the bottom of the environment window or as a detached, oating window by toggling this option. Chat features are covered more completely in Chapter 3, Interacting with Atmosphere Environments.

The Chat tab of the Preferences panel includes options for controlling the Chat features.

ADOBE ATMOSPHERE 27 User Guide

Chapter 3: Interacting with Atmosphere Environments


Atmosphere environments are compelling experiences because they allow users to interact with them realistically. For example, users can interact with other visitors and with objects in the scene that have scripted behaviors attached to them.

Moving Through Portals


Much like web pages can be linked to each other, Atmosphere environments can be connected using portals. A portals location is denoted by a set of spinning red, green, and blue squares. When a users avatar is moved into a portal, the linked environment will automatically load in place of the existing one.

Portals offer a way to link to other Atmosphere environments. You can select to move back and forward between linked environments using the Navigation > Back and Forward right-click pop-up menu commands. If a Portals squares are lying at, then it is not active. This could be due to an broken link or a server that is ofine.

28

Chapter 3

Tutorial: Jumping Between Environments


When buiding Atmosphere environments, you may nd it easier to work with several smaller interconnected environments that are linked using Portals. A good example of this is the Museum environment on the Atmosphere product pages at Adobe.com. To practice jumping between different Atmosphere environments using Portals, follow these steps. 1 Visit the Atmosphere product pages at Adobe.com by typing http://www.adobe.com/products/atmosphere/ into a web browser. 2 Locate the Museum Atmosphere environment in the Showcase pages and enter the Atmosphere scene. Try http:// www.adobe.com/products/atmosphere/showcase/show_museum.html 3 Navigate about the scene until you locate a Portal and move into it. 4 The linked Atmosphere environment is loaded into the Player.

Portals offer a way to link to other Atmosphere environments.

ADOBE ATMOSPHERE 29 User Guide

Understanding Entry Points


When you rst enter an Atmosphere environment, you arrive at a location called the Entry Point that is designated by the environment creator. From the Atmosphere Player interface, you can have your avatar immediately jump back to this location using the Navigation > Reenter World command on the Contextual (right-click) menu.

Communicating and Collaborating with Other Visitors


When you visit Atmosphere environments online, you can enable a Chat palette that allows text conversations with other online visitors if the environment has been designed for collaboration. Open a Chat palette by clicking on the Chat button in the Player toolbar. The Chat palette can also be used to display information about the environment.

The Chat palette displays the text of online messages as users communicate with one another. You can also place the Chat window at the bottom of the Atmosphere environment by right-clicking and selecting Chat from the Contextual menu.

30

Chapter 3

The Chat palette can also be opened at the bottom of the Atmosphere Player interface.

Tutorial: Communicating with Other Users


To practice using the Chat features in Atmosphere, you rst must locate an Atmosphere environment on the web that other users are visiting. Once you see other users in an environment (see the section below for instructions), you can communicate with them using the Chat features. To chat with other users in an Atmosphere environment, follow these steps. 1 Click on the Chat button in the Player toolbar. A Chat palette will appear. 2 In the lower eld of the Chat palette, type a text message and press the Enter key. 3 The text message and your nickname will appear in the Chat palette along with the text messages typed by other users.

ADOBE ATMOSPHERE 31 User Guide

Identifying Users
The Users palette lists all the current visitors in the environment. The names that are displayed are specied in the Nickname eld in the General tab of the Preferences palette. The Whisper option can be used to limit the Chat features to selected users. To have a private conversation with a specic user, check the Whisper box next to the user.

The Users palette lists all the current visitors in an environment.

Sharing Bookmarks and Avatars


You can share your bookmarks and avatars with other users of an environment by using the Send World and Send Avatar boxes in the Bookmarks and Avatar palettes. For example, if you wish to share a your new avatar with another user, you can drag your avatar from the My Avatars section (or from the Current Avatar window) to the Send Avatar box and it will appear in the Received Avatars section of all current users Avatar palette (note that the Send Avatar window is to the right of the Current Avatar window you may need to resize the Avatar palette to see it). From here you can drag it to the My Avatar section. When a bookmark or an avatar is shared, its URL will be listed in the Chat palette if the Print URLs of Shared Links option is checked in the Chat tab of the Preferences palette.

Interacting with the Environment


In addition to Portals and Chat, you can also interact with some Atmosphere environments through scripting that the designer has included. Some common interactivity options are listed below.

32

Chapter 3

Sounds and movies


Within the Atmosphere environments, you can position sounds near objects that will grow louder as a user approaches, and softer as they move away. You can also add background sounds to the entire scene. Movies can be added as textures to any surface.

Interacting with the Web Page


Atmosphere environments embedded within web pages can interact with items on the page using standard HTML form elements such as drop-down lists and buttons.

Atmosphere environments can be controlled using standard web page controls. Above is a Cathedral environment that is integrated into a web page. The web page includes several controls that communicate with the Atmosphere environment. The Start Guided Tour button, for instance, will maneuver the visitor about the environment following preset paths.

Interacting with Scripted Objects


Scripts can add interactive behavior to any Atmosphere object. For example, scripts allow users to click on objects to initiate behavior. Imagine that youre a builder and are taking your clients through an Atmosphere representatopm of their new home. Scripted behaviors would allow them to change options like paint color or tile patterns by clicking on the walls. The scene would be updated as your clients make and evaluate their choices, allowing immediate visual feedback. This scene from the Alice in Wonderland environment rewards users with fun behaviors as they click on pictures, books and a stopwatch that oat through the scene.

ADOBE ATMOSPHERE 33 User Guide

An example of an environment that uses scripted interactive objects. This environment lets you click on objects that are oating in the scene.

Physics simulation
Atmospheres physics simulation engine and JavaScript API support physical simulations like gravity, collisions, magnetism, friction and wind. Figure 3-8 shows a realistic catapult that also interacts with the web page to allow users to load and launch a sphere towards a wall of blocks. When the sphere strikes the wall of blocks, the blocks fall naturally thanks to the physics engine.

34

Chapter 3

Atmosphere environments offer real-world physical behavior.

Using Custom Controls


The Controls button on the Player toolbar will open a Controls palette that can contain any custom controls that the environment creator has included. Custom user controls are built using Atmosphere scripts.

The Controls palette offers custom environment controls.

Using parameter controls


Atmospheres physics simulation engine allows users to set parameters in the Controls palette which control the physical properties of objects within the scene.

ADOBE ATMOSPHERE 35 User Guide

An example of magnetic attraction controlled by using the strength and falloff controls in the Controls palette. The Controls palette lets user change physical properties for objects in the scene.

36

Chapter 3

ADOBE ATMOSPHERE 37 User Guide

Chapter 4: Atmosphere Overview


Adobe Atmosphere is a professional authoring tool for assembling and creating 3-D interactive stage sets. This new embedded multimedia type gives the web or document designer the ability to present a rich variety of interactive content, including three-dimensional objects, sound, streaming audio and video, SWF animations, and physical behaviors, all within the context of a live theater performance. The Atmosphere platform includes Atmosphere an easy to use but powerful authoring tool designed to enable the creation of Atmosphere content; Atmosphere Player, web browser and Adobe Reader plug-in for navigating and interacting with 3-D environments on the Web and in PDF documents; and Atmosphere Collaboration Server which enables user communication and object synchronization. This chapter focuses on Atmosphere, the tool you use to build Atmosphere content.

Workow
Asset Creation and Acquisition
Atmosphere scenes are composed of multiple assets. These assets can come from a variety of places. They can be created directly in Atmosphere, loaded from a library of pre-built objects, imported from other 2D and 3D design applications, or created at run-time using the Atmosphere Players JavaScript API (Application Programming Interface). Assets of an Atmosphere scene can contain geometric, appearance, animation, and interaction information. Some of the assets that make up an Atmosphere scene are:
2D Text Created at run-time 2D Sprites Loaded at run-time Props 3D Objects which are created in an external design application and either imported into a scene using

Atmosphere or loaded at run-time


Surface Objects 3D objects which are either created by importing other formats into Atmosphere and converting to this native type or converted by Atmosphere, then exported and loaded at run-time Solid Objects 3D objects which are created in Atmosphere and either placed into a scene by Atmosphere or

exported and loaded at run-time Script Objects - Imported into a scene using Atmosphere This phase of the Atmosphere workow includes asset creation (Solid Objects), asset import (Props, Surface Objects, Solid Objects, Script Objects), and asset import and conversion (Surface Objects). Atmosphere can import 3-D models, including animations, saved in the standard Viewpoint Media format (MTX and MTZ). 3-D objects created in Atmosphere can be wrapped with textures, which can be still or video images. Atmosphere supports video in AVI, WMV, MPEG and MOV (QuickTime) formats and still images in GIF, JPEG and PNG formats. Applications like Adobe Photoshop and Image Ready and Adobe Premiere can be used to prepare still images and video for use in Atmosphere.

38

CHAPTER 4

Scene Modeling
In this phase of the workow, you combine scene assets geometrically, modify their appearance, and specify the appearance of the scene as a whole. This is the process of building a spatially and visually coherent 3D environment or stage set. Geometric combination includes positioning 3D assets and possibly scaling them in relationship to each other. Appearance editing includes applying color and textures to 3D object surfaces, and editing imported surface properties. Textures can include local or streamed video content in popular formats. Finally, global illumination computation can be used to make all the assets in the scene work together visually in a more realistic way.

Interaction Modeling
In this phase, interaction is added to the scene and to the objects within it. This is done by attaching scripts to the scene and its individual objects and by wiring Script Objects to other Scene Objects and to each other.

Publishing
In this phase, the esulting environment is ouput in a form that can be immediately embedded in either a web site or a PDF document. All assets known to Atmosphere are combined in a single directory, URL references are made relative and resolved to the moved assets, and a Web browser with the Atmosphere Player is brought up to preview the published content, if desired. The published folder can then be copied intact to a Web server or embedded in a PDF document for nal publication.

New Concepts
Before diving into learning the specics of Atmosphere, it will be helpful to understand some basic concepts.

Preparing Content
Successful projects depend on good planning, and Atmosphere projects are no exception. Paper sketches and a rough plan can save wasted effort later on.

Learning the Views and Editors


Two key concepts in Atmosphere are views and editors. Atmosphere offers two different view types wireframe and shaded or Player View.

ADOBE ATMOSPHERE 39 User Guide

3-D geometries are manipulated using the wireframe views. The Player View is used to apply colors, textures, and lighting. The wireframe views can be changed to show different perspectives such as Top, Front, Right and Perspective. The shaded view is also called the Player View and it shows the environment as it will appear in the Player.

Although the Player View shows textures and lighting, it does not preview scripted behaviors. To make it easy to fully test environments, including behaviors, Atmosphere offers one-click publishing, which publishes the environment and immediately launches it in a Web browser window hosting the Atmosphere Player.

Atmosphere uses editors to change content specic to the two view types. The wireframe views shows the skeletal underpinnings of the 3-D environment, while the shaded Player View shows the scene as it will actually appear to users. There are three editors in Atmosphere the Scene Editor, the Solid Object Editor, and the Appearance Editor. The Scene Editor and Solid Object Editor are related and work in the wireframe views, while the Appearance Editor works in the Player View. The actions you can perform depend on the editor that you are using in the currently active view. For example, colors, textures, and lighting can only be applied using the Appearance Editor. The Scene Editor manipulates the entire environment. All of the objects are treated as a single scene, like a theatre set, where you, the director, make the action unfold by placing props and actors for greatest effect. The Solid Object Editor is used to create and modify individual Solid Objects, which can be used as assets in the scene. For example, you could use the Solid Object Editor to assemble a chair from simple geometric shapes called primitives, and then toggle back to Scene Editor mode to place the chair with other objects. You might also use the Solid Object Editor to create rooms, and use the Scene Editor to combine these rooms into a complete building. The Appearance Editor allows you to apply sophisticated lighting effects to scenes, and colors and textures to the surfaces of objects. Finally, the Scene Editor is used to apply interaction to scene elements. Changing editors can be accomplished in a number of ways. To enter the Solid Object Editor, double-click the object that you wish to edit. To enter Scene Editor, double click on the background away from any objects. The wire frame view background color changes to distinguish the modes a blue tint indicates the Solid Object Editor is active.

40

CHAPTER 4

The window title bar also changes to indicate which editor is active. Using these editors is covered in more detail in Chapter 8, Using Scene Objects, and Chapter 9, Assembling Solid Objects.

Working with Hierarchies


All Atmosphere objects are held in a hierarchy, which keeps scenes organized as you add and alter objects. Atmosphere includes two different hierarchy interfaces one for Scene Objects and one for the active Solid Object. There are palettes for each of these hierarchies that also provide another way to select and work with objects selecting an object in a hierarchy also selects it in the wire frame view. Each object in the hierarchy can be named and child objects can be grouped under their parent object. By expanding and contracting the hierarchies, you can easily nd objects you want to work with. In addition, the Hierarchy palettes can be used to hide and lock objects, make objects subtractive and add scripts to objects.

This Hierarchy palette shows an organized view of all the objects that make up the current Solid Object. Objects in Hierarchies can be grouped. For example, a house scene can include a door object, which includes a doorknob group, which includes a lock object.

Presets
Another concept in Atmosphere is the Preset. Presets are Atmosphere resources, like textures, that are organized in a library that makes it easy to view and select the right object. For example, textures in the Paint Presets can be applied by selecting them and clicking on objects. Presets, contained in the Paint and Object Presets palettes can include colors, textures, Viewpoint Objects, models and scripts.

Presets are references to resources that are accessed via palettes like the Paint Presets palette.

ADOBE ATMOSPHERE 41 User Guide

Presets appear as thumbnails or icons in the Presets palette. Since these thumbnails are only references to the actual resources, deleting a texture preset doesnt delete the texture le, only the reference to the le. When an environment is published, Atmosphere reads the reference to copy the resource le to the published le. Presets can be saved into different sets using a Manage Sets dialog box which allows you to create and manage sets via a Set drop-down list at the top of the Presets palette. For example, texture sets could include metal, wood, roong, grass, etc. allowing you to quickly navigate large libraries of resources.

Lighting and Light Maps


The Lighting Control palette allows you to light Atmosphere scenes in the Appearance Editors Player View. Atmosphere uses two different lighting methods pre-computed and dynamic lighting. Pre-computed lighting information is placed in Light Maps that are saved along with the environments geometry information. Dynamic lighting is applied in real-time using scripts. Atmosphere offers sophisticated lighting called Radiosity: you can learn more about lighting in Chapter 13, Lighting a Scene.

Script Objects
One of the most powerful aspects of Atmosphere is the ability to associate scripts with objects or scenes. Atmosphere ships with a library of pre-built Script Object Presets (like Fog and Rotation) that allow even those who are new to scripting to associate behaviors with objects or scenes. Drag a script preset to the Scene view and the Inspector palette will display properties for controlling the behavior of the script. Changing these properties will change the scripted behavior. Atmospheres JavaScript API includes support for the built-in Havok physics engine. This engine includes realistic simulation of many physical behaviors including collisions, springs, wheels, wind and uids. Chapter 14, Adding Interactivity with Scripts, covers using Script Object Presets.

Publishing and Dual File Formats


Atmosphere creates les in two different le formats. Project les created in Atmosphere and saved using the File > Save command are given the ATMO le extension. These les can only be opened in Atmosphere. Atmosphere scenes that are complete and ready to be viewed by others go through a process called publishing. This process bundles all referenced assets like textures, models and scripts into a single folder. It then saves the Atmosphere environment le, with all references resolved, with the AER le extension. Atmosphere can also create a separate web page in an HTML le that allows the AER le to be viewed in a web browser. Published Atmosphere scenes (with the AER le extension) cannot be re-opened in Atmosphere. This helps protect the intellectual property contained within the Atmosphere scene. AER les that were created by the Atmosphere Public Beta can, however, be opened in Atmosphere, in order to allow Beta users to convert their previously created content. The publishing process is explained in Chapter 15, Publishing Atmosphere Scenes.

42

CHAPTER 4

Scene Object Types


Atmosphere supports a number of object types. Everything that Atmosphere can place in a scene is called a Scene Object. Some of the Scene Objects have special properties and uses, as explained below.

Solid Objects
This is a geometric object type that is built directly in Atmosphere. You can create and edit these objects using the Solid Object Editor. Solid Objects, are constructed by combining a small set of primitives such as Box, Cylinder and Cone into arbitrarily complex constructs using boolean operations (sometimes called Constructive Solid Geometry, or CSG). Solid Objects can be lit and textured in the Appearance Editor. Solid Object creation is covered in Chapter 9, Assembling Solid Objects.

Viewpoint Objects
Viewpoint Objects are 3-D models created in other applications and imported into Atmosphere using the Viewpoint Media format (MTX, MTZ). Viewpoint Objects carry their own lighting and textures and cannot be globally lit by Atmosphere. They can contain animations that can be controlled by the JavaScript API at run-time. Currently, Viewpoint Objects directly loaded into an Atmosphere scene act as the props in that scene. Viewpoint Objects are covered in Chapter 8, Using Scene Objects.

Surface Objects
Surface Objects are 3D mesh objects in a format native to the Atmosphere platform. They provide a way in which users can import external 3D scene components (including geometry, UV coordinates, and texture properties), and use them as full citizens of an Atmosphere scene. In this way, parts of an environment can be constructed as Solid Objects using Atmosphere, and parts can be created in external design applications and imported into Atmosphere. External formats must be converted into Viewpoint format in order to be imported and converted to native Surface Objects. Once imported as Viewpoint Objects, they are then converted into Surface Objects using Atmospheres Object > Convert to Surface menu command. Surface Objects are included in global illumination processing and will cast and receive soft shadows within the scene. Surface objects can also be textured in Atmosphere, or the textures that were imported with them can be edited. The basic form of Surface Objects cannot be edited using Atmosphere and the conversion process loses any animations that were associated with the original Viewpoint Objects that were imported and converted. Surface Objects are covered in Chapter 8, Using Scene Objects.

ADOBE ATMOSPHERE 43 User Guide

Chapter 5: Exploring the Interface


Adobe Atmosphere uses a graphical user interface that will be familiar to users of Adobe products such as Photoshop or Illustrator. Since Atmosphere is a new category of application, it will be worthwhile to take the time to familiarize yourself with the user interface even if you have previous graphics and / or 3-D design experience. The Interface Elements The Atmosphere interface uses interface elements that are commonly found in graphics software, including: Menus Toolbars Docking palettes and tabbed panes Context menus View windows

The Atmosphere interface includes menus, tabbed panes, palettes, toolbars, and view windows.

Many features can be accessed in several different ways. For example, you can create a new view using the Views menu, the context menu or a keyboard shortcut. All three methods perform the same function.

44

CHAPTER 5

Using the Menus


Located in the menu bar, Atmospheres pull-down menus include: File, Edit, Object, View, Window, and Help. Menus may contain submenus, which are indicated by a small black arrow, that point to the right. The File menu includes submenus for Import, Export and Publish.

Menus offer visual clues for keyboard shortcuts, dialog boxes and submenus. Some menu commands, such as File > Save As, have an ellipsis (three dots in a row) next to the menu command. This indicates that the menu command will open a dialog box. Some menus items appear in light gray type, indicating that they are not available. An example of this is the Objects > Ungroup command isnt enabled unless a grouped object is selected. To the right of some menu items, a keyboard shortcut is listed, allowing these commands to be triggered from the keyboard. Ctrl+S means hold down the Control key while typing S this is the keyboard shortcut for the File > Save command. A complete list of keyboard shortcuts can be found in Appendix B, Atmosphere Keyboard Shortcuts. All menus can be accessed using the keyboard by holding down the Alt key and pressing the letter that is underlined on the main menu. For example, pressing Alt+F will select the File menu. Once a menu item is selected you can use the arrow keys to move up and down the current menu or the left and right arrow keys to move to adjacent menus. Pressing the Enter key will execute the selected menu option.

The File menu


The File menu holds commands for opening, saving and closing les in Atmosphere. Commands include New (Ctrl+N), Open (Ctrl+O), Close (Ctrl+W) and Save (Ctrl+S). Each Atmosphere environment can have several settings that dene attributes such as the environments name and URL. These settings are entered in the World Settings (Shift+Ctrl+S) dialog box. The File menu also includes commands to Import and Export objects and a submenu to Publish a completed environment (Ctrl+P) along with the Exit (Ctrl+Q) menu command. At the bottom

ADOBE ATMOSPHERE 45 User Guide

of the File menu is a list of recently opened les. Selecting one of these choices will re-open the selected le. The File menu commands are covered in more detail in Chapter 6, Working with Files.

Keyboard shortcuts are useful for working efciently in Atmosphere and are included in parentheses in the manual text.

The Edit menu


The Edit menu includes the Undo (Ctrl+Z) and Redo (Shift+Ctrl+Z) commands, which undo (or redo) the last command. Edit also includes Duplicate (Ctrl+D), Clear (Delete), Clear Transform (Shift+Ctrl+T) and the Extrude Walls From Floor (Ctrl+E) commands. The Edit menu also includes Select All (Ctrl+A), Deselect All (Shift+Ctrl+A) and the Preferences (Ctrl+K) dialog box.

The Object menu


The Object menu includes commands that let you work with groups including Group (Ctrl+G), Ungroup (Shift+Ctrl+G), New Group and Activate Group. The Object menu also contains commands for Hiding (Ctrl+H) and Locking (Ctrl+L) objects. It also includes the Edit Selected Object command for switching between the Scene Editor and Solid Object Editor. The Convert to Surface command enables you to convert Viewpoint Objects to Surface Objects and the Edit Script (Ctrl+E) menu command opens a text editor where you can work with scripts. These commands are covered in depth in Chapter 10, Selecting and Editing Objects.

The View menu


The View menu includes commands to create a new wireframe view (Shift+N) or to display the Player View (F4) window. You can also switch the current active wireframe view between Top (F5), Front (F6), Right (F7), and Perspective (F8) views or Bottom (F5), Back (Shift+F6), Left (Shift+F7) and Isometric (Shift+F8). The View menu includes options to control the window layout. Options include Cascade Views, Tile Views and Mosaic Views. You can choose to have one, two, three, or four view windows and view settings can be saved and restored. There are commands to Zoom In (Ctrl++) and Out (Ctrl+-), Fit All (Ctrl+0) or Fit Selected (Shift+Ctrl+0) and Rotate Clockwise or Counterclockwise 90 degrees. For each view you can choose to show or hide Grids (Ctrl+), Guidelines (Shift+Ctrl+) and Shadows. The nal command is to Reset Views (Shift+Ctrl+R). Chapter 7, Changing Views, covers working with views in more detail.

The Window menu


The Window menu includes commands to open all the toolbars and palettes. Palettes and toolbars that are open have a checkmark to the left of their name. Selecting an unchecked palette or toolbar will open it. At the bottom of the Window menu is a list of open views for the current scene.

46

CHAPTER 5

The Help menu


The Help menu allows you to open help documentation for Atmosphere (F1), JavaScript (F2) and Lighting (F3). The About Atmosphere menu command will open the Atmosphere splash screen listing all the people involved in producing Atmosphere. It also shows the current build number. The Adobe Online menu command will connect you to the Adobe Atmosphere web site where you can check for updates.

Learning the Toolbars


There are ve different toolbars in Atmosphere: Tools, Scene Tools, Primitive Tools, Texture Tools and Options. If you accidentally close any of the toolbars, you can open them again by selecting them from the Window menu. The toolbar will reappear in the same location where it was when it was closed. By default, the toolbars are oating, which means they arent tied to the interface and can be moved close to a work area. You can drag them to wherever you want by clicking and dragging the title bar. You can also dock the toolbars to the top or bottom edge of the window. Users with a single monitor may wish to keep toolbars docked to save screen space, while those with multiple monitors may wish to group toolbars and palettes on a side monitor

Atmospheres main window with two toolbars that have been docked to the top of the window, the options toolbar docked to the bottom, and two that are left oating. Drag or Double-click on the toolbar title bar to dock it to the top or bottom edge of the window. As an aid to learning and remembering the tools, a tooltip a text box containing the name of the tool appears when you position the mouse cursor over the tool. The tooltip also lists the keyboard shortcut if one if available, e.g. the tooltip for the rst icon in the Tools panel reads Selection Tool (V) meaning Ctrl+V is the keyboard shortcut for this tool.

Tools
The Tools toolbar includes tools to select, manipulate, zoom and navigate:

ADOBE ATMOSPHERE 47 User Guide

General Toolbar Tools Icon Name Selection Tool (V) Direct Selection Tool (A) Rotate Tool (R) Scale Tool (S) Orbit Camera Tool (C) Hand Tool (H) Dynamic Zoom Tool (D) Zoom Tool (Z) Navigate Tool (N) Description Used to select objects Used to select objects and/or connectors Used to rotate objects Used to scale objects Used to spin the camera along its center axis Used to pan the current view Used to zoom by clicking and dragging Used to zoom by dragging an area in the view Used in the Player View to navigate

Solid Object Tools


The Solid Object Tools toolbar includes an assortment of objects (or primitives) that are used to create solid objects. These tools are only available when the Solid Object Editor is active.
Solid Object Toolbar Tools Icon Name Box Column Cone Triangular Slab Stairs Floor Wall Anchor Description Box primitive, described by two corner points Column primitive, described by two endpoints and a radius Cone primitive, described by two endpoints and two radii Triangular slab primitive,, described by three points and a thickness Stairs primitive, described by four control points. Floor primitive, described by four control points, constrained to be horizontal Wall primitive, described by four control points, constrained to be vertical Anchor point, used as reference position and orienation in scripting

Scene Tools
The Scene Tools are used for placing scene objects. These tools are only available when the Scene Editor is active.

48

CHAPTER 5

Scene Toolbar Tools Icon Name Place Scene Object Preset Place Empty Solid Object Script Portal Entry Point Anchor Description Places the currently selected Scene Object Preset in the scene Places an Empty Solid Object in the scene Places an Script in the scene Places a Portal in the scene Places an Entry Point in the scene Places an Anchor point in the scene

Texture Tools
The Texture Tools toolbar is used to apply, edit and remove textures from objects. These tools will only be available when an Appearance Editor window (also called a Player View) is selected.
Texture Toolbar Tools Icon Name Edit Texture Tool Remove Texture Tool Sample Texture Tool Apply Texture Tool Description Selects textures and displays texture properties in the Inspector palette Removes texture from the object Loads texture properties in the Inspector palette Applies texture to the object or face

Using the Options Toolbar


The Options toolbar includes controls that change based on the active view. For example, when a Scene View or a Solid Object view is selected, the Options toolbar includes include controls for numerically moving, rotating and scaling the selected object, setting grid spacing and welding connectors. If a Player View window is active, options for Collide, Gravity and Show Hidden Objects appear. The Options toolbar will also change as you select tools to move, rotate and scale objects.

The Options toolbar offers an easy way to position items precisely. The Options toolbar ts nicely along the bottom edge of the interface.

ADOBE ATMOSPHERE 49 User Guide

Working with Palettes


Palettes are small windows that group related controls including drop-down lists, checkboxes, value elds and buttons. Each palette can include one or more tabbed panes. For example, the Lighting Control palette includes four tabbed panes Controls, Settings, Quality, and Sun. Each pane is selected by clicking on its tab at the top of the palette. You can combine palettes by clicking on a tab and dragging it to another palette.

Palettes can include several tabbed panes. Palettes can have a menu, accessed by clicking on the triangular arrow icon in the upper-right corner, that includes additional commands. If the palette has no menu, the icon button is disabled. Clicking on the red X in the upper-right corner will close the palette. You can reopen a palette using the Window menu. Just like toolbars, palettes can be docked. To dock a palette, drag it to the menu bar or the edge of the atmosphere window and release the mouse. You can open a docked palette by clicking on its tab. Clicking a second time on the tab will retract the palette. This provides easy access to palettes without consuming screen real estate. Be aware that if you dock a palette you will not be able to access its palette menu. However, you will be able to access all the palette menu commands from the palettes right-click menu.

50

CHAPTER 5

Palettes can be docked to the edges of the main window.

Tutorial: Maximizing Screen Space by Docking


Some people like to work with oating toolbars and palettes because they can move them close to where they are working. Others like everything docked, so they know exactly where to nd them. Atmosphere offers you the exibility to handle both cases. For those who nd themselves in the second camp, you might want to follow these steps. To dock your toolbars and palettes to conserve space: 1 Drag the four toolbars into the menu bar so that they are aligned horizontally across the top. Then drag the Options toolbar to dock in the bottom edge of the interface. 2 Using the Windows menu, open all palettes and place them in the center of the screen. 3 Drag and dock the Paint Presets and Object Presets to the lower left corner of the interface above the docked Options toolbar. 4 Drag and dock the Inspector palette to the menu bar on the right side. 5 Drag and dock the other four palettes to the right edge of the Atmosphere window.

ADOBE ATMOSPHERE 51 User Guide

The interface with all toolbars and palettes docked, congured to maximize screen space.

History palette
The History palette includes a list of all the actions done in the Scene Editor and the Solid Object Editor. Selecting an item in the History palette will return the state of the active view to reect the actions up to that point, just as if youd repeatedly used the Edit > Undo (Ctrl+Z) menu command. If you select an action in the History palette and then perform another action, all actions that follow the selected action will be deleted.

52

CHAPTER 5

The History palette enables you to undo several commands at once. The History palette includes a pop-up menu with two options Options and Clear. The Options menu command will open a dialog box where you can specify the number of Maximum States to keep in the history. The Clear command will remove all items from the current History palette without changing the scene. This also makes the Undo command unavailable. Using the History palette is covered later in this chapter.

Inspector palette
The Inspector palette displays properties and options available for the currently selected object, tool or preset. For example, when the Cone Object tool is selected, the Inspector palette includes settings for the number of Faces and the size of the Top and Bottom Radius for the cone. The Inspector palette shows tabbed panes that change depending on what is being inspected. For tools and objects in the Scene and Solid Object Editors, the General and Scripting tabs are available. In Player View, the Surface and Light Map tabs are available for inspecting colors and the Surface, Light Map, Texture and Movie tabs are available for inspecting textures.

The Inspector palette changes based on the object selected.

ADOBE ATMOSPHERE 53 User Guide

General tab When a single object or a group is selected in the Solid Object or the Scene Editor, the General tab will be available. It includes a eld for entering an object Name. It also includes options for making the object Locked, hiding the object in the wireframe or Player views, and, for the Solid Object Editor, making it Subtractive. It also includes any additional parameter values for the selected object. Scripting tab The Scripting tab includes a text eld in which to enter or edit the URL for a JavaScript script that can

be attached to the object, primitive, or group. The Edit button will open the script for editing in a Text Editor. You can learn more about working with scripts in Chapter 14, Adding Interactivity with Scripts.

Inspector palette for textures


In the Player View, the Inspector palette will present several tabbed panes for working with colors and textures in the Paint Presets palette. Colors and Textures can be created or loaded by right-clicking in the Paint Presets palette. For colors, the Surface and Light Map tabbed panes are available. The Surface tabbed pane includes an option for specifying whether the object emits light and the Emitted Brightness and Self-Illumination Factor values. It also includes a Color swatch and color values of Red, Green and Blue that can be mixed to create any RGB color. The specied values for brightness and color can be applied to either the entire Object or to a selected Face depending on the selection in the drop-down list at the top of the palette.

For colors and textures, the Inspector palette offers this set of tabbed panes. The Light Map tab has a control that turns the Light Map on or off. You can also specify Light Map Brightness and Sampling Density. More information on Light Maps can be found in Chapter 13 Working with Lights. For Textures, two additional tabs appear Texture and Movie. The Texture tab includes a Scaling Type, which can be set to Pixel, Tile, Parametric or Projective. There is also an option to constrain proportions when scaling. The Size and Offset values control how big the image is and where the upper left corner of the image is located. The Rotation value will rotate the texture about its center, counterclockwise for positive values and clockwise for negative values. The Texture URL eld lets you select the location of the texture image le.

54

CHAPTER 5

The Movie tab lets you set the number of times the movie loops and the volume of the movies sound. The details of editing textures are covered in Chapter 12, Manipulating Textures.

Lighting Control palette


The Lighting Control palette is one of the most powerful. It consists of four different tabbed panes Controls, Settings, Quality, and Sun. These controls are used to specify and compute the parameters for the Atmosphere lighting engine when it computes global illumination (radiosity) for the scene. Chapter 13, Working with Lights, explains these controls in detail.

The Lighting Control palette groups all of the lighting parameters

Hierarchy palettes
Atmosphere has two hierarchy palettes: Scene Objects Hierarchy and Solid Objects Hierarchy. The palettes are similar, but they contain very different sets of information. The Object Hierarchy palette includes a complete hierarchical list of all the objects or primitives contained in a Solid Object. Each item is listed on a separate row with easy access to settings for enabling and disabling visibility, locking, subtraction and scripts associated with the object.

The Object Hierarchy palette shows all the objects that make up a Solid Object.

ADOBE ATMOSPHERE 55 User Guide

The Scene Hierarchy palette shows all of the Scene Objects in the current documents scene in a hierarchical list. It also includes columns for enabling and disabling visibility, locking and scripts. Both palettes provide an easy way to select, rename and move objects into and out of groups.

The Scene Hierarchy palette includes all the scene objects.

Presets alettes
There are two Presets palettes. The Paint Presets palette holds presets for colors and textures (which can include movies) and the Object Presets palette holds presets for models, Script Objects, and Viewpoint Objects. Colors in the Paint Presets palette have a separate paint bucket icon indicating the selected color, and textures are shown as image thumbnails. Selecting these icons and thumbnails lets you apply colors and textures to objects surfaces in the Appearance Editors Player View window.

The Paint Presets palette holds colors and textures. The Objects Presets palette holds all imported scene objects. These objects can be Atmosphere models, Viewpoint objects, or Script Objects. Scene objects imported into this palette can be placed in a Scene Editor view.

56

CHAPTER 5

The Object Presets palette holds imported models, scripts and Viewpoint objects.

Tutorial: Positioning and Combining Palettes


Combining palettes can save screen space. To combine the two Hierarchy palettes into one, follow these steps: 1 Select Windows > Object Hierarchy and Windows > Scene Hierarchy to make sure that both palettes are open. 2 Click on the Object Hierarchy tab and drag it from its own palette to the Scene Hierarchy palette and release the mouse. 3 The two palettes will now sit side by side in the same pane. 4 If you want to move the Object Hierarchy back to its own palette, just drag it away from the Scene Hierarchy palette.

Palettes can be combined by dragging and dropping tabs.

Using context menus


Unlike the menus that appear at the top of the screen, context-sensitive menus display commands related to the active tool or selection. You can use context menus as a quick way to choose commonly used commands. To display context menus:
1

Position the pointer over the view or an object in the view.

ADOBE ATMOSPHERE 57 User Guide

Click the right mouse button

Using Undo and Redo


Actions can be undone using the Edit > Undo (Ctrl+Z) menu command. If you change your mind, Edit > Redo (Shift+Ctrl+Z) puts it back. Each successive access will move one more action backward (Undo) or forward (Redo).

Using the History Palette


Its may be easier to undo multiple commands at once by using the History palette which keeps a sequential list of all the actions and commands used in the Scene and Solid Object editors. The most recent commands are listed at the bottom of the History list and the oldest ones are at the top. Clicking an item causes all commands below it to be undone. You can restore commands by clicking lower down on the list.

The History palette doesnt keep track of actions performed in the Appearance Editor (Player View). If you perform a new action after jumping back in the History list, the former subsequent actions are lost.

The total number of commands that are remembered in the History palette can be set in the the Maximum States value in the Options dialog box accessed in the yout menu of the History palette.

Customizing Atmosphere
There are several ways to customize Atmosphere by setting preferences. These options are found in the Preferences (Ctrl+K) dialog box, opened with the Edit > Preferences menu command. Additionally, Atmosphere, like other Adobe products, remembers the interface changes that youve made and will return to the same layout the next time you launch Atmosphere. The Preferences dialog includes sections for dening how Atmosphere les are saved, how the grid is used during editing, and the displayed colors.

58

CHAPTER 5

The Preferences dialog box includes controls to customize Atmosphere.

Output Settings
To make Atmosphere les smaller, you can enable the Save in Compressed Format option. Compressed les take up less disk space and download faster, but they need to be uncompressed before they can be used. This is a one-time action that happens when the environment is rst loaded. The Launch Web Browser on Publish option will open a specied web browser once the Publish command is used. You can select the web page to load when the browser is launched by typing in a URL.

Display
The second section of the Preferences dialog box includes controls that affect the Display including options that apply to the wireframe views including Grid, Snap to Grid, Guidelines and Shadows. You can also set the grid Spacing and Subdivisions. The default is set to 10. Units can be set to be Feet, Meters, Inches, Yards, Centimeters, Millimeters, Miles, or Kilometers.

ADOBE ATMOSPHERE 59 User Guide

All scripting values refer to units in feet regardless of Display Preferences settings.

Colors
Atmosphere uses colors to indicate states. For example, a selected object is displayed in red. If you prefer to display selected objects as yellow, click on the color next to Selection and use the color picker to change it to yellow. Henceforth all selected objects will appear yellow instead of red. The Reset Colors to Defaults button will reset colors to the factory defaults.

60

CHAPTER 5

ADOBE ATMOSPHERE 61 User Guide

Chapter 6: Working with Files


Atmosphere introduces two new le formats that allow the creation and playback of immersive 3-D environments. Atmosphere also supports importing most common 3-D through the Viewpoint format as well as standard video, audio, image and animation le formats.

Understanding the Atmosphere Formats


Atmosphere denes two native formats ATMO and AER. The ATMO format is used to save project les under construction in Atmosphere and the AER format is used to publish Atmosphere environments to the web or for inclusion in PDF les. Files that are published using the AER format cannot be re-opened in Atmosphere. This helps to secure your published content from being reused by others. Older AER les, representing projects created in the earlier Public Beta version of Atmosphere, can be opened and converted by Atmosphere into the new ATMO project format.

Creating New Environments


The File > New (Ctrl+N) menu command will create a new Atmosphere environment called untitled.atmo. You can give your project a name by using the File > Save (Ctrl+S) command which will prompt you for a le name and directory into which to save your work. New environments will open with at least one view window and there will already be some objects in the Scene Hierarchy palette. These default objects are required by all environments, so Atmosphere includes them for you. The default objects are the Reference Point object, the Actor object, the default Entry Point object named Viewer and a single Solid Object. The new project will open in whatever viewing mode was active the last time Atmosphere was launched.

Opening Environment Files


Saved environments can be reopened using the File > Open (Ctrl+O) menu command. This command will open a le dialog box from which you can select a le to open.

62

CHAPTER 6

The File > Open menu command will open a Windows File dialog box from which you canselect a le to open. This is a standard Windows le dialog box. Using the buttons to the left, you can choose other directories. There are also icon buttons that will let you Go Up a Directory, Create a New Folder and View the les in the current directory as Thumbnails, Tiles, Icons, List, and Details. With a le selected in the le dialog box, you can open it by double clicking on the lename or by selecting it and pressing the Open button. You can also drag an ATMO le from Windows Explorer and drop it into Atmosphere to open it.

Tutorial: Viewing Sample Environments


The default installation of Atmosphere includes several sample environments. To open a sample environment in Atmosphere, follow these steps. 1 In Atmosphere, select File > Open (or press the Ctrl+O shortcut) to access a le dialog box. 2 Locate the Help\Tutorials\Gallery folder under the directory where Atmosphere was installed. It should be a path similar to c:\Program Files\Adobe\Atmosphere\Help\Tutorials\Gallery. After navigating to your folder in the open dialog, select the le gallery.atmo and press Open. The environment will load in Atmosphere ready for editing.

ADOBE ATMOSPHERE 63 User Guide

Saving Environments
One of the most important menu commands is the File > Save (Ctrl+S) menu command, which saves the current environment. The File > Save As (Shift+Ctrl+S) menu command will open another File dialog box in which you can give the current le a different name and/or location to be saved. The name given to the environment in the le dialog box will be displayed in the title bar of each of the views. The Preferences dialog box (Ctrl+K) includes an option to Save Files in Compressed Format. If this option is enabled, then the les will be compressed before saving. This can greatly reduce the le size the example le reduces from 743 kb to 115 kb with the Compressed Format option enabled.

Compressed Atmosphere les will have the same AER le extension as uncompressed les. The Atmosphere Player knows whether the le is compressed or uncompressed by data stored in its header.

Closing Environments
The File > Close (Ctrl+W) menu command will close the currently open document. If the le has not been saved since the last change to it, a dialog box will ask if you wish to save your changes. The Close menu command will not exit the application. You can also close the le by clicking the red X close buttons at the top of all currently open view windows. However, you will then have to reestablish your preferred Views setup after opening the next Atmosphere document.

Importing Files
The File > Import menu includes several different options Models, Scripts, and Viewpoint Objects. Each of these options will import a different le format. In the le dialog box, you can select multiple les to be imported by holding down the Ctrl key and clicking individually on the les to select or by holding down the Shift key and selecting the rst and last items in a range of les. All selected les will be imported at one time.

Importing Models
When the File > Import > Models menu command is selected, you can import an existing Atmosphere project le into the current scene. This menu command is only available when a wireframe view is selected. These les must have the ATMO le extension. Imported models will appear in the scene in the same location as that to which they were saved. Imported models will be listed in the Scene Hierarchy as <Model>. You may wish to save objects you create in Atmosphere to a Models or other directory so that they can be imported and reused as needed.

64

CHAPTER 6

Importing Scripts
Scripts are used to control the behavior of objects and environments. The Import menu will open JavaScript (JS) les. Scripts are Scene Objects and can only be imported when the Scene Editor is active. Imported Script Objects will appear at the origin of the current scene. Scripts are covered in more detail in Chapter 14, Adding Interactivity with Scripts, and Appendix C, JavaScript API Documentation.

Importing Viewpoint Objects


Atmosphere can import models created in other 3-D applications and saved as Viewpoint Media les. Viewpoint Objects can be imported into Atmosphere using the File > Import > Viewpoint Objects menu command. This menu command is only enabled when the Scene Editor is active. Viewpoint Objects have an MTS, MTZ or XML extension. These objects will appear at the origin of the Scene Editor view window. You can learn more about using these objects in Chapter 8, Using Scene Objects.

Tutorial: Importing a Viewpoint Object


In this tutorial, well import a Viewpoint Object of a chandelier created in an external 3-D package. To import the chandelier, follow these steps. 1 In Atmosphere, select a wireframe view and double click on its background to make sure Scene Editor is active. The default background color will be dark gray. 2 Select the File > Import > Viewpoint Object menu command. A le dialog will open. Locate the Chandelier directory under the Extras\Objects\Set_1 folder in the directory where Atmosphere was installed. It should be a path similar to c:\Program Files\Adobe\Atmosphere\Extras\Set_1. Click on the chandelier.mtx le and select Open. The chandelier will appear in the center of the view. 3 Select View > Player View (F4) to open a Player View window and then select the View > Fit All (Ctrl+0) command to size the chandelier to the Player View window.

ADOBE ATMOSPHERE 65 User Guide

The imported Viewpoint Object as seen in the Player View.

Importing to Preset Palettes


In addition to the File > Import menu, you can also import textures and objects using the palette menus found in the Paint and Object Presets palettes. Right-click on the Presets palettes to access Import menu options. Using the palette commands will cause the objects to appear in the Presets palettes where you can further organize them into sets.

Importing Texture Presets


The Paint Preset palette menu includes a menu option to Add Texture Preset. This menu command will open a le dialog where you can select a texture image to open. Supported formats include most standard image and movie les: Graphics Image Format (GIF) Joint Pictures Expert Group (JPEG, JPG, JPE) Portable Network Graphics (PNG) Microsoft Video (AVI) Active Streaming Format (ASF) Windows Media Format (WMV) Motion Picture Expert Group (MPEG, MP3) QuickTime (MOV)

66

CHAPTER 6

Imported textures will be displayed in the Paint Presets palette as thumbnails. If you move the mouse cursor over the top of the thumbnails, the path to the texture image will be displayed as a tooltip. You can learn more about colors and textures in Chapter 11, Applying Colors and Textures.

Imported textures appear as thumbnails in the Paint Presets palette. If a source texture image le is moved after it has been imported, its thumbnail in the Paint Presets palette will show a red URL? icon to indicate that the image le can no longer be located.

Missing texture les are marked with this icon in the Paint Presets palette.

Tutorial: Importing Wood Textures


The Paint Presets palette offers a convenient way to browse and quickly locate items in large collections of textures and colors. To add a library of wood textures to the Paint Presets palette, follow these steps. 1 Select the Window > Paint Presets menu command to open the Paint Presets palette. Click the palette menu and select the Add Texture Preset menu command. A le dialog box will open. 2 Locate and open the Extras\Textures\Set_2 folder in the directory where Atmosphere was installed. It should be a path similar to c:\Program Files\Adobe\Atmosphere\Extras\Textures\Set_2 3 Click on the wood01.jpg le.
4 5

While holding down the shift key, click on the wood16.jpg le. Click the Open button.

ADOBE ATMOSPHERE 67 User Guide

The Paint Presets palette loaded with wood textures.

Importing Object Presets


Models, scripts and Viewpoint Objects can also be loaded into the Object Presets palette using the palette menu. The difference between the File > Import menu and the Object Presets palette menu is that les added via the Presets menu will stay in the Presets palette as icons and can more easily be placed multiple times in a scene. If you plan on using an imported object more than once, add it to the Object Presets palette.

The Object Presets palette can hold models, scripts and Viewpoint Objects.

Each object type has a different icon.

Managing Object Sets


It is easier to navigate large collections of textures and objects if they are grouped into Sets. Textures, for example, are easier to nd if they are grouped under categories like wood, metal, grass etc. Grouping can also be done per project, or in any other manner the user desires. In the Paint and Object Presets palette menus, you can select the Manage Sets menu command to create categories called Sets. This command will open the Manage Preset Sets dialog box. In this dialog box, you can create a New set, and Edit or Delete an existing set. Each set will have a name and a folder where its presets are located. These new sets will appear in the Set drop-down list at the top of the corresponding Preset palette along with their le path.

68

CHAPTER 6

The Manage Preset Sets dialog box lets you create and manage sets of objects and textures. Once a new set is created, you can add presets to it using the Add Presets menu commands found in the Object and Paint Presets palettes. The new presets will then be added to the selected set. If you look in the directories where presets are stored, you will nd Atmosphere has created le names such as Material001.amt, Model001.asc and ScriptObject001.ajs. These small les hold parameter information for the preset. The preset le type can be identied by its extension; amt for textures, amc for colors, asc for models, ajs for scripts and avp for Viewpoint Objects. Atmosphere uses the operating systems native le system as an integral part of its presets management system. A Preset Set is simply a named directory on your disk. When switching to a Preset Set, all presets of the appropriate type (Paint or Object) will be read from the specied directory and loaded into the Presets palette. You can rename a Preset Set at any time, and also change the directory on your disk that it points to. You can use the operating system, independently of Atmosphere, to reorganize presets across various directories by simply moving, copying, or deleting preset les.

Exporting Objects
The File > Export menu includes a single command - Model. This command is available in the Scene and Solid Object editors is enabled when an appropriate subset of objects is selected in either the Scene Hierarchy palette or the Objects Hierarchy palette. An exported model is saved as an ATMO le. Selected objects are exported with their positions relative to their active coordinates. When exported models are imported into other scenes, the objects will be placed at the origin of the current scene and the parts of the object will be placed relative to the origin. For example, lets say you create a Solid Object icon in the Scene view at 10ft on the X-axis and place a Box object belonging to the Solid Object at 25ft on the X-axis. If you select and export the Box object, it will appear at 15ft on the X-axis when imported into a new scene.

ADOBE ATMOSPHERE 69 User Guide

You can export as a model an entire subset of the current scene, including a collection of interlinked Scene Objects and Script Objects. In this way, you can create a library model that includes both objects and their behaviors. When importing such a library model back into a new scene, all of the objects, with their behaviors, will be loaded and reconnected together.

Saving World Settings


The World Settings dialog box lets you include environment-specic information that is saved with the scene le. This information includes the following: World Name Reference URL Server URL Topic

The World Settings dialog box includes environment settings such as name and URL. The File > World Settings (Alt+Ctrl+S) menu command will open a dialog box in which you can give the entire environment a name and specify where it will be located on the web. You specify the environments home server and path in the Reference URL eld. The Server URL eld species the location of the server used to enable chat and synchronization features. The Topic eld is used to identify the type of environment and can be a descriptive keyword or two. For example, a product storefront scene could have the Topic set to commerce.

Publishing
Publishing is the nal process that compiles all of the your projects geometry, lighting, texture, media types and behavior into an AER le, and places it on a server (or locally for testing). The process is initiated using the File > Publish > World (Ctrl+P) or File > Publish > Model menu commands. Publishing a model will only save the selected

70

CHAPTER 6

object as an AER le. Publishing a world will launch a web browser and display the Atmosphere environment in all its glory. You can learn more about publishing in Chapter 15, Publishing Atmosphere Scenes.

Publishing a scene opens it in a web browser, but publishing a model does not.

ADOBE ATMOSPHERE 71 User Guide

Chapter 7: Views
Since computer monitors are 2-D devices, content creators have to switch views frequently to check the dimensions and position of the 3-D objects they create. This might not be immediately apparent to people used to 2-D authoring applications. Atmosphere displays projects in two types of views. Wireframe views show just the lines at the edges of objects and are used for geometric creation and editing tasks, while the Player View is a preview of nal visual results and performance, with textures and lighting (global illumination) applied. Experienced Atmosphere designers often keep several views of the same scene open so that they can check the size and placement of objects in all three dimensions. Atmosphere has commands that will automatically open multiple views in three or four windows placed for easy object viewing.

Introduction to Views
Atmospheres three editors display scene contents in either wireframe views or the Player View. The Solid Object Editor and the Scene Editor display objects using wireframe views and the Appearance Editor displays objects in the Player View. Wireframe views show the lines that make up edges of objects and are commonly used in 3-D applications to create and modify the geometry of objects. In Atmosphere, wireframes are used to create and edit the geometry of objects and to compose scenes by applying geometric transformations to these objects. The Player View is a preview of the scene including lighting, and textures. The Player View shows the scene as it will appear in the Atmosphere Player. Scripted behaviors, run-time interaction and loaded models, sound, video, physics (with the exception of Player navigation), and dynamic lighting will not appear in the Player View. In order to test the full experience of an Atmosphere environment, the user must publish the scene and view it in a copy of the Atmosphere Player, usually within a Web browser. The Publish feature of Atmosphere will do this automatically for you. Wireframe views can be switched to eight preset positions by right-clicking in a Solid Object or Scene Editor window and selecting the Preset Position menu item. The Preset Positions are grouped in two sets in the menu: Top (F5), Front (F6), Right (F7) and Perspective (F8) in one group, and Bottom (Shift+F5), Back (Shift+F6), Left (Shift+F7) and Isometric (Shift+F8) in the second. Note that the Shift key toggles the reverse perspective for the Top, Front and Right positions. F5 shows Top view while Shift+F5 shows bottom view etc. The Player View position is independent from the wireframe views and is controlled by the Navigate tool in the Tools toolbar.

72

CHAPTER 7

Working with the View Windows


Each view window includes a title bar that lists the le name of the project currently being edited, the current Editor, and the views positional type. You can open any number of wireframe views, but only one Player View.

The Solid Object Editor is used to compose primitives into more complex objects like this fountain.

Solid Object Editor


The Solid Object Editor is used to create objects and displays them in windows that can have eight positional types. You can switch to the Scene Editor from the Solid Object Editor by toggling the Object > Edit Selected Object menu command (or you can double-click on the background of the scene).

Scene Editor
The Scene Editor is used to place scene objects and also has eight wireframe positional presets. When the Scene Editor is active, the Scene Tools toolbar is active.

ADOBE ATMOSPHERE 73 User Guide

Notice that the background color changes when selecting Solid Object and Scene Editor. By default the Solid Object Editors background is a dark blue and the Scene Editors background is a dark gray.

The same water fountain viewed in perspective in the Scene Editor. The Scene Editor is used to work with scene objects. You can switch between The Scene Editor and Solid Object Editor by selecting a Solid Object and choosing the Object > Edit Selected Object menu command (or by double clicking on the Solid Object in the Scene view). You can switch from Solid Object Editor to Scene Editor by double-clicking in the background away from any objects.

Appearance Editor and Player View


The View > Player View (F4) menu command opens the Appearance Editor and displays the current scene in Player View. You can navigate around the scene just as you would in the Atmosphere Player by selecting the Navigate Tool in the Tools toolbar. The Appearance Editor also allows you to apply and remove lighting, colors and textures.

74

CHAPTER 7

The fountain once again in the Player View. The Appearance Editors Player View lets you see objects as they will appear in the Atmosphere Player.

Working with the Actor Object


The Actor object designates the position and orientation of the viewer in the Player View. In the Scene view, the Actor object looks like a small human gure . The easiest way to select the Actor object is to click on its name in the Scene Hierarchy palette. To see a scene in the Player View from a specic viewpoint, you can move and rotate the Actor object in the Scene Editor and then switch to the Player View to see the scene from the Actors location. Conversely, if you navigate to a position in the Player View and then select a Scene Editor view, the Actor objects position will be updated to that position. The Actor object can help you position the Entry Point location. The Entry Point is the location where viewers and avatars appear when they rst enter an environment. If you select the default Entry Point in the Scene Hierarchy palette, two buttons will appear in the Inspector palette: Move Entry Point to Actor Location and Move Actor to Entry Point Location. The rst will place the Entry Point at the same position as the Actor object. The second button will move the Actor object to the Entry Points current location.

ADOBE ATMOSPHERE 75 User Guide

When the Entry Point object is selected, the Inspector displays buttons that allow you to sync the locations of the Actor and Entry Point objects.

Using the Reference Point Object


Another Scene default is the Reference Point object. This object displays the X, Y and Z axes as a reference. Although this object can be moved, rotated and scaled, the orientation of the axes remains constant. You can move this object around the scene as needed to check orientation. In wireframe views, the Reference Point object is used to specify the position of the dimension in which you are not editing. For example, if you are editing in a Top view, then the height (y position) of the Reference Point object becomes the height of any new object or primitive you add to the view. By moving the Reference Point object, you can move the implied planes of the editors.

76

CHAPTER 7

The Reference Point object displays the orientation of the X, Y and Z axes.

Working with Views


In the Scene and Solid Object Editors, you can select a different view from the View > Preset Position menu. The options include Top (F5), Front (F6), Right (F7), and Perspective (F8). You can also choose Bottom (Shift+F5), Back (Shift+F6), Left (Shift+F7), and Isometric (Shift+F8). All of these views (except for the Perspective and Isometric views) are planar in that they show the scene looking in the direction of one of the axes. For example, the Top view looks along the Y-axis to the XZ plane. The Perspective and Isometric views are different. They look down on the view from an angled, elevated position raised from the XZ plane showing all three dimensions. The difference between the Perspective and Isometric views is that lines converge to a common point in the Perspective view as they do when we look at a real scene that stretches to the horizon. Line in the Isometric view are dimensionally correct, i.e. parallel lines remain parallel. You can see the difference by comparing the grid for both views.

ADOBE ATMOSPHERE 77 User Guide

In the Isometric view parallel lines remain parallel.

Opening a New View


Selecting View > New View will open a new Solid Object or Scene Editor wireframe view window. Remember that you can open only one Player View. Only one view can be active at a time. The active view is identied by a darker blue title bar. Inactive views will have a lighter blue title bar.

Selecting a Layout
With more than one view window open, it can become difcult to nd a specic view. The View > Layout menu offers commands to organize and select windows. Cascade Views will align all view windows so the title bar for each window is just below and offset from the one above it.

78

CHAPTER 7

Cascading views are positioned so you can see the title bar of each view. The View > Layout > Tile Views menu option will place all view windows side by side, lling the screen with equalsized windows.

ADOBE ATMOSPHERE 79 User Guide

Tile Views places equal-sized windows side-by-side. Note that each wireframe window has a different view. The View > Layout > Mosaic Views menu option will open the current view in a large window and place other views in small windows to the right.

80

CHAPTER 7

The Mosaic Views option maximizes the active window and places the other views off to the side. The View > Layout menu offers window layout options consisting of one to four view windows. Selecting View > Layout > one View will open a single Top view window. Selecting View > Layout > 2 Views will open Top and Front cascading views. The View > Layout > 3 Views option will show a Top, Front and Player View windows with the Top view being the largest. Finally, the 4 Views option will open Top, Front and Right views along with a Player window.

Controlling the View


You can pan, zoom, and rotate wireframe views using the Tools toolbar. As scenes ll with objects and other detail, these tools enable you to quickly nd and manipulate objects of interest.

Panning a View
When a new wireframe view appears, the center of the grid is located in the center of the window. You can pan the view to a different location using the Hand tool (H) . With the Hand tool selected, click and drag to move the scene in the window.

ADOBE ATMOSPHERE 81 User Guide

You can also grab and pan the current wireframe view using the spacebar. Holding the spacebar down will change the cursor to the Hand icon, allowing you to drag the scene with the mouse.

Zooming a View
To zoom in or out of a scene in wireframe view, use the Zoom tool (Z) or the Dynamic Zoom (D) tool.

The Zoom tool will zoom in with each left-click of the mouse. Holding down the Ctrl key causes the + sign in the magnifying glass icon to change to a and left-clicking will zoom out. You can also click and drag a rectangle around an area, and the area will zoom to ll the window when the mouse button is released. The Dynamic Zoom tool lets you zoom continuously using the left mouse button and dragging forward to zoom in and backward to zoom out. Both tools support a mouse equipped with a scroll wheel. Forward scroll zooms in, and backward scroll zooms out. Another way to zoom in and out of the view in steps is by using the View > Zoom In (Ctrl++) and View > Zoom Out (Ctrl+-) menu commands.

Rotating a View
The Orbit Camera Tool (C) lets you rotate a view about its center point by dragging in the view.

You can also rotate the view using the View > Rotate Clockwise 90 degrees and View > Rotate Counterclockwise 90 degrees menu commands. With the Orbit Camera Tool (C) selected, hold down the Ctrl key to rotate the view about any axis.

Resetting a View
Its easy to get lost in wireframe views, especially if you are new to editing in three dimensions. You can reset the view to place the grid origin in the center of the window with the View > Reset Views (Shift+Ctrl+R) menu command.

Navigating the Player View


With the Player View active, select the Navigate tool (N) to move about the Player View just as you would in the Atmosphere Player using the mouse or arrows keys. Holding down the Shift key will move you vertically (y) or horizontally (strafe) and holding down the Ctrl key will let you tilt your view up, down, and around. When the Player View is active, the Options toolbar includes Collide and Gravity controls and an option to Show Hidden Objects.

82

CHAPTER 7

Zooming to t Objects
The View menu includes two useful commands that zoom the current view to t all the current objects or just the selected object. View > Fit All (Ctrl+0) ts the whole scene to the current window. View > Fit Selected (Shift+Ctrl+0) ts just the selected objects. The Fit All and Fit Selected features can also be used in the Player View.

The Fit All command will zoom and pan the current view so all objects are visible.

Tutorial: Viewing a Characters Good Side


We all have a good side, but nding it in a 3-D application takes a bit of skill. This tutorial will give you a chance to practice nding your good side. To practice working with views, follow these steps. 1 Locate the Help\Tutorials\Avatar_Male folder under the directory where Atmosphere was installed. It should be a path similar to c:\Program Files\Adobe\Atmosphere\Help\Tutorials\Avatar_Male. After navigating to your folder in the open dialog, select the le avatar_male.atmo and press Open. 2 Select the View > Layout > 1 View menu option to open a single Top view.

ADOBE ATMOSPHERE 83 User Guide

3 To see the objects in the scene, select View > Fit All (Ctrl+0). This will zoom and pan the window so all objects are visible in the Top view. 4 Select View > New View (Shift+Ctrl+N) to open a new view window. This new view window will also be a Top view. 5 With the new view window active, select View > Preset Position > Front (or press the F6 key). Use the View > Fit All (Ctrl+0) command to see all the objects in this view. 6 Select View > Player View (F4) to open a Player View window to see a shaded version of the scene. 7 Select View > Layout > 4 Views to open four view windows. This will add a Right view. 8 Select each view and use the View > Fit All (Ctrl+0) command to t the objects in the view.

The nal layout has four views with the object tted to each view.

84

CHAPTER 7

ADOBE ATMOSPHERE 85 User Guide

Chapter 8: Using Scene Objects


The Scene Editor is used to assemble the parts of an Atmosphere environment the Scene Objects, which include Solid Objects, Viewpoint Objects, Surface Objects, Script Objects, Scene Groups, the Actor, and Entry Points and Portals. You can think of the Scene as the movie or theatre set where the action of your environment takes place. This chapter explains the elements that you will work with in the Scene Editor. The Scene Editor has its own toolbar which contains a Scene Object Preset, Empty Solid Objects, Scripts, Portals, Entry Points and Anchors. You can also place imported Viewpoint Objects using the Scene Editor.

Positioning Models as Scene Objects


Scene Objects include models that are imported using the File > Import > Model menu command or that are placed in the Scene from the Object Presets palette. Scene Models are Atmosphere scenes that have been saved as an ATMO le. These saved scenes can be imported to create new scenes or add to scenes. When imported, Scene Models appear as a new Scene Group in the Scene Hierarchy called <model>. Scene Objects imported using the File > Import > Model menu command will appear in the same location as they were when they were exported. To place a Scene Model from the Object Presets palette, select it in the Object Presets palette then click in a Scene Editor window. Alternately, click on the Place Scene Object Preset tool in the Scene Tools toolbar, then click in the Scene Editor window where you wish to position the object. If you click and drag the mouse while placing a Scene Object, you can move the model about in the scene. The Scene object will be displayed in the Scene Hierarchy palette using the name given the object before it was exported. It also is identied as a new Scene Group called <model>. Scene Objects can be edited by selecting the object and choosing the Object > Edit Selected Object menu command or by double-clicking on the Scene Object. Currently, the only type of Scene Object that has its own editor (and for which double-clicking will have the effect of switching to its editor) is a Solid Object. Double-clicking on a Solid Object in the Scene Editor will switch all of the wireframe editor views to a Solid Object editor for that object.

All Scene Objects presets are identied with this icon and a title.

86

CHAPTER 8

When you click on an object in the Objects Presets palette, the Scene Object button in the Scene Tools toolbar will be selected automatically. By holding down the Shift button while placing an object in the Scene Editor, you can create multiple copies of the object.

Positioning Solid Objects


The second button from the left in the Scene Tools toolbar is the Place Empty Solid Objects button. Solid Objects are collections of primitive objects that behave as a single rigid geometric object. To create a new Solid Object, click on the Place Empty Solid Object button in the Scene Tools toolbar, then click in the Scene Editor window at the point where you wish to position the Solid Object. The Solid Object icon will appear and becomes the origin of the Solid Objects collection of primitives. Solid Objects are listed in the Scene Hierarchy as a parent Solid Object with its child primitives located in an indented list below it. Each scene can have multiple Solid Objects. Double-clicking on an Empty Solid Object in the Scene Editor will automatically switch to Solid Object Editor mode. All new primitive objects will be added to the selected Solid Object. Solid Objects are covered in more detail in Chapter 9, Assembling Solid Objects.

Adding Scripts to the Scene


Script Objects can be attached to Scenes or Solid Objects using the Scene Editor. To add a script to a scene, click the script button (third from left) in the Scene Toolbar and then click at a point in the Scene. A script icon will appear, and its position becomes the origin about which the script action will take place. Script Objects can also be loaded using the File > Import > Script menu command, and these will appear at the origin of the current Scene. Script Objects can also be added as presets to the Object Presets palette and are identied with a Script Object icon . If you double-click on a script icon in the Scene Editor, a text editor will open allowing you to edit its script. You can learn more about working with Script Objects in Chapter 14, Adding Interactivity with Scripts.

Script Object presets are identied by this icon and a title.

Using Viewpoint Objects


Viewpoint Objects are 3-D objects that were exported from other 3-D software packages in the Viewpoint Media format. Viewpoint object les carry the MTX, MTZ or XML extension. Unless they are subsequently converted to the

ADOBE ATMOSPHERE 87 User Guide

Atmosphere native Surface Object type, Viewpoint Objects are considered props. That is, they do not participate in global illumination calculated by Atmosphere, nor can they be edited in most ways in Atmosphere (they can be positioned, scaled, and rotated as a whole, however). The advantage of props is that they do continue to retain most of the characteristics they had when exported from the design application in which they were originally authored (including key-frame animations, special surface properties, and so on), and they can be controlled at run-time through the JavaScript API. Use props for dynamic objects within the scene. When importing a Viewpoint Object to be used as a full-edged citizen of the scene (part of the environment), import the Viewpoint Object and then use Atmosphere to convert it to a Surface Object. Large, complex Viewpoint Objects with thousands of polygons can cause Atmosphere to perform sluggishly. Before saving a 3-D model to be used in Atmosphere, optimize the model by reducing it to the smallest number of polygons possible. Viewpoint Objects can be imported using the File > Import > Viewpoint Object menu command or from a preset loaded into the Object Presets palette. Viewpoint Objects that are imported will initially be placed at the Scenes origin, while Viewpoint Objects added from the Object Presets palette can be placed anywhere in the Scene by clicking at that point. Select the object icon in the Object Presets palette, then click in the Scene at the point where you wish to position the object. Holding down the Shift key allows placing multiple copies of the Viewpoint Object.

Viewpoint Objects presets are identied by this icon and a title.

Viewpoint Objects can also include animation sequences which are controlled by the JavaScript API at run-time See chapter 14, Adding Interactivity with Scripts.

Moving Viewpoint Objects


Selecting and dragging a Viewpoint Object in a Scene Editor view will move the object about in the scene. If you hold down the Shift key while dragging the Viewpoint Object, it will move vertically, perpendicular to the XY plane. Holding down the Ctrl key while dragging will constrain it to moving along a single axis.

Tutorial: Adding a Viewpoint Object to a Scene


To add a Viewpoint Object to an existing scene, follow these steps.
1

With the Scene Editor active, select File > Import > Viewpoint Object. Select a Viewpoint Object to add to the scene, then click the Open button (Viewpoint Object les must have the MTX, MTZ or XML le extension). The Viewpoint Object will appear at the origin of the Scene view.

88

CHAPTER 8

Select and drag the Viewpoint Object to the position you wish. You may need to use several different views to correctly position the Viewpoint Object.

Viewpoint Objects can be imported into Atmosphere Scenes.

Tutorial: Adding a Viewpoint Object from the Object Presets palette


Another way to add Viewpoint Objects to the scene is by using the Object Presets palette. To add a Viewpoint Object from the Object Presets palette, follow these steps. 1 With the Scene Editor active, select Window > Object Presets to open the Object Presets palette. Click on the palette menu symbol (or right-click in the palette) and select the Add Viewpoint Object Preset menu command. This will open a le dialog box. Select a Viewpoint Object and click the Open button. The Viewpoint Object preset will appear in the Object Presets palette. 2 Select the Viewpoint Object preset in the Object Presets palette and then click in the Scene at the point where you wish to place the Viewpoint Object.

ADOBE ATMOSPHERE 89 User Guide

3 To reposition the Viewpoint Object, select it and drag it to a new location. Presets make it easy to add multiple copies of an object to a Scene.

Scaling Viewpoint Objects


When a Viewpoint Object is selected in the Scene Editor, all wireframe lines will appear in red and the object will be surrounded by a bounding box of blue lines. At the corner and midpoints of this bounding box are square handles. If you click and drag on these handles, the Viewpoint Object will be scaled in the direction of the handle.

Other Scene Objects like Solid Objects can also be moved and scaled in the Scene Editor that same way as Viewpoint Objects.

Tutorial: Scaling a Viewpoint Object


To scale and a Viewpoint Object, follow these steps. 1 Click on a Viewpoint Object in the Scene Editor or in the Scene Hierarchy palette. When selected, the Viewpoint Object will be highlighted in red and surrounded with a bounding box of blue lines. 2 Select one of the bounding box handles and drag it in the direction that you wish to scale the Viewpoint Object.

90

CHAPTER 8

Dragging on the bounding box handles will scale a Viewpoint Object.

Converting 3-D Models to the Viewpoint Format


Not all 3-D software supports exporting to Viewpoint Media format. It is sometimes necessary to use another application to open and convert les into this format.

ADOBE ATMOSPHERE 91 User Guide

The export path to Viewpoint format from major 3-D software packages Software package 3ds max Maya LightWave SoftImage Bryce Poser Carrara TrueSpace Viewpoint exporter? Yes Yes Yes No Yes Yes Yes Yes obj Export rst to...

Converting 3-D Files for Import into Atmosphere


If your 3-D software package does not export les directly to the Viewpoint format, or have an accessory exporter module that does so, you may be able to export to the commonly used OBJ le format instead. This le can then be converted to the Viewpoint Media format using the Viewpoint Scene Builder application, which can be download for free at http://developer.viewpoint.com/.

Converting Viewpoint Objects to Surface Objects


Imported Viewpoint Objects cannot be globally lit or textured in Atmosphere.

92

CHAPTER 8

An imported Viewpoint Object of a robot standing next to a grandfather clock, a Solid Object created in Atmosphere. Note that the grandfather clock casts a shadow after Atmosphere has computed global illumination for the scene, but the robot does not. You can convert Viewpoint objects into native Atmosphere Surface Objects with the Object > Convert to Surfaces menu command. Using this command will convert the Viewpoint Object into a Surface Object.

Atmosphere will not let you convert a Viewpoint Object to a Surface Object until the project le has been saved.

Surface Objects are included in Atmospheres Radiosity lighting calculations and can be textured in Atmosphere. Surface Objects lose any animated sequences that they may have contained before conversion.

ADOBE ATMOSPHERE 93 User Guide

After being converted to a Surface Object, the robot can be lit and textured in Atmosphere. When Viewpoint Objects are converted to Surface Objects, the applied textures are saved as PNG les.

Creating Avatars
Atmosphere can also be used to create avatars. In fact, many of the existing preset avatars were created using Atmospheres primitives, including the default blue man. Atmosphere avatars must be sized and positioned carefully, if they are to appear in the environment correctly. If you create an avatar in Atmosphere, position the avatar so its eye is at the scenes origin point. This is where the virtual camera will look out from the model when the Avatar is loaded with the Player.

94

CHAPTER 8

An avatars eye level must be aligned with the scenes origin to appear correctly in the Player.

Creating a Portal
Portals link Atmosphere environments. When a user enters a Portal in the Atmosphere Player, a new environment is loaded and the viewer nds themselves in a new place. Portals are represented in Player by glowing red, blue and green panes which rotate in space just above eye level. Portals are created and positioned using the Scene Editor. With the Scene Editor active, select the fourth icon from the left on the Scene toolbar. Click on this tool, then click at the position where you wish to add the Portal. With the Portal object selected, the Inspector palette includes a Target URL parameter. Enter the URL of the environment to which you wish to link.

ADOBE ATMOSPHERE 95 User Guide

A Portal will connect to the environment entered in the Target URL box.

Positioning an Entry Point


An Entry Point is the location where users (and their avatars, if turned on) will rst arrive when they visit your environment. When a new le is opened using the File > New (Ctrl+N) menu command, an Entry Point is created by default. The default Entry Point is named Viewer in the Scene Hierarchy palette. You can position this Entry Point using the Scene Editor. In addition to the default you can create other Entry Points. Click on the Entry Point tool in the Scene Objects toolbar and click in the Scene at the location where you wish the Entry Point to be located.

Setting Multiple Entry Points


The default Entry Point will determine the thumbnail of the world that appears in the Bookmark palette. There are two buttons in the Inspector palette that will help you position the Entry Point advantageously. The Move Entry Point to Actor Location button allows you to move the Entry Point to your current position in the Appearance Editors Player View window. The Move Actor to Entry Point Location button will move your view to the currently set Entry Point.

The Actor is represented by a small person icon in wireframe views. As you navigate in Player View, the Actor will move in sync in the wireframe view.

96

CHAPTER 8

The Inspector palette for the Entry Point object includes buttons to change the Entry Points location. The Inspector palette also allows you to give the Entry Point a Name (if its not the default) and a Title. An Atmosphere scene can have several Entry Points.

Using Anchors
Anchors are used to mark positions in space. With an Anchor object dened, you can script actions based on the Anchors position. For example, you could position several Anchors that dene a path and then use a script to move visitors along that path, from Anchor to Anchor.

Anchors are also available in the Solid Object Editor. Anchors that are created as part of a Solid Object will move along with the other primitives in the Solid Object Group that contains them. An Anchor created in the Scene Editor (a Scene Anchor, versus a Solid Object Anchor) will move along with the other Scene Objects in the Scene Group that contains them.

Naming Scene Objects


All Scene Objects can be named by entering a name in the Name eld of the Inspector palette that appears when the Scene Object is selected. You can also name objects in the Scene Hierarchy palette.

Locking Scene Objects


Locked objects cannot be selected in an editor. To lock a Scene Object, select the object and choose the Locked option in the Inspector palette, or click on the Lock column in the Scene Hierarchy palette. A small lock icon will appear.

ADOBE ATMOSPHERE 97 User Guide

Be aware that even though a scene Solid Object is locked, components of Solid Objects selected by double-clicking in the Scene Hierarchy can be edited in the Solid Object Editor.

Setting Visibility
You can set objects to be Visible in Wireframe Views and/or Visible in Player View using the options found in the Inspector palette. You can also turn wireframe visibility on and off using the Visibility column in the Scene Hierarchy palette. When a Scene Object is designated to be visible in the Wireframe views, an eye icon will appear in the objects row in the Scene Hierarchy palette. The Visible in Player View option is not shown in the Scene Hierarchy palette. This option is not available for the Script and Portal scene objects. Making objects temporarily invisible in the Player will come in handy as you work with lighting.

98

CHAPTER 8

ADOBE ATMOSPHERE 99 User Guide

Chapter 9: Assembling Solid Objects


Atmosphere environments commonly contain solid objects everything from tables to rooms and buildings to mountain ranges and more. In Atmosphere, these are called, appropriately enough, Solid Objects. This chapter covers using Atmospheres Solid Object Editor to create and assemble solid objects; constructs that are normally assembled from simple shapes like a box or a cone called primitives. The Solid Object Editor uses the Solid Object Tools toolbar to select from among eight primitives and add them to Solid Objects.

Understanding Solid Objects


Solid Objects start with an Empty Solid Object. One Empty Solid Object is added to new Scenes by default, and additional Empty Solid Objects can be added using the Scene Editor (see Chapter 8 for details). Each Solid Object will represent a group of primitives that can be moved as if they were one piece. While an entire environment can be built as a single Solid Object, it is a much better practice to break environments into many Solid Objects for easier handling and better performance. Once an Empty Solid Object is added to the scene, you can switch to the Solid Object editor using the Object > Edit Selected Object menu command (or by double-clicking on the Solid Object icon in the Scene).

Adding Primitives
To place a primitive object in the Solid Object Editor, click an icon in the Solid Object toolbar, then click in the Solid Object Editor window at the location where you wish to place the object. If you hold down the mouse button when placing an object, you can drag the object around to a new position.

The Solid Objects toolbar holds all the primitive objects. To create another identical object, either select the icon in the toolbar again or use the Edit > Duplicate (Ctrl+D) menu command. Once an object is created, the Selection Tool (V) is automatically selected again. By holding down the Shift key while creating a primitive, you can create multiple copies of the selected primitive without having to click in the Solid Object Tools toolbar again. When you have nished adding primitives to the Solid Object, double-click anywhere in the background to re-enter the Scene Editor in which the entire Solid Object can be moved, scaled, and rotated together as a single unit. Doubleclicking in the Solid Object will return to the Solid Object Editor.

100

CHAPTER 9

Understanding Boolean Operations


Atmospheres Solid Object editor is an example of a Boolean or solids modeler. It uses a principal called Constructive Solid Geometry (CSG) to combine primitive solids into more complex assemblies. By grouping primitives together, more complex pieces can be constructed. By grouping groups with primitive and other groups, even more complex objects can be assembled. The rst thing to note is that all Solid Objects in Atmosphere ultimately are composed of solid primitives. A solid primitive is not a collection of polygons or surfaces, but a closed area of space dened by its type and some parameters. In Atmosphere the parameters that describe the shape of a solid primitive come from a combination of the Connectors used to shape the Primitive, and other parameters that are available in the Primitives Inspector. By moving Connectors around and by changing the parameters of the Primitive through its Inspector, the user can change the shape, size, and location of the Primitive. If only Primitives were allowed, then the types of objects that could be created in this manner would be very limited. Constructive Solid Geometry, couple with the concept of grouping, allows an innitely complex structure to be assembled from these relatively simple elements. Primitives can be combined in Solid Object Groups. Solid Object Groups can also be combined in higher-level Groups, along with other Groups and/or Primitives. Normally, objects (Primitives or Groups) combined together into a single Group will represent what, in Boolean nomenclature, is called a Union Surface. This is simply the skin of the object that is created by sticking together all the Primitives (and other, lower-level Groups) within the Group. If objects within the Group overlap (or intersect) each other, the areas of the objects that are hidden inside other objects will be discarded. The skin or polygonal surface of the Group as a whole will be the outermost polygons from all the objects in the Group that are visible. Two other Boolean operations are allowed within Groups, however. These operations make it possible to construct much more complex structures. The rst, and most heavily used, is the Boolean Subtract Operator. If you mark a Primitive or Group as subtractive, then, instead of its area being combined additively with the other Primitives and Groups in its own Group, its area will be subtracted from the other elements in its Group. This allows the user to carve holes in structures. This is useful for creating windows, doors, and other common architectural features, but it can also be used in a number of surprising ways to carve objects out of others. The second Boolean operation to review is the Boolean Intersection Operator. This operation is applied to a Group as a whole, by marking a property of the Group in its Inspector. When marked as an Intersection Group, the skin of the resulting object for the Group will be constructed by nding all of the common surfaces of its element objects. For example, if a Group contained two disjoint (non-intersecting) boxes, then its intersection would be empty, it would contain no surfaces. If one box was contained within another, larger, box, then the resulting intersection would be the smaller box. The spaces of all the element objects groups are combined so that only mutually overlapping space is considered to be part of the new object. It is best of think of each Group in the Solid Object Hierarchy as representing a complete geometric object, which is the result of all of the Boolean operations combining the elements that it contains. As you move up the Solid Object Hierarchy, the object representing each Group (which will always itself continue to be a solid object) is combined with higher-level elements, until the very top level of the hierarchy is reached. At this point, the nal Solid Object in the scene is dened. Each time you switch from a wireframe view to the Player View, this bottom to top calculation is

ADOBE ATMOSPHERE 101 User Guide

performed in order to generate this top-level Solid Object. In the Scene Editor, Solid Objects appear as rigid bodies which can be moved around, rotated, and scaled as a whole.

Connectors, Welding, Constraints and Layouts


Another concept upon which the Atmosphere Solid Object Editor is based is that of welding Connectors together. In the previous section, we saw that Primitives were at least partially dened by their Connector positions. Thus, a Floor Primitive will have its four corners dened by its four Connectors. The solid space contained by the Floor Primitive will build itself around those Connectors. You can never create just a single polygon or a single sided object in the Atmosphere Solid Editor. Connectors dene solids procedurally, not by outlining their surface polygons directly. The Atmosphere Solid Object Editor tries to make the design of spaces or environments easy. One of the ways it does this is to allow Connectors to be welded or snapped together. When two Connectors are welded together, they essentially become a single Connector. From that point onward, the one or more Primitives that share that Connector will all be affected by moving the Connector. So, for example, you could weld together a number of Floor Primitives to construct a single, larger and more complex oor for a room. If you wanted to reshape the outer edge of this oor, you could move one of the Connectors on its edge, and the entire shape of the oor would change. You could also weld a Wall Primitive to a Floor Primitive to create a right-angled wall-oor section. If you moved the Connector at the bottom of this assembly, both the wall and the oor part would change simultaneously. They would stay stuck together. In order to make layout editing easy, there is one more concept that has to be considered. The Atmosphere Solid Object Editor also provides constrained Primitives. A constrained Primitive is one in which its shape, size, or location is intelligently computed so as to maintain some sort of predened constraint or rule. For example, the Floor Primitive in Atmosphere always is constrained to remain horizontal. This means that, if you grab one of the Floor Primitives dening Connectors and move it vertically (in Y), all the other Connectors for the Floor Primitive will also move the same amount in the same direction. The goal of the constraint in this case is to keep the Floor Primitive horizontal. You cannot tilt a Floor Primitive by moving one of its Connectors. Similarly, the Wall Primitive is constrained to be always vertical, you cannot tilt a Wall Primitive from the vertical by moving one of its Connectors. If you snap together a Wall and a Floor Primitive, then the angle between them will always be 90 degrees. In combination with Connector welding, constraints give you the ability to rapidly construct complex layouts and modify them by moving one or more Connectors. You do not have to worry about whether the room will go out of true, and you do not need to worry about moving all of the surfaces of the room so that they continue to match up. Because of the combination of Boolean operations, Connector (procedurally) dened solids where the Connectors can be snapped together, and constraints on Primitives, this layout behavior becomes possible. This may sound complicated, but if you drop a bunch of Primitives into the Solid Object Editor, snap them together, and start moving Connectors around, the process should become immediately apparent.

102

CHAPTER 9

Naming Objects
Once an object is created (a Primitive or a Group), it will appear in the Object Hierarchy palette with its type listed in brackets. To name the object, select it and type a name in the Inspector palettes Name eld. Alternately, select the primitive in the Object Hierarchy palette and click on the name. The eld will become editable and you can change the name. Note that the object type will still appear next to the name in brackets. Any object in the Object Hierarchy can be named in this manner, including Solid Object Groups. Objects in the Object Hierarchy palette are always listed in alphabetical order. When you rename an object, it moves to the appropriate position in the alphabetized list. This sometimes causes objects to disappear from the visible part of the Hierarchy (you may need to scroll down or up to locate it).

Primitive objects appear in the Object Hierarchy palette beneath the Solid Object they belong to. Clicking the arrow to the left of a Solid Object alternately shows and hides member objects.

Tutorial: Creating a Table


You can create a table using the Floor primitive and four Column primitives. To create a simple table, follow these steps. 1 Select the File > New (Ctrl+N) menu command to create a new Scene. 2 Depending on the state of Atmosphere, there may or may not be a Scene Editor window visible. If not, create a new view by selecting View>New View (Shift+Ctrl+N). A new Solid Object icon was automatically created in the new le. 3 Make the Solid Object visible by opening the Stage folder and clicking on the Solid Object icon in the Scene Hierarchy. A Solid Object icon will appear in the Scene window near the center.

ADOBE ATMOSPHERE 103 User Guide

4 Enter the Solid Object Editor by double-clicking on the Solid Object icon in the Scene Editor window. You can also double-click the Solid Object icon in the Object Hierarchy list. 5 Right-click in the window and select Preset Positions > Perspective (or type F8) to bring up Perspective view. Click on the Floor icon in the Solid Object Tools toolbar and click anywhere in the Perspective view window. A slab-shaped oor will appear. 6 Select the Column icon in the Solid Object Tools toolbar and hold down the Shift key and click four times in the Perspective view to create four Column objects, one at each corner of the Floor object. 7 Select each Column object and change its Radius value in the Inspector palette to one foot. 8 Select the Floor object and switch to the Front view (type F6 or right-click and choose Preset Position > Top). Then drag the Floor object to align it with the Column tops.

A simple table created from primitive objects, in the Perspective view (F8)

104

CHAPTER 9

Learning the Primitive Types


There are eight different primitive objects available in the Solid Object Tools toolbar. When a Solid Object primitive is selected, it appears in red and its connectors are displayed as small white squares. Using connectors to edit objects is covered in Chapter 10, Selecting and Editing Objects.

Box
The Box primitive is a simple rectangular box with eight corners. Its default size is a cube with edges two feet long. Dragging its connectorsthe white squares that appear when it is selected will let you resize it as needed. The Box primitive has no extra parameters in the Inspector palette.

Box objects are a common primitive. Note that selected objects appear in red, with small white connectors that allow resizing.

Column
The Column primitive resembles a cylinder. The Column primitive defaults to 10 feet tall and two feet in radius, and includes two connectors, one at each end. These connectors can be used to adjust the height of the Column primitive. Columns also have two parameters adjustable in the Inspector palette. The Faces value sets the number of edges that

ADOBE ATMOSPHERE 105 User Guide

comprise the circular cross-section. This value can range from three to 64, with larger numbers resulting in a more nearly circular Column. The Radius value is the radius of the circular cross-section.

Column objects are another common primitive object.

Cone
The Cone primitive is similar to the Column primitive, except that the radius is different at either end of the cone. Its Inspector parameters include Faces, Top Radius and Bottom Radius.

106

CHAPTER 9

Cone objects are like columns with a narrow end.

Triangular Slab
The Triangular Slab primitive defaults to two edges 10 feet long joined at a right angle. It has three connectors, one at each corner. The Triangle Slab has one Inspector parameter, Thickness.

ADOBE ATMOSPHERE 107 User Guide

Triangular Slabs have a thickness parameter in the Inspector palette.

Stairs
The Stairs primitive creates a set of stairs with a connector at each corner. The Stairs primitive is the smartest solid primitive currently available in Atmosphere. An entire ight of stairs can be constructed as a single Stairs primitive, by dening the position of only four Connectors. Basically, the Stairs primitive is constrained so that the height of a single stair is always the same, the number of stairs increases or decreases to match the height between the top two and the bottom two Connectors, and the top and bottom stairs encompass the distance between the two Connectors that dene each of them. If you drop a Stairs primitive into the Solid Object Editor and start moving its Connectors around (try this from both a Top view and a Front view), this will become more apparent.

108

CHAPTER 9

Stairs objects are useful for creating buildings.

Floor and Wall


The Floor primitive is similar to the Triangular Slab primitive, except it creates a rectangular slab with four Connectors. The Floor primitive has a Thickness parameter in the Inspector. The Floor object has a special command associated with it: Edit > Extrude Walls from Floor (Ctrl+E) automatically creates walls joined to the oor. The Wall primitive is a slab similar to the Floor object, but it is oriented along the XY plane at right angles to Floor objects. It includes four connectors and a Thickness parameter.

ADOBE ATMOSPHERE 109 User Guide

Wall and Floor objects are slabs with different orientations. Although the primitive objects are simple, only your imagination limits the ways they can be combined into complicated objects.

110

CHAPTER 9

An environment containing A cottage created using only Atmospheres Solid Object primitives.

Deleting Objects
Objects can be deleted by selecting the object and using the Edit > Clear menu command or by pressing the Delete key. The Edit > Undo (Ctrl+Z) command will undelete a deleted object. You can also select and delete an object in the Object Hierarchy palette.

Duplicating Objects
The Edit > Duplicate (Ctrl+D) menu command will create a copy of the selected object. The duplicated object will have the same parameters as the original and will be placed a little distance away from the original. The Duplicate command makes it easy to create large populations of identical objects.

ADOBE ATMOSPHERE 111 User Guide

Grouping Objects
The easiest way to move several objects at once in the Solid Object Editor is to collect them into a group. Groups of objects are moved, scaled and rotated together. Grouping is particularly useful in crowded assemblies. A group can consist of one of more objects. To create a group, select all the objects to include in the group and select the Object > Group (Ctrl+G) menu command. When a group is selected, all objects in the group are selected together.

Grouped objects can be moved together in Scene Editor view. Object groups are identied in the Object Hierarchy palette with the name, Group and the number of items contained within the group. Groups, like Hierarchy objects, can be given a name by clicking on the selected group name and typing a new name. All objects that are members of a group will appear as sub members of the group. Clicking on the arrow icon to the left of the group name will cause all objects to roll up in the hierarchy under the group name. Groups can contain other groups, called nested groups.

112

CHAPTER 9

Groups appear in the Object Hierarchy palette as either a folder or a folder with its child objects visible. Clicking the arrow icon by the folder expands or collapses the hierarchy at that point. Another way to create a group is by using the Object > New Group menu command. This command will create a new group in the Object Hierarchy palette. The new group will have no items. You can add objects to a group by dragging and dropping them on the group in the Object Hierarchy palette.

Drag and Drop Grouping


In the Object Hierarchy palette, you can move objects between groups by dragging them from one group to another The objects relative position to the origin of the group will remain the same in wireframe view, but it will henceforth move as part of its new group.

Making Groups Active


Selecting the Object > Activate Group menu command makes the currently selected group active, so that all new objects that are created will be placed in this group. The active group will be shown in bold in the Object Hierarchy palette.

Group options
Like Solid Objects, Groups of objects can be made subtractive in the Inspector palette. Groups have the additional option to form the Boolean Intersection of the grouped objects.

ADOBE ATMOSPHERE 113 User Guide

Grouped objects have an additional option.


Making subtractive groups If the Make Contents of Group Subtractive option is selected, then the assembly represented by the contents of the group will itself subtract from objects in the group that contains it. When a group is marked as subtractive, an icon will appear in the Object Hierarchy palette.

Even though a group is marked as subtractive, the individual objects in the group will not be marked as subtractive.

114

CHAPTER 9

An entire group of objects can be marked as subtractive. Above are Two Floor objects that are each overlapped with a grouped array of Box objects. The group on the right is marked as subtractive.
Creating Boolean intersections The Boolean Intersect Contents of Group option for groups is used to create an

assembly from the contents of the group whose skin is formed only from the overlapping portions of the areas enclosed by the objects. All non-overlapping portions will not be visible. For example, consider c. The grouped objects and the Floor can be added, subtracted, or subtracted with the Boolean Intersection option.

ADOBE ATMOSPHERE 115 User Guide

A Box object grouped with an overlapping Column object placed through the center of a Floor object.

116

CHAPTER 9

Subtraction of the grouped object from the Floor object.

ADOBE ATMOSPHERE 117 User Guide

Subtraction of the grouped object from the Floor object with the Boolean Intersect option selected. The Boolean Intersect Contents of Group option will only work on groups that have overlapping objects. If no objects in the group overlap, the entire group will be invisible.

Ungrouping Objects
A group of objects can be ungrouped using the Object > Ungroup (Shift+Ctrl+G) menu command. This will eliminate the group from the Object Hierarchy and the sub member objects will become separate objects.

Locking Objects
There are two options that prevent objects or groups from being accidentally selected locking and hiding. Locked objects will still be visible in the scene, but they cannot be selected. This is convenient if you need to see the object, but dont want it to inadvertently edit it.

118

CHAPTER 9

To lock an object, select it and choose the Object > Lock > Selection (Ctrl+L) menu command. Clicking on a locked object with the Selection Tool will do nothing. Locked objects have a small lock icon in the Object Hierarchy palette.

Locking a group will automatically lock all the objects contained within the group also.

Locked objects are easily identied in the Object Hierarchy palette. The Object > Lock > Others command locks all objects except those that are selected. This is useful if you want to work on a single object without selecting the rest. Object > Lock > All (Alt+Ctrl+L) locks all objects in the scene. Object > Unlock All (Shift+Ctrl+L) unlocks all objects in the scene.

Hiding Objects
Another option is to hide objects. Hidden objects will still be available in the Object Hierarchy palette, but they will not be visible in the scene. To hide an object, select it and choose the Object > Hide > Selection (Ctrl+H) menu command. Hidden objects will not have a small eye icon appear in the Object Hierarchy palette.

ADOBE ATMOSPHERE 119 User Guide

Hidden objects do not have the eye icon visible. Object > Hide > Others hides all objects except those that are selected. Object > Hide > All (Alt+Ctrl+H) hides all objects in the scene. The Object > Show All (Shift+Ctrl+H) unhides all objects in the scene.

120

CHAPTER 9

ADOBE ATMOSPHERE 121 User Guide

Chapter 10: Selecting and Editing Objects


Atmosphere offers a powerful suite of editing tools. For those who are new both to 3-D authoring and Atmosphere, it helps to remember that there are 2 editors (Scene and Solid Object Editors) that work in wireframe view, and two selection tools available in both editors. Put another way, beginners have a 1 in 4 chance of selecting the right editor and selection tool on a given step. However, a little practice and review will go a long way toward m astering Atmosphere. Editing objects in Atmosphere starts with selecting the objects to edit.

Selecting Objects
Atmosphere offers a number of ways to select objects, both with the mouse and from the keyboard, allowing users to choose their most comfortable and productive personal style.

The Selection Tools


There are two selection tools in Atmospheres Tools toolbar. The rst button activates the Selection Tool (V), denoted by a black mouse cursor. The second button chooses the Direct Selection Tool (A), denoted by a white mouse cursor. The two tools behave differently from each other, and one behaves differently in the two wireframe editors. The Selection Tool (V) selects an entire Solid Object when a user clicks on one in either the Solid Object Editor or the Scene Editor. A bounding box appears, outlined in blue, which encompasses all of the pieces that make up the Solid Object. Small blue handle boxes appear at the corners and in the middle of edge lines, and in the middle of the Solid Object. The edge handles allow resizing of the object, while the center handle allows repositioning of the object. The Direct Selection Tool (A) behaves a bit differently in the two wireframe editors. In the Solid Object Editor, the Direct Selection Tool (A) selects only the particular piece of a Solid Object that a user clicks on. The piece will appear outlined in red with small white handles called connectors which allow resizing. In the Scene Editor, the Direct Selection Tool (A) selects an entire Solid Object, which appears in red minus the white connectors. You can move, but not resize the object.

Selecting by clicking
The easiest way to select an object is to click on it with the mouse cursor. In the Solid Object Editor with the Direct Select Tool (A) active, a selected object will appear red with white handles. For example, when a single Box object is selected, the box will turn red and two connectors will appear at opposite corners.

122

CHAPTER 10

The red wireframe lines denote a selected object in the Solid Object Editor with the Direct Selection Tool (A) active.

Selecting from the Object Hierarchy palette


Another way to select objects is to select an objects name in the Object Hierarchy palette. The selected objects name will be highlighted in blue when clicked. It will also be selected in the Scene or Solid Object Editor, and will appear either in red (Direct Selection Tool active) or outlined in a blue bounding box (Selection Tool active).

You can select objects in the Scene Hierarchy palette in the same way.

ADOBE ATMOSPHERE 123 User Guide

Selected objects are highlighted in blue in the Object Hierarchy palette.

Selecting multiple objects


Multipleobjects can be selected by clicking and dragging an outline around them. All objects that are completely within the dragged outline will be included in the selection. You can also select several objects by holding down the Shift key while clicking on individual objects. Any individual objects can be selected in the Object Hierarchy palette by holding down the Ctrl key while clicking or a contiguous range of objects can be selected by holding down the Shift key while clicking the rst and last object.

124

CHAPTER 10

When multiple objects are selected, they are all highlighted in red in the Solid Object Editor with the Direct Selection Tool (A) active.

Moving Objects
With the Direct Selection Tool (A) active, you can move objects by clicking in them and dragging them to a new position. In Perspective or Isometric view, the object will move in the horizontal plane on which it rests only. You can move the object vertically by clicking on it, moving it in the plane and then dragging it with the Shift key held down. Holding down the Ctrl key while dragging will constrain the object to move along a single axis. In Top, Bottom, Left, Right, Front and Back view the object can be moved vertically without holding down Shift. Vertically moving objects in Perspective or Isometric view is just a little tricky. To move vertically, click on the object and move it within its current plane before holding down the Shift keyat which point you can move vertically. If you hold down the Shift key before clicking the object, nothing will happen. You can also move objects vertically by opening a New View (F4) and selecting Preset Position > Front from the Contextual Menu and then moving the object in that view.

ADOBE ATMOSPHERE 125 User Guide

Using Guidelines and Shadows


As you move an object, lines appear from a point directly below the center of the object to the X and Z axes origin along with the distance values. These lines are referred to as guidelines. Guidelines can be turned off or onin the Preferences dialog box. Shadows are outlines of objects projected onto the base plane, and are useful in Perspective or Isometric view to judge where objects are located relative to the grid. Shadows can also be enabled/disabled in the Preferences dialog box.

If the Snap to Grid option is enabled in the Preferences dialog box, then the Guideline values will be integers. If the Snap to Grid option is disabled, then the displayed values will include values computed to several decimal places.

Guidelines show the distance from the X, Y and Z axes while Shadows locate an object on the grid..

Making Precision Movements


Atmospheres Options tool bar, which can be free oating or docked at the bottom of the screen, allows you to enter precise position coordinates in the X, Y and Z elds. You can move objects relative to their current location using the Move eld also found in the Options toolbar by entering a value, checking the X, Y, or Z axis checkboxes and clicking the Apply button.

126

CHAPTER 10

Precise object movements can be made using the Options toolbar.

Editing using Connectors


You can move or resize objects using the mouse. To move an object with the Selection Tool (V) active, click in the central blue box and drag it to its new location. To move an object with the Direct Selection Tool (A) active, click anywhere in the object except the square white handles and drag it to its new location. Resizing, also called scaling, is accomplished using the objects connectors. Connectors are the white squares or handles positioned in the corners or at the ends of primitive objects.

Selecting connectors
You can select connectors with the Direct Selection Tool (A). First click on and object in the Solid Object Editor. It will turn red with white connectors. Click on a connectorit will turn red and the object will turn white. By holding down the Shift key while clicking on connectors of selected objects, you can select multiple connectors. Another way to access to connectors is to select Connectors in the Select drop-down list in the Options toolbar. This will display the connectors for all objects in the Solid Object Editor.

ADOBE ATMOSPHERE 127 User Guide

With all connectors visible, you can easily select multiple connectors.

Scaling Objects
Scaling or resizing is accomplished by dragging on an objects connectors with the Direct Access Tool (A) active in the Solid Object Editor. When you grab and drag a connector, only the attached corner of the object moves. This will increase the size of objects like a Box. Columns and Cones will be elongated and Slabs and Stairs will be stretched. You can scale objects in different dimensions by switching to appropriate views like Top, Right and Front.

128

CHAPTER 10

Dragging a connector will resize a primitive object.

Skewing Objects
In Perspective view, you can drag a connector in two directions at once: the effect is to skew the object.

Dragging connectors in two directions will skew the object.

ADOBE ATMOSPHERE 129 User Guide

Welding Connectors
At the right end of the Options toolbar is a Weld Connectors option and a Weld Distance value. When this option is enabled, you can weld two connectors together. Welded connectors will move together when any of their objects are moved. The Weld Distance value determines how close the connectors need to be to each other before they are welded together. The Weld Distance is displayed in the view as a light gray transparent circle. This circle marks the weld inuence distances and is helpful in aligning connectors so they weld together. The weld distance circle will turn yellow when a nearby connector is close enough to weld.

A gray transparent circle indicates the connector weld distance. Once two connectors are welded together, you can move one of the objects and the welded connector on the other object will follow.

130

CHAPTER 10

Moving an object automatically drags all welded connectors with it. Above is a simple table with the connectors of the table legs welded to the table top. As the Slab object is moved, the Columns top connectors follow, but the bottom connectors do not, so that, in this case, the table is skewed.

Snapping to a Grid
The Snap to Grid feature, accessed via the Contextual menu causes an objects corners to align with the grid corners automatically. Values displayed in the Options toolbar will be integer values when Snap to Grid is active.

Creating a Grid
Grids are shown by default: you can change the spacing or turn them off using the Grid option in the Display tab of the Preferences (Ctrl+K) dialog box.

The grid feature in Atmosphere zooms with the view to provides grid lines at any scale.

ADOBE ATMOSPHERE 131 User Guide

Grids can be enabled and spacing set in the Preferences dialog box.

Setting Grid Spacing


Checking Grid in the Display tab of Preferences (Ctrl+K) enables the Spacing and Subdivisions elds. Spacing is the distance from the origin to the rst major division. This value will appear next to the rst major division and a multiples of this value will appear at each subsequent major division. Subdivisions sets the number of subdivisions that appear between major divisions. If you zoom in far enough, each subdivision line will also show its distance from the origin. For example, for a Spacing of 5 feet and 4 Subdivisions, the rst major division will be labeled 5ft and, if you zoom in far enough, the rst subdivision will be labeled 1.25 ft. Zooming causes grid divisions to be relabeled as needed.

132

CHAPTER 10

Grids can have arbitrary Spacing and Subdivisions.

Setting Snap Options


The Snap to Grid option in the Display tab of Preferences (Ctrl+K) causes object corners to snap to the nearest grid intersection if selected. The Spacing and Subdivisions settings affect the granularity of Snapping: smaller Spacings and larger Subdivisions allow ner movements when Snap to Grid is enabled. The Snap to Grid is also available in the Contextual menu.

Tutorial: Building a Chess Board


Chess acionados can use the Floor primitive and the Weld Connectors option to create a chess board. Follow these steps: 1 Select File > New (Ctrl+N) to make a new le. 2 Select Top view in the Solid Object Editor by pressing F5 or Contextual Menu > Preset Position >Top. 3 Select the Floor object in the Solid Objects toolbar and click in the Top view to create a single Floor object. 4 In the Options toolbar, enable the Weld Connectors option and change the Weld Distance to 1 ft. 5 In the Solid Objects toolbar, select the Floor object again and click in the Top view to create a second Floor object. 6 Select and drag the second Floor object and position it to the right of the rst one with connectors aligned. The transparent gray circles surrounding the connectors will glow yellow when they are within weld distance.

ADOBE ATMOSPHERE 133 User Guide

7 Drag an outline over both Floor objects to select them both and move them to the lower left corner of the Top view. 8 With both Floor objects selected, select the Edit > Duplicate (Ctrl+D) menu command to duplicate both objects. Drag the duplicated objects until their bottom connectors align with the top connectors of the original objects. 9 Continue to duplicate and drag the Floor objects until an 8x8 array of Floor objects is complete. The chess board is a versatile model that has many uses in 3-D constructs. Because all the connectors are welded, dragging a single connector up or down relative to the plane will deform the adjacent object. By dragging various connectors up and down you can create a rough terrain.

This chess board uses Welded connectors.

Rotating Objects
Objects can be rotated using the Rotate tool (R) . Select an object, click the Rotate (R) tool and then drag anywhere around the object. The object will rotate around its center. If you rst click on a point, and then drag, the object will rotate around that point. The rotation anchor is marked with a blue target. Dragging an outline around the object will cause the rotation center to return to the center of the object. If guidelines are enabled, the value of the rotation in degrees will be displayed next to the center point.

134

CHAPTER 10

Objects can be rotated around any point.

Tutorial: Tilting a Top


To create and rotate a top, follow these steps. 1 Select File > New (Ctrl+N) to make a new le. 2 In the Solid Object Editor, press F5 to select a Top view. 3 In the Solid Objects toolbar, click on the Cone object and then click in the Top view to create a single Cone object. Set its Faces value to 12, its Top Radius to 5 and its Bottom Radius to 1. 4 Create a second Cone object for the tops upper half with 12 Faces, a Top Radius of 1 and a Bottom Radius of 5. 5 Create a third Cone object for the tops tip with 12 Faces, a Top Radius of 1 and a Bottom Radius of 0. 6 For the tops stem, create a Column object with 12 Faces and a Radius of 1. 7 Select the Front view by pressing the F6 key. Select the Weld Connectors option in the Options toolbar and set the Weld Distance to 1 ft. 8 Drag the pieces so they align vertically and drag appropriate connectors to vertically size the pieces appropriately. Notice that some of the connectors are welded and others are not. 9 Press the F7 key to select the Right view. Now you can see why some of the connectors werent welded. Again align the top parts vertically and all connectors should weld together.

ADOBE ATMOSPHERE 135 User Guide

10 Select all objects with Edit > Select All (Ctrl+A) and group them with the Object > Group (Ctrl+G) menu command. In the Scene Hierarchy palette, name the Solid Object Top. 11 Press the F6 key to see the Front view. Click on the Rotate Tool (R) and drag in the view to rotate the top about 15 degrees from its center pointenough to show a slight tilt.

The top after rotating 15 degrees around its center point.

Clearing Transformations
Mistakes happen: if your rotation center was misplaced or you drag accidentally, the topor any 3-D objectcould end up lost in 3-D space. If this happens, you can quickly recover with the Edit > Clear Transformation (Shift+Ctrl+T) command. This returns the object to its last location prior to the transformation. The Clear Transformation command will work for any transform tool that has a center anchor including Scale and Rotate. It also keeps track of multiple actions and will undo all transforms with the exception of moves. For example, if you placed an object at the origin, rotated it 20 degrees, scaled it and moved it 5 ft along the X-axis, then the Clean Transformation command would remove the rotation and scaling, but leave the object 5 ft along the X-axis.

Subtracting Objects
You can subtract primitive objects from other objects to create new shapes. If the Subtractive option is selected in the Inspector or in the Object Hierarchy palettes, the object will not be visible in the Player view. Instead it will remove

136

CHAPTER 10

its volume from objects that overlaps. For example, if you place a Cylinder so that it passes through a Box, making the Cylinder subtractive will cause a circular hole to appear in the Box in the Player view.

Cylinder and Box: Cylinder is Subtractive on the left.

Tutorial: Making Alphabet Letters


To create alphabet letters using the Subtractive option, follow these steps: 1 In the Top view of the Solid Object Editor, create a Triangular Slab object and a Floor object. 2 Drag the top connector on the Triangular Slab object until it is centered midway and above the other two connectors to form the outline a capital letter A. 3 Select Edit > Duplicate (Ctrl+D) to duplicate the Triangular Slab object. Select and move the duplicated Triangular Slab object until it is positioned inside the other Triangular Slab object and move its lower two connectors up and inward to form a small triangle inside the larger one. This will be the inside of the letter A. 4 Select and move the connectors for the Floor object to form a trapezoid shape using the Direct Slection Tool (A) and position it below the duplicated Triangular Slab object.

ADOBE ATMOSPHERE 137 User Guide

5 Select the duplicated Triangular Slab and the Floor objects and enable the Subtractive option for each in the Inspector palette. Also set the Thickness value to 1.0. This will insure that the objects cut through the rst Triangular Slab. 6 For the B and C letters, create ve Floor objects and move their connectors so that they form the letters. Then select the Subtractive option for objects that are within the outer letter objects and increase their Thickness values as you did in Step 5.

138

CHAPTER 10

ADOBE ATMOSPHERE 139 User Guide

Chapter 11: Applying Colors and Textures


The Scene and Solid Object Editors are used to construct the bare geometry of Atmosphere environments. The Appearance Editor is used to add the lighting, texture and color that make an environment seem real.

The Appearance Editor


Colors and textures can only be applied to objects in the Appearance Editors Player view. To open a Player view, select the View > Player View menu command (F4). This will open a window that displays the Atmosphere environment as if it were being viewed in the Player plug-in. You can navigate in Player view by selecting the Navigate Tool (N) options can be enabled in the Options toolbar. on the Tools toolbar. Gravity and Collide

Use the View > Fit All (Ctrl+0) menu command to quickly frame the environment in the Player view window.

Adding Color
When the Appearance Editor is selected, the icon buttons on the Texture Tools toolbar become active. These tools let you apply, remove, sample and edit colors and textures.

The Texture Tools apply to colors and textures.

Using the Apply Texture Tool


Colors are applied to whole objects or individual faces using the Apply Texture Tool (K) . This tool looks like a small paint bucket. When selected, the cursor will change to a bucket with crosshairs. Clicking in an object applies the current color as dened in the Surface tab of the Inspector palette. Take care when applying colors to an object. If you miss the object the color may be applied to the background causing like-colored objects to disappear. There is no undo feature when applying colors and textures, although you can use the erase tool to remove unwanted colors or textures.

140

CHAPTER 11

The Inspector palette lets you dene colors.

Removing Colors
You can remove colors from an object or face using the Remove Texture Tool (E) . If an object has had several colors applied to it, the Remove Texture Tool will remove only the last color that was applied. Clicking multiple times on an object with the Remove Texture Tool will remove all previously applied colors one by one.

Coloring a Single Face


At the top of the Surface tab of the Inspector palette is an Apply To drop-down list where you can choose to apply color or texture to the entire object or a single face.

Changing Colors
The color in the Inspector palette is selected by changing the Red, Green and Blue color values. You can type in new values, or click the arrow next to each value to use a slider control. You can also change the color by clicking on the color swatch, which brings up the Color palette.
Using the Color Sliders

Each Red, Green and Blue color slider ranges from 0 to 255, with 0 representing no color and 255 representing full color. The specied amount of red, green and blue is mixed together to produce the color. For example, a Red value of 255 produces pure red if Green and Blue are set to 0. Setting Red to 0 and Green and Blue to 255 produces yellow.

ADOBE ATMOSPHERE 141 User Guide

Keep in mind that colors on the computer screen are additive higher color values are brighter. This stands in contrast to media like paint and inks where larger amounts of color produce darker results known as subtractive color.

Using the Color Palette The Color palette makes it easy to choose colors. Access it by clicking the color swatch in the

Inspector Surface tab.

The Color palette is accessed by clicking the Inspector color swatch. The Color palette allows selection of preset colors displayed in the Basic colors section. You can also select any RGB color by dragging the crosshairs in the palette to the right and clicking to select a color. The current color is shown in the Color/Solid swatch. The selected colors Red, Green and Blue values are displayed, as well as its Hue Saturation and Luminance values. The Red, Green and Blue values are the same as those entered in the Inspector palette. You can enter numerical color values into the text elds to create colors from recipes. Clicking the Add to Custom Colors button adds the current Color/Solid swatch to the bank of Custom Colors. When you click the OK button, the color in the Color/Solid swatch will be transferred to the Inspector palette.
Using the Pop-up Color Selectors You can also right-click on the Inspector color swatch to open a contextual menu

consisting of a mini palette of color swatches. When a color is selected in this mini palette, its hexadecimal value is displayed at the bottom of the palette. Hexadecimal values are commonly used to specify color on web pages.

142

CHAPTER 11

Right-click the Inspector color swatch for this mini palette. Right-click on the color swatch with the Alt key held down to see a mini-palette of standard web safe colors.

Alt-right-click on the Inspector color swatch brings up the web color palette.

Tutorial: Coloring Chess Pieces


To apply color to a set of chess pieces, follow these steps. 1 Locate the Help\Tutorials\Chess folder under the directory where Atmosphere was installed. It should be a path similar to c:\Program Files\Adobe\Atmosphere\Help\Tutorials\Chess. After navigating to your folder in the open dialog, select the le chess.atmo and press Open. 2 Select View > Player View (F4) to open the Player view window. Choose View > Fit All (Ctrl+0) to t all objects within the view. 3 In the Texture Tools toolbar, click on the Apply Texture Tool (K). 4 In the Inspector palette, change the color to brown by setting the Red, Green and Blue color values to 128, 75 and 65. 5 Click on the pieces that are positioned on one side of the chess board. Be aware that each piece is made up of many separate objects. 6 Select the Navigate Tool (N) and navigate closer to the pieces to make sure that youve colored the objects completely. 7 If you accidentally click on the wrong object such as the chessboard, select the Remove Texture Tool (E) from the Texture Tools toolbar and click on the object that was colored incorrectly.

ADOBE ATMOSPHERE 143 User Guide

The completed chessboard with colored pieces.. Colors can be applied to objects using the Apply Texture Tool (K).

Adding Preset Colors


The Paint Presets palette makes it easy to store, select and apply colors to multiple objects. To add a new color preset to the Paint Presets palette, select the Add Color Preset menu command from the palette menu. This creates a paint bucket icon in Paint Presets palette with the color and its RGB values listed underneath. Initially, this new color preset is set to black with RGB values of 0.0.0. You can also access the Paint Presets palette menu by right clicking in the palette.

144

CHAPTER 11

The color preset icon identies colors in the Paint Presets palette. When a color preset is selected in the Paint Presets palette, the gray paint bucket is highlighted with color and a red border. When selected, you can change the presets color value in the Inspector.

Selected color presets can be set using the Inspector. You can store all your projects colors in the Paint Presets palette. The color and values for each color are displayed at the bottom of each preset icon.

It is easier to manage large collections of colors and textures by using the Manage Sets dialog box to create sets. See Chapter 8, Using Scene Objects.

The Paint Presets palette holds preset colors that can be applied to objects. You can delete a selected preset using the Remove Preset command in the palette menu. To remove all presets, choose Remove All Presets from the palette menu. Once a paint bucket icon is selected in the Paint Presets palette, you can apply the selected color to an object (or object face) by selecting the Apply Texture Tool from the Texture Tools toolbar and clicking on an object in the Appearance Editor.

ADOBE ATMOSPHERE 145 User Guide

Texture Formats
Textures are image les that can be wrapped around or tiled over the surface of an object. The le formats supported for textures are GIF, JPEG and PNG. Each of these formats is commonly found on the web. Imported textures appear as thumbnails in the Paint Presets palette.

GIF
The Graphics Interchange Format (GIF) supports only 256 colors but offers lossless compression which preserves image quality better than JPG or PNG. GIF is a good format for textures that contain text, logos and drawings. File sizes are usually small and load quickly. Atmosphere doesnt support transparency, interlacing or animation in GIF les.

JPEG
The JPEG (JPG) format supports a photo-realistic 16.7 million colors. JPEG compression is lossy but adjustable to trade image quality for le size. JPEG is good for photographs and images with gradients. Files are normally the smallest.

PNG
The Portable Network Graphics (PNG) can contain 256 or 16.7 million colors and offers both lossy and lossless compression. PNG les are usually larger than JPG, but offer good quality.

Applying Textures
Textures are applied to objects in the Appearance Editor using the Apple Texture Tool (K). The method is the same except that textures must be imported into the Paint Presets palette before use with the Add Texture Preset command from the Paint Presets palette menu. Imported textures appear as thumbnails in the Paint Presets palette. Select a texture, then use the Apply texture Tool (K) to apply to an object or face. You can import multiple textures at the same time by Shft- or Ctrl-selecting multiple le names in the le dialog box before clicking Open.

146

CHAPTER 11

The Paint Presets palette displays thumbnails of imported textures. When a texture preset is selected in the Paint Presets palette, several option for controlling the size and orientation of the texture appear in the Texture tab of the Inspector palette. These settings will be covered in Chapter 12, Manipulating Textures.

Although colors can be applied to the sky, you cannot apply a texture to the sky background.

Tutorial: Adding Textures to an Object


Textures can add a richer, more realistic look to objects. To apply textures to an object, follow these steps: 1 Locate the Help\Tutorials\Fountain folder under the directory where Atmosphere was installed. It should be a path similar to c:\Program Files\Adobe\Atmosphere\Help\Tutorials\Fountain. After navigating to your folder in the open dialog, select the le fountain.atmo and press Open. 2 Select Window > Paint Presets to open the Paint Presets palette. 3 In the palette menu, select the Add Texture Preset menu command. Locate the same folder as step 1, select all texture les, and click the Open button. 4 Select View > Player View (F4) to open the Appearance Editors Player view. Then select the View > Fit All (Ctrl+0) menu command to t all scene objects in the Player view window. 5 Click on the Apply Texture Tool (K) in the Texture Tools toolbar, select one of the texture presets and click on an object in the Player view to apply the texture. Repeat this step until all object have textures applied.

ADOBE ATMOSPHERE 147 User Guide

The fountain with textures applied.

Working with Movies and Sound


Atmosphere supports full-motion video and directional sound. Video is applied to surfaces and objects just like texture and color from the Paint Presets palette. Movie les can be very large and will slow downloads of web-based Atmosphere environments. Older computers may not be able to play back movies smoothly, and even newer ones may have problems when movies are added to more than one face of an object.

Supported movie and sound formats


Atmosphere supports several video and audio formats including: Microsoft Video (AVI, ASF) Quicktime (MOV)

148

CHAPTER 11

MPEG Windows Media Files (WMV) All of these formats can be opened using the le dialog that appears from the Add Texture Preset menu command on the Paint Presets palette menu. Video les normally appear with the poster frame as a thumbnail.

Movie options
Once a movie le has been applied to a face in the scene, a Movie tab appears in the Inspector palette. This tab includes options to make the movie Loop and set the Volume of the movie sound.

The Movie tab.

Tutorial: Making a Television Come Alive


To apply a movie to a television model, follow these steps. 1 Locate the Help\Tutorials\Television folder under the directory where Atmosphere was installed. It should be a path similar to c:\Program Files\Adobe\Atmosphere\Help\Tutorials\Television. After navigating to your folder in the open dialog, select the le television.atmo and press Open. 2 Select Window > Paint Presets to open the Paint Presets palette. 3 From the palette menu, select the Add Texture Preset menu command. Locate the movie.mov le in the same folder as step 1 and click the Open button. 4 Select View > Player View (F4) to open the Player view. Then select the View > Fit All (Ctrl+0) menu command to t the television object in the Player view. 5 Click on the Apply Texture Tool (K) in the Texture Tools toolbar, and select the movie preset. In the Surface tab in the Inspector palette, choose Face from the drop-down list and click on the television face in the Player view to apply the movie. 6 Click on the Movie tab in the Inspector palette and set the Loop option and Volume for the applied movie.

ADOBE ATMOSPHERE 149 User Guide

Movies applied to an object face will play automatically when the scene is loaded. Notice how the movie is rotated incorrectly and tiled. The next chapter will explain how to x these problems.

Removing Textures
The Remove Texture Tool (E) removes color, texture and video from objects. Select the tool and click on the object or face to remove the color or texture.

Sampling and Editing Colors and Textures


Colors, texture and movie can be imported from scenes into the Paint Presets palette using the Sample Texture Tool (I) . Click on the scene object to create a preset Paint Presets palette. The Edit Texture Tool loads colors and textures into the Inspector palette where their editable properties can be changed.

150

CHAPTER 11

ADOBE ATMOSPHERE 151 User Guide

Chapter 12: Manipulating Textures


Experienced artists know that texture handling makes the difference between a compelling visual experience and one that appears awkward and ungainly. Atmosphere offers a full set of Texture editing options including scaling, rotation, offset and wrapping. Developers will nd that Atmosphere makes it easy to access parameters for tiling and parametric and projective scaling. Creative designers and those new to this type of media will nd that Atmospheres interface with slider controls and live visual feedback makes it easy to learn even forbidding-sounding topics.

Editing Textures
Once a texture is applied to an object (see chapter 11, Applying Colors and Textures), its properties can be edited in the Inspector palette. Choose the Edit Texture Tool in the Appearance Editor and click in the Player view on the texture that you wish to edit. Its parameters will appear in the Inspector palette. For textures, the Inspector palette includes four tabbed panes Surface, Texture, Light Map and Movie.

Surface Tab
The Surface tab lets you select whether the texture is applied to a single Face or to every side of the object. The Surface panel also includes an option to specify whether or not the object Emits Light. If it emits light, you can specify the Brightness value and a Self-Illumination Factor. You can learn more about lighting in Chapter 13, Lighting a Scene.

The Surface tab lets you apply texture to whole objects or an individual face.

Texture Tab
The Texture tab controls how the texture image is sized and oriented on the object. You can wrap the texture, and set an offset, rotation and other parameters that affect how the texture is applied to an object.

152

CHAPTER 12

The Texture panel lets you manipulate the placement of the texture.

Tutorial: Applying a texture to a single face


Textures can be applied to the entire object or to a single face depending on the setting in the Apply To eld in the Surface tab of the Inspector palette. In this example, youll apply a texture to the front of a grandfather clock. 1 Locate the Help\Tutorials\Clock folder under the directory where Atmosphere was installed. It should be a path similar to c:\Program Files\Adobe\Atmosphere\Help\Tutorials\Clock. After navigating to your folder in the open dialog, select the le clock.atmo and press Open. 2 Select the View > Player View (F4) menu command to open a Player view window. Select the View > Fit All (Ctrl+0) menu command to size the window to see both Box objects. 3 Select Window > Paint Presets to open the Paint Presets palette. Select the Add Texture Preset from the palette menu and locate the same folder as step 1, select the le named R_clock_2_bottom.jpg and click Open. 4 Select the clock face texture. Then open the Surface tab in the Inspector palette and select the Face option in the Apply To drop-down list. Click on an object face. Note that the texture is applied to just the face, instead of the whole object.

ADOBE ATMOSPHERE 153 User Guide

Textures can be applied to the entire object or to a single face.

Scaling Textures
The U and V Size values in the Texture tab determine the size of the texture image. The U Size value scales in the horizontal direction and the V Size value in the vertical direction. The check box by the chain link locks image size U and V scaling in tandem if checked and separately if unchecked. The Size values depend on the Scaling Type that is selected. The four Scaling Type options are Pixel, Tile, Parametric and Projective, explained below.

i i

If the Size values are different before the link checkbox is enabled, the relative difference between the U and V values will be maintained, they will not be set equal. The maximum Texture size that can be used in Atmosphere is 2000 x 2000 pixels.

154

CHAPTER 12

A scaled texture applied to three Wall primitives.The texture appearance is controlled by changing the Size values and Scaling Type.

Offsetting Tex tures


The Offset values set the location of the upper left corner of the texture image. The U value will offset the texture image in the horizontal direction and the V value will offset the image in the vertical direction. Offset values also depend on the selected Scaling Type. A good way to learn the effect of offsetting a texture is to click on the blue arrow box to the right of the number eld. A slider control will appear: observe the behavior of the texture image as you move both the U and V sliders.

If a texture is offset without Wrap enabled, the edge of the texture will be smeared into the offset space.

ADOBE ATMOSPHERE 155 User Guide

Offset values are measured from the upper left corner of the object face.

Understanding Scaling Types


Atmosphere includes four different Scaling Types Pixel, Tile, Parametric and Projective. The selected type will change how textures appear on the surface of the object. The Pixel and Tile scaling types will normally maintain the texture images proportions, while the Parametric scaling type will stretch the image as needed to completely ll an objects face. The Projective option treats the texture as if being projected onto the surface like a movie. The numbers that appear in the size window show a relationship between the size of the image texture and the size of the object to which the texture is applied. These numbers can be useful to more technical users who can use them to adjust the size, resolution and other properties of texture images. Those relationships are explained in the following passage. If you lack experience proceed by using the sliders and other controls visually. Noting the values that produce desirable effects will help you recreate those effects quickly in the future.

156

CHAPTER 12

Pixel Scaling With Pixel Scaling selected, the Size value expresses the size of an individual pixel of the texture given

in feet. For example, a U-Size of 1 means that each pixel in the texture will be one foot across. Pixel and Tile Scaling behave similarly, except that the Size values are different.
Tile Scaling Tile Scaling makes it easy to size the texture as a tile that ts perfectly across the object face. Size expresses the size of the entire image in feet. A U-Size of 1 means that the image is 1 foot across independent of the number of pixels in the image, and will t exactly across faces that are 1, 2 and 3 feet wide, etc. Parametric Scaling Parametric Scaling stretches a texture image so that it exactly ts the object face. U and V Size

values of 1 will t the selected face exactly regardless of the actual dimensions of the face. If the Size values are changed to 2, then only half of the texture is tted to the surface and a value of 0.5 will make texture images t twice across the surface. Changing the size of the face will cause the texture to automatically scale to t. Note that the Size values in this case express a ratio rather than a dimension like feet.
Projective Scaling The Projective Scaling applies the texture image to an object as if it were cast from a lm projector.

This provides a way to apply textures to oddly shaped objects or apply interesting distortions to applied textures. The Size values for Projective Scaling express the size of the projected image in feet. The location of the texture projector relative to the object is set by the Elevation and Azimuth values, and are similar to those used by the sun direction in lighting (see Chapter 13 Lighting a Scene).

Tutorial: Scaling a Texture to Fit


Fitting a movie to a screen shows how Parametric Scaling works. To scale a texture to t an object face, follow these steps. 1 Locate the Help\Tutorials\Lounge folder under the directory where Atmosphere was installed. It should be a path similar to c:\Program Files\Adobe\Atmosphere\Help\Tutorials\Lounge. After navigating to your folder in the open dialog, select the le lounge.atmo and press Open. 2 Select View > Preview View (F4) to open a Player view window and navigate so the screen object you wish to texture is visible. 3 Select Add Texture Preset from the Paint Presets palette menu and locate the movie.mov le in the same folder as step 1. Click the Open button in the le dialog to create the preset. 4 Select the movie preset in the Paint Presets palette and click on the screen object face where it belongs with the Apply Texture Tool (K). 5 In the Surface tab of the Inspector palette, select the Face option from the Apply To drop-down list. In the Texture tab, select the Parametric option from the Scaling Type drop-down list and set the Size values to 1. This will t the movie texture exactly on the object face.

ADOBE ATMOSPHERE 157 User Guide

The Parametric Scaling Type ts textures perfectly on an object face.

Wrapping Textures
The Wrap options cause the texture image to be placed end to end across the face of the surface like tiles on a oor. If the Wrap options are selected for both the U and V directions, then the texture image will be tiled across the entire face of the object. The grass eld of this soccer stadium was created by wrapping a small grass texture horizontally and vertically. If you look closely you can see the repeating pattern. You can use the Scaling Type and Size parameters to make the texture t the face exactly. A little experimentation will also help you nd the most pleasing visual effect.

158

CHAPTER 12

Textures like the grass in this soccer stadium can be tiled to cover the entire surface. Here is a texture that is tiled across the surface using the Wrap options.

Rotating Textures
The Rotation value rotates the texture image counterclockwise. The origin point is the upper left corner of the texture image.

ADOBE ATMOSPHERE 159 User Guide

A texture rotated by 30 degrees with both Wrap options enabled.

Tutorial: Creating Seamless Textures


Seamless texture images will wrap most successfully. Seamless textures have opposite edges that look natural when the texture is tiled edge to edge. You can make seamless textures in Adobe Photoshop. Adobe ImageReady ships with a Filter called Tile Maker that automatically blends edges so that opposite edges will match (look in the Other lter category). To create a seamless texture image in Photoshop, follow these steps. 1 Open a texture image le in Photoshop. 2 With the Rectangular Marquee Tool, select a section for the tile. If you hold down the Shift key, you can make the selection area a square. 3 Select the Filter > Other > Offset menu command. This will offset the image edges. Select a value start with 100 for Horizontal and Vertical depending on the actual size of your image. 4 Touch up the edges with the Clone or Healing Brush Tool. 5 Save the image as a GIF, JPG, or PNG le. 6 Impoert the texture into the Paint Presets palette using the palete menu Add Texture Preset command. The texture image is now ready to be applied and tiled.

160

CHAPTER 12

Seamless textures will tile end to end with minimally noticeable seams.

Positioning Projective Textures


When Projective Scaling is selected, you can position the texture projector by using the Elevation and Azimuth controls. These controls, familiar to astronomers, dene a location on an sphere of space surrounding the object face. Elevation can range from 90 to 90 with 0 being the horizon, -90 being directly underneath and 90 being directly overhead. The Azimuth value denes an angular position that starts where the X-axis intersects the horizon at 0 degrees and proceeds in a clockwise direction around the horizon until it returns to the X-axis with a value of 360. The X, Y and Z values dene the offset of the projected texture along each of the axes.

ADOBE ATMOSPHERE 161 User Guide

Creating Billboards
Billboards are a special type of texture that always face the viewer. These are convenient for objects such as trees where a single billboard object will present the illusion of a tree without including the complex mesh required to model an actual tree.

Tutorial: Making a Billboard object


Billboards for Atmosphere include Viewpoint objects made by applying both an image and a matching alpha (transparency) map to a Viewpoint plane primitive. Billboards are used where true 3D objects are impractical. This tutorial uses Viewpoint Scene Builder software (see www.viewpoint.com for more information ).

Trees are often modeled as billboard objects. 1 Obtain a high-resolution photo of a tree, with a normal viewing angle and lighting and no overlapping objects. 2 In Adobe Photoshop, or another image editor, cut the tree out from its background, leaving white where you want transparency.

162

CHAPTER 12

First step is to crop the tree from the picture. 3 Using this image as a template, make a second image, in which the tree is black on a white background. This will be your images alpha map. Superimposing the two images makes it easier to remove any mistakes. You may also wish to smooth the edges. Save the two images as identically-sized, non-progressive, 24-bit JPEG les.

The alpha map of the tree. 4 To process the images in Viewpoint Scene Builder, apply both to a VP primitive plane. Use settings that will not render a visible edge around the plane or light it unrealistically. Save the object as an MTX le. 5 Import the Viewpoint MTX le into your Atmosphere environment and copy the MTS le to the folder where you publish your environment.

ADOBE ATMOSPHERE 163 User Guide

A billboard tree object as part of an Atmosphere environment. Billboard objects always face the viewer.

164

CHAPTER 12

ADOBE ATMOSPHERE 165 User Guide

Chapter 13: Lighting a Scene


Light is the magician are the famous words of Henri Cartier Bresson, one of the 20th Centurys greatest photographers. Mastering the play of light and shadow is no less important in your Atmosphere creation than it is in the real world. Textured and colored environments tend to look at and cartoonish without lighting. Atmosphere offers advanced Radiosity lighting that can bathe your world in foggy lm noir mystery or blazing brilliance.

Lighting transforms a scene from a collection of objects to an evocative, atmospheric world.

166

CHAPTER 13

Even sophisticated environments seem at without lighting.

Understanding Lighting
Atmosphere uses advanced Radiosity lighting algorithms that produce realistic lighting effects. Radiosity takes into account the way light behaves in the real world. There are two kinds of lighting in Atmosphere pre-computed lighting and dynamic lighting. Pre-computed lighting is calculated before the environment is viewed in the Player. When you click the Start button in the Lighting Control, lighting information is calculated and saved with the scene. Dynamic lighting is applied in real-time as the user interacts with the environment.

What is a Light Map?


A Light Map can be thought of as a global texture that overlays the scene. This map includes lighting information such as highlights, gradients across surfaces, and shadows. Light Maps can be enabled or disabled for each object using the Has Light Map option in the Light Map tab of the Inspector palette. If enabled, editable Brightness and Sample Size values appear.

Where are the Lights?


The main light source in Atmosphere is the sun, which behaves like the sun in the real world. In addition, any Solid Object or Surface Object in the scene can be a light source. The faces of objects that emit light are called emissive surfaces. Typically, interior scenes are lit by lights that you create and position, while exterior scenes are lit mainly by the sun and the background.

ADOBE ATMOSPHERE 167 User Guide

Working with Emissive Surfaces


Any object in the scene can be a light if the Emits Light option on the Surface tab of the Inspector palette is checked. This tab is only available when the Player view is selected. Objects that are closer to emissive surfaces will receive more light and appear brighter. The amount of light received from an emissive surface is proportional to the surface area of the emitter and diminishes with distance.

The Emits Light option turns any object into a light. Brightness is controlled by the Emitted Brightness value, which determines how much light radiates outward and can range in value from 0 to 100. The Self-Illumination Factor determines how bright the object itself is and can range from 0 to 1. For indoor lights, try setting the Emitted Brightness value to 100 and the Self-Illumination Factor to 1. This will cause a bright light to be added to the scene.

168

CHAPTER 13

Any Solid Object or Surface Object in the scene can be an emissive surface. The uorescent lights on the ceiling are cylinders set to be emissive surfaces.

Pre-Computed Lighting
Computers calculate light by tracing the path of light rays from each light source to objects in the scene and back to the observer. The angle of incidence, the reective properties of the object and dozens of other properties must be considered and calculated to show lighting that appears realistic to the human eye. Atmosphere uses advanced Radiosity lighting algorithms that produce cinematic lighting quality by calculating the myriad ways that real light bounces through a scene. This is a huge computing job, even for the most powerful modern PC, and can take hours or even days for complex scenes. Since that wouldnt be practical for a real-time experiences, the work-around is to compute the lighting and then save the information in les called Light Maps that are savedwith the scene. This process is referred to as precomputed lighting, and is distinct from real-time or dynamic lighting. Light maps have the advantage that they can quickly be read during scene playback. Atmosphere uses the Lighting Controls palette to set parameters that affect the lighting.

ADOBE ATMOSPHERE 169 User Guide

Tutorial: Making a Light Bulb


To create a simple light, follow these steps: 1 In the Solid Object Editor, add a primitive where you want a light object to be located. A cube or cylinder can be fashioned into a simple light source. Be sure the object is selected. 2 Open a Player view (F4) if need be and frame the object (Ctrl+Shft+0) that is to be the light. Select the Edit Texture Tool in the Texture Tools toolbar and click on the object. Enable the Emits Light option in the Surface tab of the Inspector palette. Set the Emitted Brightness to 100 and Self-Illumination Factor to 1. 3 In the Lighting Controls palettes Controls tab, Click on preview then the Start button in the Lighting Control palette.

Lights can be made from existing scene objects. Above is a recessed ceiling light, made from a cylinder with Surfaces set to 6, that adds light to the scene when set as an emissive object.

170

CHAPTER 13

Setting Light Parameters


All of the controls for scene lighting are in the Lighting Control palette. This palette includes four separate tabbed panes Controls, Settings, Quality, and Sun.

Creating Light Maps


When you rst create objects in Atmosphere, they are unlit and appear as uniform gray shapes in the Player view, because no lighting has been calculated for them. Pressing the Start button on the Controls tab of the Lighting Control starts the process of generating Light Maps for the environment. The time required to do this will depend on the number of light sources and objects in the environment and is generally longer for more complex environments. Three progress bars track the process, and you can stop lighting at any time with the stop button.

You cannot edit Solid Objects while the lighting is being calculated. Attempting to do so will present a warning dialog box. You can stop the lighting solution at any time using the Stop button.

The Lighting Control palette includes Start and Stop buttons The lighting process can require many minutes or even hours depending on the complexity of the Scene. Once lighting is done, the information is saved in the Light Maps. Atmosphere preserves Light Maps so they dont normally need to be redone once a scene has been lighted. Just above the progress bars is a Status label which shows the current task: Initializing Light Maps: allocates and clears memory for lighting calculations. Gathering Light for Faces: collects all light from background and the Sun sources as well as emissive surfaces Distributing Light: calculates the light bouncing from non-emissive surfaces that were illuminated by the previous step. Done: displayed when lighting calculations are complete.

ADOBE ATMOSPHERE 171 User Guide

The progress bars track the Percent of Light Remaining, the Percent of Surfaces Remaining and the Percent of Current Surface Remaining and are meant to help you judge how long the lighting will take. During lighting and once a scene has been lit, you can alter the Scene Brightness using the Scene Brightness control at the bottom of the Lighting Controls palette. You cannot alter the Scene Brightness setting after closing and reopening the project le exiting without rst recalculating lighting..

Lighting Settings
Under the Settings tab you can select which light sources are used to calculate shadows. Multiple light sources will make shadows appear softer. If you are creating an indoor scene such as the interior of a building, be sure to disable Calculate Light for Sun and Background. This will speed up the computation. The Lighting Threshold value determines a threshold below which light energy will no longer be distributed. For example, a Lighting Threshold of 20 will stop computing bounced light after 80 percent of the light has been distributed.

The Settings tab of the Lighting Control palette lets you choose which lighting sources to include. You can continue to navigate in the Player view even though lighting computations are in process. The Update Frequency setting in the Lighting Control palette will determine how many surfaces are calculated before the Player View is updated.

If the Player view isnt active, the refresh rate is set to 1 frame per second. This will speed up the lighting calculations.

172

CHAPTER 13

A setting of 10 will give the user immediate feedback in the Player View while taking longer to complete the lighting and a setting of 80 will speed lighting at the expense of less frequent Player View updates. An Update Frequency value of 0 will cause the Player view to update only after the entire lighting solution is calculated.

Setting light quality


The Quality tab of the Lighting Control palette includes sampling settings which impact the accuracy of the lighting. The Quality Preset buttons allow you to easily set the Light Map Sample Size and Sampling Density values. Just click a button to change the values to one of the three predened quality settings.

The Quality tab of the Lighting Control palette determines the accuracy of the lighting. At the top of the Quality tabbed pane are three buttons Draft, Preview and Final. Clicking these buttons changes the value settings. These buttons are the same as those found at the top of the Controls tab. The Sampling Densities values for the Background and Sun dene the number of rays (actually the square root of the total number of light rays) that come from the Background and the Sun respectively. Increasing the Sampling Densities will improve the accuracy of the lighting and the smoothness of soft shadows. However, higher sampling densities take longer to compute. Lighting is computed by dividing a surface into samples, and computing the light for each sample. More samples make the lighting more accurate, but take longer to compute. Light Map Sample Size controls the resolution of the light map for the corresponding surface. Measured in feet, the sample size determines the linear size of each pixel in the light map. The default setting is for light to be calculated at points on a regular grid each one foot apart. Decreasing the value will lessen the distance between sample points thus increasing the number of samples for the surface. This means that the calculation of the light map will be more accurate, although it will make them take more time and increases the amount of light map data that is saved in the le. More accurate light maps result in crisper shadows and smoother gradients. The Sample Size values can be specied for Solid Objects and Surface Objects that are designated as emissive surfaces. You can also set Sample Size Minimum and Maximum values for Light Maps. Emissive Surface Sample Size values

ADOBE ATMOSPHERE 173 User Guide

can range from 0.01 to 100 and Light Map Sample Size values can range from 0.1 to 5. The Minimum and Maximum settings clamp the per-surface Sample Size to these values.
Quality Presets Values Setting Background Sampling Density Sun Sampling Density Solid Object Emissive Surface Sample Size Surface Object Emissive Surface Sample Size Light Map Sample Size Minimum Light Map Sample Size Maximum Draft Quality 2 1 8 4 1 5 Final Quality 4 4 4 2 1 5 Preview Quality 16 8 2 1 0.1 5

Tutorial: Changing Scene Brightness


This tutorial will help you understand how the lighting controls work: follow these steps. 1 Open or create an Atmosphere environment. 2 Select View > Player View (F4) to open a Player view window. 3 Select the Window > Lighting Control menu command to open the Lighting Control palette. In the Settings tab of the Lighting Control palette, enable all the light sources that you wish and set the Lighting Threshold to 25. This will compute a fairly accurate lighting solution without updating the Player view. In the Quality tab of the Lighting Control palette, select the Draft presets. 4 In the Controls tab of the Lighting Control palette, click on the Start button to begin the lighting solution. The progress bars will move from right to left as the solution is calculated. Since the Lighting Threshold was set to 25, the calculations will quit when the Light Remaining progress bar reaches 25. 5 As lighting progresses or once the lighting is nished, drag the Scene Brightness slider under the blue arrow at the bottom of the Control tab in the Lighting Control palette. This will change the overall scene brightness..

174

CHAPTER 13

The scene with a Brightness value of 1.

The same scene with its Scene Brightness set to 5. Darker regions are brightened but lighter regions may lose contrast.

Using Sunlight
In addition to emissive surfaces, you can also specify a distant light source known in Atmosphere (and in the real world) as the Sun. The Suns settings are found in the Sun tab of the Lighting Control palette and include: Elevation and Azimuth settings to describe its position in the sky, Cone Angle and Brightness to describe its intensity and Red, Green and Blue to describe its color.

ADOBE ATMOSPHERE 175 User Guide

The Sun tab lets you adjust the Suns light.

Understanding Elevation and Azimuth


Elevation and Azimuth dene the position of the Sun on an imaginary sphere that encompasses an Atmosphere environment. The position of the sun in the sky inuences which objects are highlighted and the direction of shadows that are cast. Elevation can range from 90 degrees for a sun that is directly overhead to 0 for a sun at the horizon to 90 for a sun shining directly below.

Azimuth describes the angle between the X-axis and a line drawn to the Sun. Values can range from 360 to 360 degress. Elevation and Azimuth values at sunrise would be 0 and 0. At high noon, the Elevation would be 90 and the Azimuth would be 90. At sundown, the Elevation would again be 0, but the Azimuth value would be 180.

Setting Cone Angle, Brightness and Color


The Cone Angle value denes how the Sun light spreads. Higher values will result in a wider cone and softer shadows. The Cone Angle value can range from 0 to 90. The Cone Angle value for the earths sun is around 0.5. The Brightness value sets the amount of light energy that is emitted by the sun. The higher the Brightness value, the brighter the scene.

176

CHAPTER 13

The Color section in the Sun tab of the Lighting Control palette will let you specify a color for the light coming from the sun. You can change the color by clicking on the color swatch and picking a new color from the Color palette or by dragging the Red, Green or Blue sliders.

Color swatches in Atmosphere have 3 palettes. Clicking brings up the Color palette, Ctrl-clicking brings up a mini palette, and Alt-clicking brings up the web standard colors palette.

Tutorial: Coloring the Sun


Changing the Suns color can change the mood of your world. To change the color of the sun, follow these steps. 1 Open an Atmosphere world that uses the Sun for a light source. 2 Select View > Player View (F4) to open a Player view window. 3 Select the Window > Lighting Control menu command to open the Lighting Control palette. In the Sun tab of the Lighting Control palette, click on the color swatch to open the Color palette. Select a blue color swatch and close the dialog box. This will update the Sun color to blue. 4 In the Controls tab of the Lighting Control palette, click on the Start button to begin the lighting calculation.

A scene with a the Sun color set to white. The default Sun color is pure white. Changing the Suns color dramatically alters the scene. This is the same scene with a blue Sun color.

Using the Background as a Light Source


The background sky can be set to be an emissive surface. To apply a color to the background sky, select a color in the Inspector and click on the background with the Apply Texture Tool (K).

ADOBE ATMOSPHERE 177 User Guide

Textures cannot be applied to the background, but you can place a texture using an object known as a Sky Dome or a Sky Cone.

Tutorial: Creating a Sky Cone


A Sky Cone is used to surround your environment with a sky and/or landscaping texture. It consists of two cone primitives, one subtracting from the other to form a wall around your environment. To create and texture a Sky Cone object, follow these steps. 1 Open the Scene Editor and add a new Solid Object. Name your object sky cone. 2 Double click on the sky cone object to activate the Solid Object Editor. Select the Cone tool in the Solid Object Tools toolbar and click in the Solid Object Editor to add a cone primitive. 3 Drag on the Cone handles to resize the cone until it completely engulfs your environment. 4 With the Cone object selected, Select Edit > Duplicate (Ctrl+D) and duplicate your Cone object. 5 Make this duplicated Cone a subtractive object by enabling the Subtractive option in the Inspector palette. 6 Resize the duplicated Cone object so that it is slightly smaller than the rst. Make sure it is completely inside the rst cone, and no edges are overlapping. 7 Select both Cone objects and select the Object > Group (Ctrl+G) menu command. 8 Select View > Player View (F4) to open the Player view. 9 Select the Add Texture Preset from the Paint Presets palette, locate the sky texture and open it in the Paint Presets palette. Then select the Apply Texture Tool (K) and click on the inside of your sky cone object.

Because sky cones can block lighting from the background and the sun it is usually best to import them after lighting the rest of the scene or load them as a model with a script. Sky cones should have their Light Maps disabled in order to reduce le size.

178

CHAPTER 13

Sky cones can be textured to show the surrounding environment. The distant plain, hills and sky are textures on the sky cone.

Using Object Light Maps


For each surface, you can specify whether there should be a Light Map. This option is in the Light Map tab of the Inspector palette when a color or texture preset is selected or when the Edit Texture Tool is used to inspect an object surface.

The Light Map tab of the Inspector palette lets you enable Light Maps and set their Brightness and Sampling Density. In the Light Map tab, you can also set the Brightness and Sampling Density for each color and texture.

Using Dynamic Lighting


Dynamic lighting is a real-time effect generated by scripts that are added to the scene. Dynamic light is computed in real-time as users navigate the environment and is usually used with moving objects. You can learn more about scripting in Chapter 14, Adding Interactivity with Scripts.

ADOBE ATMOSPHERE 179 User Guide

Dynamic lighting is computed in the Player as users and objects move about the scene. Dynamic and static lighting are added together in the Player. For object that will move and rotate, it is best to light them just with background light and the to use a dynamic light in the Player to represent the sun.

Effective Lighting Techniques


Here are some tips and techniques that may be useful as you explore Atmospheres lighting. An emissive surface used as a light that is twice as big will emit four times the light. Spheres are good light sources that emit light equally in every direction. If you use a Box object for a light, it may cause artifacts to appear in the scene. The larger the object the more pronounced the artifacts. Emissive surfaces can be hidden, so you can add a little light to a dark corner by placing a hidden, emissive object. Texture images have their own lighting. Atmosphere lighting tends to darken them. To compensate for this, you can increase the brightness of texture images before importing them into Atmosphere using Image > Adjustments > Levels in Photoshop. Viewpoint objects are not included in the pre-computed lighting calculations and they dont cast or receive dynamic lighting shadows. Viewpoint objects that are converted to Surface Objects are included in the pre-computed lighting solution, but they loose any included animation.

180

CHAPTER 13

For Surface Objects precomputed lighting is stored at the vertices of the mesh. To increase the lighting quality, subdivide the mesh prior to importing it into Atmosphere.

Tutorial: Preparing Textures for Lighting


While you can use Atmospheres Brightness setting to adjust texture objects, better results are possible with a little forethought as textures are being prepared. To prepare textures for lighting in Atmosphere, follow these steps. 1 Open and crop the texture that you wish to use in Photoshop. 2 If the texture lighting is uneven, click the Create a New Layer button in the Layers palette and change its name to Color. Then click on the bottom layer Background to select it. 3 Select the Filter > Other > High Pass menu command and set the Radius value of 100. 4 Select the Flatten Image command in the Layers palette menu. 5 Select the Image > Adjustment > Levels command (Ctrl+L) and drag the slider to brighten the image while maintaining contrast. 6 Save a copy of the texture. Its wise to save an original copy in case you need to make further adjustments..

Above is a texture before brightening with this technique, and the same texture after the levels have been changed. Texture images are pre-lit and become darker when applied to a lighted scene. Brightening dark textures causes them to appear correctly in a lighted scene. Below are two cubes with identical lighting with the two different textures applied.

ADOBE ATMOSPHERE 181 User Guide

Chapter 14: Adding Interactivity


Scripting adds the dimension of interactive behavior to Atmosphere worlds and objects. Non-technical users and beginners will be pleased to learn that Atmospheres drag-and-drop scripting requires no programming knowledge. Atmosphere ships with a selection of useful pre-built behaviors, and users can easily import and use scripts obtained from others. Programmers will be pleased to know that Atmosphere has a rich API that allows control of virtually every aspect of an Atmosphere world including its physics. Atmosphere supports JavaScript, the World-Wide Webs widely used and well-documented scripting language.

This chapter covers the basics of using scripts in Atmosphere. A more detailed tutorial is included in Appendix D, JavaScript API Documentation, and Appendix E, JavaScript API Table of Modules.

Drag and Drop Scripting


As mentioned, Atmosphere ships with a number of preset scripts that can easily be added to objects and scenes to enable a number of interesting and useful behaviors. You can nd a complete list of script presets and their descriptions in Appendix C, Preset Libraries.

Loading Scripts
Scripts can be imported into Atmosphere using the File > Import > Scripts menu command. You can also place scripts in the Object Presets palette using the Add Script Preset command in the palette menu. Both of these options will open a le dialog box to locate and load the Script les which typically have a JS extension. Imported presets appear as Script icons in the Object Presets palette. You can load several script presets at once by Shift- or Control-selecting scripts in the Open File dialog box.

Scripts can be added to the Object Presets palette.

182

CHAPTER 14

Placing Scripts
Scripts that are loaded using the File > Import > Script command appear at the origin of a Scene. Scripts in the Object Presets palette are placed using the Scene Editor which allows scripts to be placed anywhere. To place a script, click on its icon in the Object Presets palette, then click in the Scene.

Some scripts will use the position of the Script icon in the Scene view as a parameter to control its function. For example, the rotateContinuous.js script uses the Scripts position to dene the point about which an object rotates.

The script name and its path are displayed in the Scene Hierarchy palette. When a script is selected, the Inspector palette displays the Scripting tab where the scripts properties Names and Values are shown.

ADOBE ATMOSPHERE 183 User Guide

The Scripting tab of the Inspector palette appears when a script is selected in the scene.

Tutorial: Adding Fog


The fog.js script adds an adjustable fog effect and is an example of script behavior that affects an entire scene

Some effects such as fog will not be visible until the environment is published and loaded in the Player plug-in.

To add fog to your scene, follow these steps. 1 Locate the Help\Tutorials\Bridge folder under the directory where Atmosphere was installed. It should be a path similar to c:\Program Files\Adobe\Atmosphere\Help\Tutorials\Bridge. After navigating to your folder in the open dialog, select the le bridge.atmo and press Open. 2 Select the Add Script Preset menu command in the palette menu of the Object Presets palette. This will open a le dialog box. 3 In the le dialog box, locate and select the fog.js script in the Extras\Scripts\Set_1_Basic directory where Atmosphere was installed. Click the Open button to open the script preset. 4 Select the fog script in the Object Presets palette and click in the Scene Editor to place the script icon anywhere in the scene. 5 Select File > Publish > World (Ctrl+P) to see the fog in the environment.

184

CHAPTER 14

An Atmosphere environment with the fog script applied. The amount of fog can be set by adjusting the scripts properties in the Inspector. Fog can be enabled in the scene simply by adding the fog.js script.

Editing Scripts
The Inspector palette includes a eld that holds the path to the imported script. You can set the scripts path by clicking the Browse for JavaScript File button to the right of the JavaScript URL. Clicking the Edit button will open this script in a text editor. The text editor has no menu bar options, but you can use the right-click Contextual menu to Cut, Copy, Paste and Delete selections of text and bring up the Save and Save As dialogs. To learn more about editing scripts, see Appendix D, JavaScript API Documentation.

The scripts that ship with Atmosphere include a comment at the top of the script that explains what the script does and how to use it. When you create your own scripts, its a very good idea to include comments that will help you remember what the script does.

ADOBE ATMOSPHERE 185 User Guide

Clicking the Edit button will open the script in a text editor.

Dening Properties and Setting Values


The Properties section in the Inspector palette holds all the dened properties for the script. You can enter new parameter values by selecting a property and typing its new value into the Value eld. You can also right-click in a value eld to select more parameters like a le name and path. Entering a wrong value type will make the script run incorrectly. For example, some properties are Booleans, meaning they only accept true or false values. If you enter a number into a Boolean property, the script will generate an error. There is a section at the top of a script, which is denoted by two comment lines: //BEGIN_AUTHORING_PROPERTIES //END_AUTHORING_PROPERTIES

The two slash marks (//) at the beginning of the line mark a line of code as a comment that will not be processed.

The properties dened in this section are displayed in the Inspector palette. When the user saves their project, the values in the palette elds are written into the project le. Additionally, when the user publishes the project, these values are written into the published AER le as well.

186

CHAPTER 14

This approach allows developers to protect their script work, since AER les only open in the Player and cant be opened in Atmosphere.

The script below this top section is the part processed in the Atmosphere Player using the custom values for properties that were set in the Inspector.

Working with Sound


The Sound.js script preset adds directional sound to an environment. The script includes several default properties. The active property is a Boolean (true or false) value that determines if the sound is on or off. The ambient Boolean value determines if the sound is associated with a position in space or if it can be heard equally anywhere within the environment. The far and near values determine the distance from the sound at which the volume falls to zero and is at its maximum respectively. The origin is the sounds position in the environment (if the ambient value is set to false).

Atmosphere supports positional sound, meaning that the sound will get louder as you navigate closer to it and softer as you move away.

The play and stop properties can be controlled by other scripts to start and stop the sound. The repeats property denes the number of times the sound will play. If the repeats value is set to 0, then sound will loop indenitely. The runOnStartup value will cause the sound to begin when the environment loads. The URL property denes the path to the sound le to play. Atmosphere supports sound in the WAV and MP3 le formats. The volume property controls how loudly the sound plays.

Tutorial: Adding Background Sound


Sound can add much to the ambience of the environment. Car noises on a city street, forest sounds for a mountain scene, classical music in a library and even elevator music for an elevator all add realism to the environment. To add background sound to a scene, follow these steps. 1 Locate the Help\Tutorials\Gallery folder under the directory where Atmosphere was installed. It should be a path similar to c:\Program Files\Adobe\Atmosphere\Help\Tutorials\Gallery. After navigating to your folder in the open dialog, select the project le gallery.atmo and press Open. 2 Select the Add Script Preset menu command in the palette menu of the Object Presets palette. This will open a le dialog box. 3 Locate the Extras\Scripts\Set_1_Basic folder under the directory where Atmosphere was installed. It should be a path similar to c:\Program Files\Adobe\Atmosphere\Extras\Scripts\Set_1_Basic. After navigating to your folder in the open dialog, select the script le sound.js and press Open. 4 Select the sound script in the Object Presets palette and click in a Scene view to place the script icon in the scene.

ADOBE ATMOSPHERE 187 User Guide

5 In the Inspector palette, click on the URL property to select it. Then right click on the Value eld and select Sounds from the pop-up menu. In the le dialog box that opens, locate and select the background sound that you wish to use. 6 Select File > Publish > World (Ctrl+P) to hear the background sound being played.

The sound.js script opened in a text editor. Script properties can be altered to change the function of the script. Above is the Inspector palette after the url property has been changed.

Adding New Properties


At the bottom of the Inspector palette is an icon button that you can use to add a new property to the script. This button will open the New Script Property dialog box where you can select a new property type, name and description.

188

CHAPTER 14

The New Script Property dialog box lets you dene custom properties. The number types include Number, String, Boolean, Vector, Color, Object, Action and Rotation. You can learn about each of these number types in Appendix D, JavaScript API Documentation. You can also select options that allow the value to be referenced, modied and whether it is an array or not. Selected properties can be deleted using the Delete Selected Script Property icon button, also located at the bottom of the Inspector palette.

Associating a Script with an Object


Scripts that affect objects, unlike scene scripts, must be associated with the object in order to work properly. Atmosphere uses the whip tool to make it easy to associate a script with an object.

Using the Whip Tool


Selecting a target object is accomplished using the Script whip tool located in the Inspector palette to the right of the Properties Name and Value elds. If you click and drag from the whip button to a scene object in the Scene Editor, a line appears. As you mouse over Scene Objects a highlight box will appear. Release the mouse when the proper object is highlighted. The Scene Object will be loaded as the scripts target object.

ADOBE ATMOSPHERE 189 User Guide

The Script Whip tool will draw a line from the tool to the target object. You can also drag the Script Whip tool to the objects in the Scene or Object Hierarchy palettes.

Because script objects can only be selected in the Scene Editor, you cannot whip to a Solid Object sub-part. You can, however, whip to a Solid Object part using the Object Hierarchy palette.

Viewing Object Properties


The Script Whip tool enters the selected objects name followed by a period and the word this into the target Value eld. this is a keyword in JavaScript that identies the object. All objects in the scene have properties associated with them that can be accessed by clicking the arrow icon to the left of the object name in either Hierarchy palette. Solid Object properties include this, position, orientation, minBounds and maxBounds. To the right of the property name is the property type in brackets. For example, position is a vector type. All of these properties can be referenced in JavaScript.

If you expand a script object in the Scene Hierarchy palette, all of its properties that are listed in the Scripting tab of the Inspector palette are visible. Double clicking on any of these properties will open the script in a text editor.

190

CHAPTER 14

Object properties can be viewed by expanding an object in the Hierarchy palettes.

Tutorial: Making a Showroom Car Rotate


To cause an object to rotate in the scene, follow these steps. 1 Locate the Help\Tutorials\Showroom folder under the directory where Atmosphere was installed. It should be a path similar to c:\Program Files\Adobe\Atmosphere\Help\Tutorials\Showroom. After navigating to your folder in the open dialog, select the project le Showroom.atmo and press Open. 2 Select the Add Script Preset menu command in the palette menu of the Object Presets palette. This will open a le dialog box. 3 In the le dialog box, locate and select the rotateContinuous.js script in the Extras\Scripts\Set_1_Basic directory where Atmosphere is installed. Click the Open button to open the script preset. 4 Select the rotateContinuous script in the Object Presets palette and click in the Scene Editor to place the script icon in the scene. 5 In the Inspector palette, click on the target property to select it. Notice that there is no value associated with this property. Click on the Script Whip icon and drag it to the car object in the scene. The object will be highlighted when you move the whip over it. When you release the mouse button, the objects name will appear in the Value eld for the target property.

ADOBE ATMOSPHERE 191 User Guide

6 Select File > Publish > World (Ctrl+P) to see the car object rotating in the scene.

By changing the axis and rpm properties, you can control the axis about which the object rotates and its speed.

The rotateContinuous script can be used to rotate objects in the scene.

Working with physical models


Atmospheres JavaScript API allows access to the built-in Havok physics-simulation engine. You can use JavaScript to create and control real-world physics simulations including collisions, gravity, water, wind and magnetism. A good example of physics engine scripting is the createPhysicalModel script preset. This script causes objects to act as though they are in the real world and subject to physical laws such as gravity and collisions. Objects controlled by this script will fall in the environment and otherwise behave just as youd expect. Physical models have properties for acceleration, and angular acceleration, friction, inertiaScale, mass and restitution. The createPhysicalModel script is asscociated with an entire Solid Object. If you want several objects to behave independently, then each object must have been dened as a separate Solid Object in the Scene Hierarchy.

Tutorial: Creating a Free Moving Soccer Ball


You can use the createPhysicalModel script to make a soccer ball that moves like a real one. Follow these steps.

192

CHAPTER 14

1 Locate the Help\Tutorials\Soccer folder under the directory where Atmosphere was installed. It should be a path similar to c:\Program Files\Adobe\Atmosphere\Help\Tutorials\Soccer. After navigating to your folder in the open dialog, select the project le Soccer.atmo and press Open. 2 In the Scene Editor, create a new Solid Object that is separate from other Solid objects in the environment. 3 Select the Add Script Preset menu command in the palette menu of the Object Presets palette. This will open a le dialog box. 4 In the le dialog box, locate and select the createPhysicalModel.js script in the Extras\Scripts\Set_1_Basic directory where Atmosphere is installed. Click the Open button to open the script preset. 5 Select the script and place it in the Scene view. Then locate and select the target property in the Scripting tag of the Inspector palette. 6 Drag from the Whip tool to the Solid Object that includes the soccer ball object. The Solid Objects name will appear as the value for the target property. 8 Select File > Publish > World (Ctrl+P) to see the car object rotating about the scene.

A soccer eld with a ball that is a PhysicalModel. If you collide with the ball it will be pushed forward in the scene, (but only if the Collide option is enabled in the Player).

ADOBE ATMOSPHERE 193 User Guide

Linking a Script to a Script


Linking one script to another one is one way to link an action to an event. The rst script is triggered by an event which launches another script depending on the papameters passed.. For example, you could create a push button object that uses the onClick script to cause a music le to play or stop playing depending on the state when the button is pushed. Linking to script properties can be accomplished by using the Whip tool to target scripts in the Scene Hierarchy palette.

Tutorial: Starting Rotation with the onClick Script


This example links the rotateContinuous script to the onClick script to start the rotation when an object is clicked. To link one script to another, follow these steps. 1 Locate the Help\Tutorials\Windmill folder under the directory where Atmosphere was installed. It should be a path similar to c:\Program Files\Adobe\Atmosphere\Help\Tutorials\Windmill. After navigating to your folder in the open dialog, select the project le windmill.atmo and press Open. 2 Select the Add Script Preset menu command in the palette menu of the Object Presets palette. This will open a le dialog box. 3 In the le dialog box, locate and select the rotateContinuous.js script in the Extras\Scripts\Set_1_Basic directory where Atmosphere is installed. Click the Open button to open the script preset. 4 Do the same for the onClick.js script in the Extras\Scripts\Set_2_Intermediate directory 5 Select the rotateContinuous script in the Object Presets palette and click in the Scene Editor to place the script icon in the scene. 6 In the Inspector palette, click on the target property. Click on the Script Whip icon and drag it to the windmill blades Solid Object in the scene. In the Inspector palette, select the runOnStartup property and set its value to false. 7 Select the onClick script in the Object Presets palette and click in the Scene Editor to place the script icon in the scene. 8 In the Inspector palette, click on the targetObject property to select it. Click on the Script Whip tool and drag it to the windmill house Solid Object in the scene. 9 Select Window > Scene Hierarchy to open the Scene Hierarchy palette. Locate and expand the rotateContinuous script object so all its properties are visible. Then select the targetEvent property and drag the Script Whip tool to the start property of the rotateContinuous script. 10 Select File > Publish > World (Ctrl+P) to see the windmill environment. Then click on the windmill house to start the blades spinning.

194

CHAPTER 14

The windmill environment after linking the rotate script to the onClick script. Linking scripts to scripts let you control actions based on events that the user initiates.

ADOBE ATMOSPHERE 195 User Guide

Chapter 15: Publishing


Publishing an environment is one of the nal steps to make your environment visible online. The process of publishing will bundle all of the les that make up your worldgeometry, texture, light maps, sound, video and scriptsinto a single, remarkably compact AER le ready for a web page or PDF le. Once published, the entire world will be able to see you creation, but they wont be able to open and borrow any of its components.

Testing and Debugging Environments


It would be a pity, after all your hard work, if your Atmosphere environment didnt behave as planned. To make sure your users wont be disappointed, its a good idea to test your environment before you release it.

Locating Errors
Experienced Atmosphere developers are familiar with some of the bugs that are common to online 3-D worlds, and make a point of checking for them. Atmosphere is perhaps the easiest-to-use 3-D package ever, but 3-D worlds are complex places, and bugs have a way of sneaking up on the most careful developer.
Inactive Portals

If a Portal references a URL that cannot be located, then the normally spinning red, green and blue squares will lay at. Flat Portal panels mean you should double check the URL listed for the Portal.
Leaking Light

If you create a room and the walls dont quite meet or align correctly with the ceiling, then light from the sun or background may leak in causing unwanted lighting in the scene. This is easy to check in the Player view. If you dont need it for anything else, turn off the Suns light and shadows in the Settings tab of the Lighting Control palette before lighting the environment.
Missing Textures

If you imported Viewpoint Objects and converted them to Surface Objects that now seem to be missing their textures, then you may have forgotten to move the texture map saved as a PNG le to the server. The Publishing process will move textures applied to Solid Objects, but textures from converted Viewpoint Objects need to be moved by hand after being converted.
Scripting Errors

If your environment generates scripting errors, they will be displayed in the Chat palette when the world is loaded in the Player. These errors will give the line number of the script and an error message that are helpful for debugging.

196

CHAPTER 15

The Chat palette in the Player will display JavaScript errors.


Incorrectly positioned Entry Point

If the environment loads, but the oor seems to be missing, the problem could be that your Entry Point object is contained within the Floor object. Another problem occurs when Entry Points are positioned outside of the environment: when the scene loads in the Player with Gravity enabled, the user falls away from the environment. In both cases, go into the Scene Editor and reposition the Entry Point. See Chapter 8, Working with Scene Objects.

Testing the Final Environment


Its a good idea to open your project in different browsers and on different versions of the operating system. Browser versions can have bugs that cause pages and environments that work ne elsewhere to have problems. This is particularly true if your environment communicates with HTML elements on a web page.

Using World Settings


The World Settings dialog box should be set before you publish your environment. To do this, select File > World Settings (Alt+Ctrl+S). This will open the World Settings dialog box.

ADOBE ATMOSPHERE 197 User Guide

The World Settings dialog box lets you name your scene and specify where it is located online. In this dialog box, you can name the environment and enter a Reference URL, which is the location of the HTTP server where the environment will be posted. If the Reference URL is left blank, the environment will be loaded locally when published. The Server URL denes the location of the Collaboration Server if you wish to enable chat and object synchronization. If the Server URL is left blank, it will automatically be set to use Adobes default Collaboration Server. The Topic eld is for keywords that describe your project.

If you wish to specify Adobes Collaboration Server, simply enter wac://atmosphere.adobe.com in the Server URL eld.

Publishing an Atmosphere Environment


Publishing your completed environment is as easy as selecting File > Publish > World (Ctrl+P). This will open a le dialog box where you can save the le to the AER format. This published name can be different from the name for the project le saved in the ATMO format. The publishing process will also create an HTML le that is named the same as the AER le that will load the Atmosphere environment in a web browser. Once the le is saved, it will launch a web browser and show you the environment in the Player. If you dont want a web browser to launch when you publish, you can disable this feature in the Preferences dialog box.

198

CHAPTER 15

Publishing a Single Model


In addition to publishing an entire environment, you can also publish just a single model using the File > Publish > Model menu command. Publishing a model will save it with its texture to the specied directory using the ATMO le format. It will not launch a web browser.

Publishing Preferences
The Preferences dialog offers an option to Launch Web Browser on Publish. This option will cause a web browser to launch and display your le when you Publish an Atmosphere environment-this is handy for debugging and previewing your environments. There is also an option to include a Web Page URL. This URL will be loaded in the browser when the environment is published. If the Web Page URL eld is left blank, then the HTML le created by Atmosphere will be loaded in the web browser. However, if a Web Page URL is included, then the specied URL will be loaded. If the Web Page URL points to a web page that does not include an embed tag for the Atmosphere environment, the published environment will not be visible.

The Preferences dialog box includes publishing options.

ADOBE ATMOSPHERE 199 User Guide

Publishing in a PDF Document


The web is not the only way to publish Atmosphere environments. Atmosphere les can also be included in PDF documents. Atmosphere environments are added to a PDF using the Movie tool in Adobe Acrobat.

Tutorial: Adding an Atmosphere environment to a PDF Document


1 In Acrobat, on the Advance Editing Toolbar, select the Movie Tool . 2 Click and drag in the document to the point where you want the Atmosphere scene located. This will open the Add Movie dialog box where you can Browse to the location of the Atmosphere scene to load. You will also need to select the application/x-aer MIME type from the Content Type drop-down list.

The Add Movie dialog box lets you add Atmosphere scenes to PDF documents. 3 Once the Atmosphere scene has been added to your document, you can select the Hand tool and click on the scene to browse the Atmosphere environment. 4 Clicking on the Select Object Tool will enable you to edit the scenes setting and appearance.

200

CHAPTER 15

With Atmosphere scenes make PDF documents a richer experience. Above is a PDF version of Alice in Wonderland that includes several Atmosphere scenes.

Optimization Techniques
If you intend to place your Atmosphere environment on the web, you may wish to optimize the le before publishing. Optimized les will be smaller and download faster. Optimized les embedded in PDF documents can help keep them smaller, too.. Optimizing usually means some tradeoffs between quality and le size, so its best to frequently check your work to make sure youre not sacricing too much quality. Several techniques can help keep your le sizes manageable, including: Reduce the size of textures. Use compressed JPEG images wherever you can. Use low polygon meshes where possible.

Split complex environments up into smaller environments linked using Portals. Enable the Save Files in Compressed Format option in the Preferences dialog box.

ADOBE ATMOSPHERE 201 User Guide

Apply textures only to visible faces instead of entire objects where you can. Avoid using a large number of faces in a single object. Avoid using 2 or more dynamic lights in a single environment. Be judicious in using physical models objects that are scripted to obey physics. Too many physics calculations will slow the entire environment. Offer a smaller environment with a lower screen resolution for users that must use software rendering. Avoid using a large number of Viewpoint Objects. Use Billboards for complex objects such as trees that are difcult to include as geometry models.

202

CHAPTER 15

ADOBE ATMOSPHERE 203 User Guide

Appendix A: Installing and Conguring


Installing the Atmosphere Player
The Atmosphere Player is a browser plug-in that is installed on demand when a user visits a site featuring an Atmosphere environment. If the Player plug-in is not already installed, a Security Warning dialog box will appear asking if you wish to install the Player plug-in Clicking Yes in the Security Warning dialog box will download and install the 2.6 MB Player plug-in automatically. You will not need to restart your browser once the plug-in is downloaded and installed. Atmosphere Player is compatible with Windows 98SE, Windows ME, Windows 2000, and Windows XP with Internet Explorer 5 and higher.

Installing Atmosphere will also install the Player plug-in.

Installing Atmosphere
Insert the Atmosphere installer CD and follow the on-screen instructions. You can also launch the Adobe Atmosphere Setup wizard by clicking its icon on the CD. For more detailed information, see the Installation ReadMe on the CD. Be sure to have your serial number handy - the installer will not proceed without a valid serial number.

Using Hardware Acceleration


The Atmosphere Player supports 3-D graphics hardware acceleration. If you open the Display tab in the Preferences palette for Atmosphere Player, the Active Renderer will tell you if hardware (or software) acceleration is enabled. If hardware acceleration is not enabled, you can select Hardware (Direct3D) as the Preferred Renderer and Atmosphere will try to use it if it can. The Atmosphere application requires hardware acceleration. The minimum requirements for Atmosphere list the minimum graphics hardware platform on which it is supported.

204

APPENDIX A

Hardware Rendering will improve the performance and the appearance of Atmosphere environments.

Even if you have a newer video card, the Active Renderer may still be set to Software. If this is the case, then the video card in your system is not supported. A complete list of supported video cards is included later in this chapter.

Hardware Rendering versus Software Rendering


In software rendering mode, your computers CPU has to do all the work of rendering a 3-D scene for each frame. In hardware rendering mode, the CPU hands much of the rendering computation off to a specialized graphics processor on the systems video card, often resulting in higher performance and quality.

ADOBE ATMOSPHERE 205 User Guide

A scene shows transparent windows and crisp shadows with hardware rendering.

206

APPENDIX A

The same scene with software rendering.

Tutorial: Helping Atmosphere Recognize Your Card


If the Player displays Software as the Active Renderer in the Display tab of the Preferences palette, it means that Atmosphere did not recognize your video chipset (the graphics processor on your video card). You may be able to congure Atmosphere to recognize your video chip set by manually entering it into its list of supported devices. Atmosphere uses a conguration le called AtmoHWCong.txt, which lists all the video cards it knows about. For a default installation, you will nd this le in the C:\Program Files\Viewpoint\Viewpoint Media Player\Components\ directory. If not, search your system for the le named AtmoHWCong.txt. To instruct Atmosphere to recognize your video chipset for hardware acceleration, follow these steps. 1 First, make sure that Atmosphere and all instances of the Player are closed. 2 Open the AtmoHWCong.txt le in a text editor. The le lists manufacturer and chipset information. Each entry begin like this:

ADOBE ATMOSPHERE 207 User Guide

[1002] - ATI Technologies chipsets This line, for example, identies a video chipset containing a chipset manufactured by ATI. If the line starts with two slashes it is disabled, otherwise it is enabled. 3 Try to locate your video chipset in the le (if you do not know what chipset you have, see the next paragraph). If there is a line for your chipset, but it is disabled, remove the two slashes, save the le and relaunch Atmosphere. If there is no entry for your chipset, then you will have to add a line. 4 Atmosphere recognizes your chipset from two numbers, the Vendor ID and the Device ID. If you do not see your video chipset in the list, you will have to look up the numbers for your chipset and enter them in the conguration le. 5 Download the DirectX Caps Viewer from http://www.microsoft.com/, unzip it and run it. 6 In the DirectX Caps Viewer, there is a tree view on the left. The name of your video chipset appears under the heading DirectX Graphics Adapters. Try to nd this name in the AtmoHWCong.txt le. If it is present but disabled, remove the two slashes, save the le and relaunch Atmosphere.

7 If the chipset is not listed, click on the video chipset name that appears under DirectX Graphics Adapters. In the right pane, you will see see two items, VendorId and DeviceId among others. 8 Note the characters of the VendorId eld that appear after the 0x and leading zeroes: for example, its 1002 for a VendorID of 0x00001002. 9 Note the characters of the DeviceId eld that appear after the 0x and leading zeroes: for example, its 10d for a DeviceId of 0x0000010d. 10 Check the AtmoHWCong.txt le for a line that lists your vendor. If your vendor is there, add a line like this under the vendor name: (tab)xxxx description Where (tab) means press the tab key once, xxxx is the last digits of the DeviceId and description is any text that helps you remember the entryAtmosphere ignores the description. Save the le and relaunch Atmosphere. 11 If your vendor is not listed, add two lines to the end of the le AtmoHWCong.txt le like this:

208

APPENDIX A

[xxxx] vendor description (tab)xxxx chipset description In the rst line [xxxx] is the last digits of the VendorId surrounded by square brackets and vendor description is any text that helps you remember the vendor. In the second line, (tab) means press the tab key once, xxxx is the last digits of the DeviceId and chipset description is any text that helps you remember the entryAtmosphere ignores the description text. Save the le and relaunch Atmosphere. If Atmosphere still doesnt recognize your chipset, check to make sure that you made the entries correctly, saved the le and relaunched Atmosphere. If all is correct, then it may be that your chipset, even though listed in the AtmoHWCong.txt le, is not supported by Atmosphere. This may occur because Atmosphere interrogates the chipset to nd out if it supports certain minimum capabilities. If it nds that it does not, it will automatically switch back to software rendering mode. Please be aware that Adobe has tested Atmosphere against only the chipsets explicitly listed (and not commented out) in the AtmoHWCong.txt le that came with the Player installation. If you choose to add an untested chipset, you may experience problems running the Player, crashes, or bad looking results. You may also nd that hardware rendering is slower than software rendering in certain cases. As Adobe tests more chipsets, it will add them to subsequent versions of the released Player.

Supported Video Cards


For the latest information on approved video chipsets, please check Adobes web site at www.adobe.com/products/ atmosphere.

ADOBE ATMOSPHERE 209 User Guide

Appendix B: Keyboard Shortcuts


Learning and using the keyboard shortcuts will help you become much more efcient with Atmosphere. The following list includes all the keyboard shortcuts for Adobe Atmosphere.
Menu Keyboard Shortcuts Command File > New File > Open File > Close File > Save File > Save As File > World Settings File > Publish > World File > Exit Edit > Undo Edit > Redo Edit > Duplicate Edit > Clear Edit > Clear Transform Edit > Extrude Walls From Floor Edit > Deselect All Edit > Select All Edit > Preferences Object > Group Object > Ungroup Object > Hide > Selection Object > Hide > All Object > Show All Object > Lock > Selection Object > Lock > All Object > Unlock All Object > Edit Script Shortcut Ctrl+N Ctrl+O Ctrl+W Ctrl+S Shift+Ctrl+S Alt+Ctrl+S Ctrl+P Ctrl+Q Ctrl+Z Shift+Ctrl+Z Ctrl+D Delete Shift+Ctrl+T Shift+Ctrl+E Shift+Ctrl+A Ctrl+A Ctrl+K Ctrl+G Shift+Ctrl+G Ctrl+H Alt+Ctrl+H Shift+Ctrl+H Ctrl+L Alt+Ctrl+L Shift+Ctrl+L Ctrl+E

210

APPENDIX B

Command View > New View View > Preview View > Top View > Front View > Right View > Perspective View > Bottom View > Back View > Left View > Isometric View > Zoom In View > Zoom Out View > Fit All View > Fit Selected View > Grid View > Snap to Grid View > Guidelines View > Shadows View > Reset Views Help > Atmosphere Help Help > Javascript API Documentation Help > Lighting Overview

Shortcut Shift+Ctrl+N F4 F5 F6 F7 F8 Shift+F5 Shift+F6 Shift+F7 Shift+F8 Ctrl++ Ctrl+Ctrl+0 Shift+Ctrl+0 Ctrl+ Shift+Ctrl+ Ctrl+; Shift+Ctrl+; Shift+Ctrl+R F1 F2 F3

ADOBE ATMOSPHERE 211 User Guide

Toolbar Keyboard Shortcuts Command Selection Tool Direct Selection Tool Rotate Tool Scale Tool Orbit Camera Tool Hand Tool Dynamic Zoom Tool Zoom Tool Navigate Tool Remove Texture Tool Sample Texture Tool Apply Texture Tool Misc Keyboard Shortcuts Command Access File menu Access Edit menu Access Object menu Access View menu Access Window menu Access Help menu Move to next menu Move to previous menu Move up menu list Move down menu list Execute selected menu command Move focus to next palette control Move focus to previous palette control Simulate click on button with focus Shortcut Alt+F Alt+E Alt+O Alt+V Alt+W Alt+H Right arrow Left arrow Up arrow Down arrow Enter Tab Shift+Tab Enter Shortcut V A R S C H or spacebar D Z N E I K

212

APPENDIX B

Player Navigation Keyboard Shortcuts Command Move forward Move backward Turn to right Turn to left Move upward Move downward (with Gravity disabled) Tilt view upward Tilt view downward Strafe right Strafe left Shortcut Up arrow Down arrow Right arrow Left arrow Shift+up arrow Shift+down arrow Ctrl+up arrow Ctrl+down arrow Shift+right arrow Shift+left arrow

ADOBE ATMOSPHERE 213 User Guide

Appendix C: Resource Libraries


Atmosphere ships with several libraries of preset objects including Textures, Objects, Scripts, and Sounds. They can be located in the Atmosphere\Extras folder in the location you installed the application.

214

APPENDIX C

Textures Set 1

ADOBE ATMOSPHERE 215 User Guide

216

APPENDIX C

ADOBE ATMOSPHERE 217 User Guide

218

APPENDIX C

ADOBE ATMOSPHERE 219 User Guide

220

APPENDIX C

ADOBE ATMOSPHERE 221 User Guide

222

APPENDIX C

ADOBE ATMOSPHERE 223 User Guide

Textures Set 2

224

APPENDIX C

ADOBE ATMOSPHERE 225 User Guide

226

APPENDIX C

ADOBE ATMOSPHERE 227 User Guide

Objects Set 1

228

APPENDIX C

ADOBE ATMOSPHERE 229 User Guide

Objects Set 2

230

APPENDIX C

ADOBE ATMOSPHERE 231 User Guide

Objects Set 3

232

APPENDIX C

Scripts - Set 1 - Basic


Name createPhysicalModel distantLight (default) Description Causes the target object will now possess a physical model, and experience physics using the property values set in the inspector palette. Causes objects which have been enabled to use dynamic lighting will be illuminated by the light, and also cast shadows onto themselves and onto others (if enabled to do so). If the distant light elevation and azimuth are changed, the light and its shadows will respond accordingly. Causes objects which have been enabled to use dynamic lighting will be illuminated by this light along with others in the world. fog is a global effect for an Atmosphere world. Simply placing this script into your world will cause a fog effect to be present. The various aspects of the fog can be set by adjusting the properties present in the Inspector palette. glareEffect is a global effect for an Atmosphere world. Simply placing this script into your world will cause objects which are set to emit light (a checkbox option in the application) to produce a diffuse glow over and around nearby objects. The various aspects of the glareEffect can be set by adjusting the properties present in the Inspector palette. Causes a sound to play with the specied settings. Causes the target object to rotate according to the specied settings. This script causes the target object rotate according to the property settings you have specied. Enables dynamic lighting for the target object Enables dynamic lighting for the the actor Enables dynamic lighting with the specied properties for every Solid and Surface Object in the scene

distantLight (new) fog

glareEffect

playSound rotateContinuous rotateSingleEvent useDynamicLighting useDynamicLightingForActor useDynamicLightingForAll

ADOBE ATMOSPHERE 233 User Guide

Scripts - Set 2 - Intermediate


Name angularDashpot Description When you publish the world and it is viewed in the Player, the script will cause the target solid object to attempt to maintain its rotational relationship to the reference object by applying a torque in opposition to movement. The action can be thought of as similar to a compass needle, where the movable needle always attempts to return to a direction of north. This script allows you to create a physics-enabled swinging door. The script will automatically create a physical model for the doorTarget object, and you should therefore not connect other scripts to the object which also attempt to create a physical model. This script also needs the doorHinge to have a physical model as well, which is why the Fixed Physical Model checkbox must be checked in the Inspector palette. This script allows you to have a physics-enabled object rotate around an axis, driven by a simulated motor. The script will automatically create a physical model for the motorTarget object, and you should therefore not connect other scripts to the object which also attempt to create a physical model. This script also needs the motorBase to have a physical model as well, which is why the Fixed Physical Model checkbox must be checked in the Inspector palette. This script allows you to trigger actions when the user clicks something in the world. You can specify if a shift key and/or control key must be down during the click, using shiftKeyRequired and ctrlKeyRequired, respectively. If a required key is not pressed during a click the click is ignored by the script. By default neither key is required, which means the script will react whether or not they are down during a click. You can use multiple instances of this script on the same target. This script allows you to trigger actions when things collide. The default settings make the script react when the actor collides with a part of the world. You can also set it up to report collisions between the actor and a certain object, between a certain object and something else, or between two objects in specic. This script allows you to trigger actions when the user moves the mouse cursor over an object in the world. More specically, it triggers once when the user moves the mouse cursor from somewhere else to over the target object. It does not trigger when the user moves the mouse cursor around over the target object. If the triggerOnce property is false (which is the default) then the script will trigger again every time the user moves the mouse cursor away from the object and then back over it. If this property is true then the script will only trigger the rst time the user moves the cursor over the object. In this case you can allow the script to trigger an additional time by triggering its doResetTrigger action. You can trigger doResetTrigger as often as you want. This script allows you to trigger actions depending on the distance between the actor and the place in the world the anchor is at. For this purpose the script denes a virtual sphere. The center of the sphere is where the anchor is. The distance between the center and the outside of the sphere is the trigger distance. This script allows you to trigger actions depending on the distance between the actor and the place in the world the script is at. For this purpose the script denes a virtual sphere. The center of the sphere is where the script is. The distance between the center and the outside of the sphere is the trigger distance. This script allows you to control a movie. This movie must already be present in your world, as a texture on a primitive. The script will search the target primitive for textures, and by default it will assume that the rst one it nds is the movie you want to control. This will work if you have only one face textured with the movie and leave all other faces untextured. If you want to texture the other faces too then you should set the movieFilename property to the lename of the movie. The script will then search the target primitive for a texture with the given name, and assume that is the movie you want to control.

controller-door

controller-motor

onClick

onCollide

onMouseOver

onProximityOfActorToAnchor

onProximityOfActorToScript

playMovie

234

APPENDIX C

pointToPointConstraint

This script sets up a point to point constraint between the target object and the reference object. The script will create a physical model for the target object, so make sure you dont use the target object with another script that wants to do so. The script also needs the reference object to have a physical model, however it wont make one for it. Make sure the reference object has one by checking the Fixed Physical Model checkbox in the object inspector window in the builder. This script allows you to swap one or all of the textures on a primitive object with another texture. The guide above tells you how to set up the script to swap all textures on the target object. This is the default behavior when you leave the baseTexture property empty. You can also set the baseTexture property to the lename of one of the textures you put on the primitive. In that case the script will only swap that texture with the swap texture, and leave all other textures alone. You can swap between the base textures and the swap texture with the swap action. If you want to make sure that the base textures are on, use the useBaseTexture action. Similarly, if you want to make sure that the swap texture is on, use the useSwapTexture action.

swapTexture

windController

This script allows you to affect an object with wind. You dene the direction the wind blows in by placing the anchor linked to the windOriginAnchor property. The wind blows from that anchor towards the script. The strength of the wind is set with the windStrength property, where 0 is no wind at all and 100 is a storm.

Scripts - Set 3 - Advanced


Name booleanSquareWave Description When you publish the world and it is viewed in the Player, the signal oscillate between the startValue (true or false) and the opposite of the startValue (false or true). The duty cycle determines the fraction of the time spent at the startValue, and should be between 0.0 and 1.0. The output should be fed to script inputs that required a boolean value. When you publish the world and it is viewed in the Player, the signal will ramp from the start value to the end value over a length of time equal to the transition time. This is useful for fading lights, adjusting angles or rotation, or volumes. This is one of a wide variety of possible signal generating scripts. You should feel free to experiment writing other ones! When you publish the world and it is viewed in the Player, the signal will ramp from the start value increasing continuously with time by rampRate per second. This may be used to continuously increase any number such as azimuth on a light. Note that the ramp rate my be changed dynamically by another script allowing it to change over time.

signalRamp

signalRampContinuous

ADOBE ATMOSPHERE 235 User Guide

Appendix D: JavaScript API Overview


Introduction
This document is intended to provide an overview of the JavaScript Application Programming Interface (API) which is made available in Atmosphere. The API allows Atmosphere users to write JavaScripts which can be included with an Atmosphere world, and which then enable the world to be fully interactive and dynamically change over time. The document begins with a discussion of how an Atmosphere scene is structured, explaining the hierarchy of scene objects in the form of a tree. The user interface hierarchy is also introduced. Information is provided on how to enable scene objects to be controlled by the physics engine present in Atmosphere. It concludes with a discussion of script execution order, and how to update objects using periodic callbacks. JavaScripts are the key to making your world interactive. They allow animation of an objects position and orientation, and enable control of global effects such as fog, glare, and dynamic lighting. For users unfamiliar with programming techniques, Preset Scripts are included with the Atmosphere application which will automatically cause some of the behaviors mentioned. Understanding how scripts affect individual objects and groups of objects will help you as you add scripts to your world and assign values to customize their behavior. The information provided below, along with the API table of methods and properties and the examples available at the Atmosphere website, are all intended to aid developers in creating powerful scripts with signicant embedded intelligence.

SceneGraph Overview
The objects available within the JavaScript API are organized in hierarchies. Two main hierarchies exist: the scene hierarchy, which contains the scene geometry, and the user interface, with the application at its root.

The Scene Hierarchy


The currently viewed world is represented as a hierarchy of objects which is referred to as the scene hierarchy. The scene hierarchy is comprised of the objects shown in the Scene Hierarchy palette when using the Atmosphere application. A typical palette with several objects is shown below:

236

APPENDIX D

The scene hierarchy is rather like a folder hierarchy in the operating system. Objects may be thought to be contained within nested folders. However, in addition to storing an object, the scene hierarchy also affects the 3D position of objects displayed in the scene. Moving a parent object will also move the child objects if they are attached to parent (true by default), and the position of objects will be in parent relative coordinates. If the objects are not attached to parent (by setting to false in the API), then their position is in absolute world space coordinates. To aid the positioning of objects in the API, there are properties on objects that give the world space position directly for an object independent of where it is in the scene hierarchy. By default in the Atmosphere application, all objects are attached to parent.
The World

At the top of a scene hierarchy is the world which is a container of type SceneGroup that has listed within it child objects that are other scene objects. The World is accessed within the JavaScript API using the global variable theWorld. The world will contain the globals theActor and theStage.
The Actor

The actor (the global theActor) represents the local user of the application. It has various properties that represent the motion of the Actor as he or she moves through the 3-D world. There is a built-in standard navigation scheme that may be partially or fully disabled and replaced with a motion that is determined by a JavaScript. (The control of the Actor motion and view of ones avatar are discussed in more detail in a later section.)
The Stage

The stage is a container for all content loaded from les when interacting with a world (excluding the actor and remote actors). The stage may directly contain solid objects, surface objects, Viewpoint objects, etc., as well as other scene groups with their own nested content. When a model is added to the world using a script to open an .AER le, it is added to the stage by default.

ADOBE ATMOSPHERE 237 User Guide

Solid Objects

A solid object is a scene element that contains a hierarchy of primitives that include boxes, cones, walls, oors, anchor points, entry points and groups that contain other primitives. In the Atmosphere application the primitives may be edited and moved relative to each other. In the Player application, the primitives will have been combined together into a single xed shape. This shape, the solid object, may be animated and used to do physics, but the primitives will be xed in their position relative to the solid object. The tree of primitives is accessed using the rootPrimitive property, and may be searched using the nd function. Alternatively, you may nd a named object within a solid object using the getPrimitive function.
Primitives

A primitive is an object that represents a single geometrical entity in the Builder, such as a cone, box, oor or wall. Other primitives include anchors and entry points that may be used to specify positions and orientations to a script. Primitives that have geometry contain an array of face objects which correspond to the planar polygons of the primitive. Primitives may also have on-click methods attached to them to enable interaction.
Faces

A face object of a primitive represents a single planar region of that primitive, and may have an associated surface texture.
Surface Textures

A surface texture is an object that contains the mapping between a face and a texture map. This mapping includes the rotation angle, size and position of the texture relative to the surface. It also contains a reference to the texture object which stores the actual image.
Textures

A texture is an object that stores an image, and which is used by a surface texture to be mapped onto a primitive.
Viewpoint Objects

A Viewpoint object is an element in the scene hierarchy which contains an imported object specied by a Viewpoint MTX le (which may have an associated MTS le). A Viewpoint object contains a single MTSScene object, which is the root of the Viewpoint scene hierarchy. A Viewpoint scene contains a hierarchy of instances. An instance contains a transformation and reference to a piece of Viewpoint geometry (a polygon mesh) as well as an array of child instances. Viewpoint instances also contain an array of MTSMaterial objects that describe how a piece of geometry is textured and rendered. Viewpoint surfaces may be textured using static images (MTSTexture) or SWF animations. Viewpoint objects may have rich materials including bump mapping and environment mapping, but do not take part in static lighting computations in the Atmosphere application. Viewpoint objects do not receive dynamic shadows in the Player.

238

APPENDIX D

Surface Objects

A surface object is an element in the scene hierarchy which contains one or more surfaces. These are currently authored by converting from Viewpoint objects. The advantage of surface objects is that they may be included in static lighting computations in the Atmosphere application and can receive dynamic shadows in the Player.

The User Interface Hierarchy


The User Interface Hierarchy contains objects that are used to access high-level elements of the user interface such as windows, keyboard events, and 2-D windows used to display 3-D renderings of the world.
The Application Object

The Application object, available as the global application, is the object that represents the user interface and input peripherals. These include the state of keys in the keyboard and the mouse button. The application also has an array of view objects, one for each window into the current 3-D world. (In this version of Atmosphere there is only one such view.) The application also has some control over the chat window and can send JavaScript commands to external objects on the web page of the plug-in allowing back-end processing.
View Objects

A view object represents the 2-D window within which the world may be seen. A view knows its size in pixels and the X/Y position of the mouse when the cursor is over the rendered window. A view also has an array of cameras representing different 3-D projections of the world. (In the current release there is one camera per view.)
Camera Objects

A camera object has a 3-D position and orientation along with variables to control the eld of view. A camera also has some utility functions to enable 2-D pixel coordinates to be converted into 3-D ray directions and vice versa. This is useful when implementing interactive scripts that need to re rays into a scene.

Physical Simulation
One of the powerful features of Atmosphere is the ability to create physically-realistic animation using the built-in physics engine. A physics engine may be thought of as a process that updates the position and orientation of certain objects every frame in accordance with the laws of physics. Without a physics engine, objects can pass through each other without collisions and do not experience forces such as gravity. In addition, physics engines allow the specication of physical constraints which restrict the motion in a way that is consistent with the presence of things like hinges, slide rails or pivot points. Using combinations of physically animated objects and constraints, it is possible to construct elaborate mechanisms (such as vehicles) that interact with the world and with each other in a realistic manner.

ADOBE ATMOSPHERE 239 User Guide

Physical Models
An object will only be animated using physics when a physical model has been created to control it. Each frame, the physical model updates the position and orientation of the object for which it was created. Physical models have position, orientation, velocity, angular velocity, and acceleration. They also have ags that determine whether they are xed in space, and whether they will collide with other physical models. Collisions may be disabled between pairs of physical models as needed to permit intersections which are part of the design. For reasons of efciency, there are two kinds of physical models convex and concave. Convex physical models are approximated using the convex hull of their geometry and they simulate collisions efciently. Concave physical models are slower, but allow objects to enter within the convex hull of each other to compute more accurate collisions. An exception to this rule occurs when a physical model is created with a mass of zero. In such a case, the physical model is locked to the world, and a concave physical model is just as efcient as a convex. This is especially useful when using a Viewpoint object to represent a terrain surface or part of a xed structure (such as a slide). Making a terrain object convex would prevent other physical models from moving into the valleys. Making it concave is still efcient, since the physical model has zero mass and so is locked in place. To create a physical model, a function such as createPhysicalModel(mass, inertiaScale) is called, and may be used with a scene group, a Viewpoint object, a Viewpoint instance, a surface object or a solid object. When createPhys icalModel(mass, inertiaScale) is called for a scene group, any Viewpoint objects, surface objects and solid objects contained within the scene group are unioned together into one physical entity (note that this does not include child scene groups). There is a ag which prevents the union with a parent scene groups physical model, and this ag is automatically set to true if an object within the scene group has already been used to create a physical model. Child scene groups will be kinematically placed relative to the parent every frame, but will not interact physically. The user interface for the Adobe Atmosphere Player application includes check boxes for Collisions and Gravity. Note that these settings actually only control whether the Actor experiences gravity and collisions. To enable gravity for a physical model, the physical model must have its vertical acceleration set to a Vector (such as Vector( 0, -32, 0 ) for Earths gravity at sea level). This enables gravity to be controlled independently for different objects. A hot air balloon, for example, might have the acceleration for its canopy set to point upwards, simulating lift.
Physical Constraints

A constraint object, in the physics engine, is a way to restrict the motion of two physical objects in such a way that there appears to be a type of mechanism connecting them. For instance, a point-to-point constraint requires that a point on one physical object remain in the same position as a second point on a second physical object, no matter how one or both of them moves. In this way the effect of a spherical joint may be added to the simulation. Hinges (using a hinge constraint) and rails (a prismatic constraint) may also be created. Constraints need to be solved or enforced, using a fast constraint solver object. One of these objects is created in the script, and the constraints are set using a specied solver. Angular Dashpots are not constraints as such, but may be used as damped angular springs to encourage the relative orientation of one object to another, such as a spring-loaded door.

240

APPENDIX D

JavaScript Interpreter Information


Atmosphere includes its own JavaScript interpreter, which is fully ECMA Standards compliant. This interpreter is now compliant to Level 5, and is used by numerous Adobe applications. All scripts attached to Adobe Atmosphere worlds are processed by this interpreter, which has been extended with the JavaScript API that appears in these documents.

Scope
As you browse worlds using the Adobe Atmosphere Player, a separate instance of the interpreter is created for each world that you visit. Additionally, any loaded scene groups or avatars that have JavaScripts attached to them will also have their own separate interpreter. This is done in order to prevent name collisions between sets of world scripts and those scripts running on loaded scene groups. All scripts present in an Atmosphere world will share the same JavaScript interpreter. For example, a world which contains entries into the JavaScript URL eld on the Inspector Palette for both a solid object and a scene object will both share the share the same interpreter. Global variables declared in either of these scripts will be available to both scripts. Stated another way, if two scripts both dene a global variable named distance, the last value set for distance will be used by both scripts. If not intentional, this will likely produce unpredictable results during processing. However, global variable sharing may also be exploited to allow the sharing of state between scripts in a convenient fashion. To prevent unwanted name collisions, avoid global variables, and instead use variables attached to the this variable, such as in this.mass = 1.0;. Such an approach will limit the scope of the variables to the script object itself.

Object Loading and Script Execution Order


Understanding the execution sequence of scripts is an important consideration when designing worlds that contain multiple objects. When you visit a virtual world using the Atmosphere Player, the following load sequence is performed: 1 Load the world solid objects and corresponding light map information and surface objects immediately. 2 Initiate loading for any Viewpoint objects. 3 Start loading world textures asynchronously, meaning they will be displayed as they arrive. Also note that only those textures which are visible in the current view will be loaded initially. This approach is intended to minimize download time and shorten load delay. As the visitor browses the world and new textures are required, they are loaded asynchronously as well. 4 If present, load and run any JavaScripts present in the World. These JavaScripts may also load other scene groups asynchronously. (Note that the script attached to the World will always be run rst, so that is a good place to initialize any global variables.) 5 For any primitive or Viewpoint object that nishes loading, run its JavaScript if one is present. 6 A script for a loaded object may load other scene groups asynchronously, and so on.

ADOBE ATMOSPHERE 241 User Guide

For Viewpoint objects and script-loaded scene groups, it is possible for the object to exist before all of its elements (such as geometry) have been fully loaded. Attempting to use such elements prematurely will cause an error. (One such example is using the object to create a physical model from geometry that has not loaded yet.) It is important, therefore, to wait until the objects have fully loaded before proceeding further. Whenever a script is told to run, and the script does not return within a specied duration, the script will time out, that is be permanently stopped. Scripts are prevented from looping continuously in this way to avoid hanging the system. This requires that scripts do not loop continuously waiting for an object to load. Instead a call-back is needed in the script to check the status of objects. There are two possibilities: one is to dene a timestep function, called back every frame and within which the loaded ag is tested until true; a second approach is to dene an onLoad function, that will be called back once when the object nishes loading. In either case, the object must be added to the list of objects which will receive callbacks via the addAnimator function.

Many of the Preset scripts included with Atmosphere initiate a timestep which tests to see if the target object is loaded prior to performing any action on it. See the code in these scripts for an example of best practices on testing whether something is loaded.

Script Context
JavaScripts attached to objects may be run in three different situations or contexts. Atmosphere creates three global variables to aid in this distinction:
worldContext this global variable will be true anytime that a script is not attached to an avatar in any manner (that is, not used by an AER le which is loaded as an avatar). localAvatarContext this global variable will be true for the owner of an avatar only. In other words, when a script is

attached to an AER le which is then loaded as an avatar, this variable will be true only for the person who is using the AER le as their avatar.
remoteAvatarContext this global variable will be true for your avatar script when it is being run on a remote users

computer. This distinction allows an avatar owner to process events differently depending upon the context of the avatar. For example, an avatar may contain animations which are triggered by buttons on the control panel. The avatar owner may wish to only create the buttons on their local control panel, and not those of the remote users. In addition, these global variables may also be used in conjunction with the chat.lter() method to send silent messages to their remote avatar, triggering the animations on the remote users computer.

242

APPENDIX D

ADOBE ATMOSPHERE 243 User Guide

Appendix E: JavaScript API


JavaScript API Features
With the latest version of the Adobe Atmosphere Player, the JavaScript API has been expanded to over 800 Properties, Methods, and Callbacks. This large library is intended to provide developers with access to nearly every aspect of the Atmosphere Player 3D stage, as well as its supporting web page. Now also included in the Atmosphere Player is the HAVOK Physics processing engine, an industry leader in dynamic simulation of object behavior, and the same engine found in todays top electronic games. With this engine, objects in an Atmosphere stage can respond to many simulated physical forces such as Wind, Magnetics, and Fluid, with faster and more robust processing for Gravity and Collision. Objects can be constrained by powerful controllers such as Wheel constraints, Hinge constraints, Spring constraints, and more. Atmosphere also now supports 3D Hardware Acceleration for many of todays popular graphics cards. This improved graphic perfomance combined with powerful physics processing enable Atmosphere worlds to be much more dynamic and immersive than ever before. Dynamic lighting (as a Distant Light) is also now available for added realism, in addition to the powerful static radiosity rendering already present. Support has also been added for additional features such as Keyboard Events, Media Playback (Windows media, Flash, Quicktime), and the ability to syncronize object position and behavior for all visitors to the Stage.

Utility Functions
animators

The list of all registered animators. Some entries may be the value false. Animators are used each timestep to callback a timestep function(now, deltaTime) if one has been dened for the animator. Animators are also called back once with the onLoad(now) function, if it is dened. This happens after all scripts for the world have been run and the animators loaded ag has transitioned from false to true.
chat.print (There are (at most) + animators.size + animators.);

context

indicates the context in which the script is being run:


worldContext The script is attached to a world that has been opened localAvatarContext The script is attached to your avatar, running locally remoteAvatarContext The script attached to your avatar, running on a remote client
if (context == localAvatarContext) { chat.print(This is a LOCAL avatar script.); }

244

APPENDIX E

else if (context == RemoteAvatarContext) { chat.print(This is a REMOTE avatar script.); } else { chat.print(This is not an avatar script.); }

localAvatarContext

the value of the context global in an Avatar script which is running on the client that owns the Avatar.
remoteAvatarContext

the value of the context global in an Avatar script which is running on another users client.
worldContext

the value of the context global in a world script.


version

Returns the version number of the application.


// Some features didnt exist before then... if (version < 1.2) { ... }

Global Methods
addAnimator(object)

Adds the given object to the list of animators. Once every frame, each animators timestep(t, deltaT) callback is called, where t is the current time in seconds since the world was entered, and deltaT is the time in seconds since the last timestep. Additionally, each animators onLoad() callback is called when the last and nal javascript le associated with the world has been successfully loaded and executed.
foo = new Object; foo.timestep = function(t, deltaT) { chat.print(This timestep is at + t + seconds.); chat.print(Last timestep was at + (t - deltaT) + seconds.); } addAnimator(foo);

removeAnimator(object)

Removes the given object from the list of animators. If the object is in the animators list more than once, only one instance of it is removed.
removeAnimator(foo);

dump(object)

Displays the properties of the object in the chat output window.


dump(fog);

ADOBE ATMOSPHERE 245 User Guide

dir(object)

Displays a hierarchical list of the objects children in the chat output window.
obj = theStage.getSolidObject(0); prim = obj.rootPrimitive; dir(prim);

path(object)

Returns the absolute path of an object based on parent links.


prim = theStage.getPrimitive(somePrimitive); primPath = path(prim); chat.print(primPath);

PluginCommand(stringCommand, 0, 0)

This method allows Webpage Javascript to communicate with Atmosphere Javascripts. Any Javascript code that Atmosphere can process can also be triggered from an Webpage script. Functions can be called, properties changed, and variables updated. In the Webpage, the Atmosphere Player is loaded using the <object> tag, which also allows for an id value in the tag. (If you are using the AtmosphereInterface.js provided by Adobe, the id value will automatically be assigned to MetaCtl0.) Once the page has been processed and Atmosphere is loaded, you may reference the Atmosphere object using the document object SceneGroup (DOM) in HTML. The PluginCommand described here becomes a method of the Atmosphere object, and is called in this manner: document.all.MetaCtl0.PluginCommand(stringCommand, 0, 0); To send a command to from the Webpage javascript to Atmosphere Javascript, embed the identical Atmosphere command into a string as the stringCommand argument. Because the command is sent as a string, pay careful attention to how embedded strings within your command are represented, since it is possible that they may incorrectly terminate the command. As a reminder, there are two methods in Javascript for ensuring that multiple string quotations do not cancel each other out. The rst is easier to visualize for syntax compliance, but as your command string gets longer the second method will become useful. First Method: alternate the use of quotation types, as in . Heres an example of a short command which is easy to recognize as having correct syntax, and easy to send: document.all.MetaCtl0.PluginCommand(chat.print(Hello Atmosphere User!);, 0, 0); Second Method: use the backslash character \ prior to the embedded quotations. Using the backslash character will instruct Javascript that the next character in line should be processed as part of the string, and not a control character. The example shown here uses the same command example as above, but with different formatting to help clarify the backslash use: document.all.MetaCtl0.PluginCommand(chat.print(\Hello Atmosphere User!\);, 0, 0); Both examples above will produce the same result in the Atmosphere Chat window (a string message). Again, depending upon the length of your command, both methods will be useful, with longer command strings being more easily created with the second method.

246

APPENDIX E

Finally, it is possible to concatenate Webpage variable values into your command string sent to Atmosphere. Once understood, this process is not difcult and is very useful to induce Atmosphere actions and changes based upon events in the Webpage. * See the examples elsewhere on the Atmosphere website to demonstrate this behavior in more detail. The example can be downloaded and examined or customized for your particular application. * Note: when modifying properties in in Atmosphere, its necessary to wrap the command in an eval() method, as shown below. This requirement may be removed in the future.
//automatically hide the Atmosphere Chat pane document.all.MetaCtl0.PluginCommand(eval(application.chatPaneVisible = false);, 0, 0); //move a world object using a variable value from the webpage document.all.MetaCtl0.PluginCommand(eval(box.position = Vector(box.position[0], + pageValue + , box.position[2] ) );, 0, 0);

sendJS(stringCommand)

This method allows Atmosphere world Javascripts to communicate with the Webpage Javascript. Any Javascript code that the Webpage can process can also be triggered from an Atmosphere script. The entire document object SceneGroup (DOM) can be addressed, functions can be called, properties changed, variables updated. To accomplish any of these tasks, simply embed the identical Webpage call into a string within the sendJS(stringCommand) method. Because the command is sent as a string, pay careful attention to how embedded strings within your command are represented, since it is possible that they may incorrectly terminate the command. As a reminder, there are two methods in Javascript for ensuring that multiple string quotations do not cancel each other out. The rst is easier to visualize for syntax compliance, but as your command string gets longer, the second method will become useful. First Method: alternate the use of quotation types, as in . Heres an example of a short command which is easy to recognize as having correct syntax, and easy to send:
sendJS(alert(Hello, World.););

Second Method: use the backslash character \ prior to the embedded quotations. Using the backslash character will instruct Javascript that the next character in line should be processed as part of the string, and not a control character. The example shown here uses the same command example as above, but with different formatting to help clarify the backslash use:
sendJS(alert(\Hello World.\););

Both examples above will produce the same result in the Browser window (which is an alert dialog showing the Hello World. text). Again, depending upon the length of your command, both methods will be useful, with longer command strings being more easily created with the second method. Finally, it is possible to concatenate Atmosphere variable values into your command string sent to the webpage. Once understood, this process is not difcult and is very useful to induce webpage actions and changes based upon events in the Atmosphere world.

ADOBE ATMOSPHERE 247 User Guide

* See the examples elsewhere on the Atmosphere website to demonstrate this behavior in more detail. The example can be downloaded and examined or customized for your particular application.
// Open the URL in a browser window sendJS(window.open (http://www.adobe.com, , );); // Pop up a JavaScript alert window sendJS(alert(\Hello World!\);); // Update a webpage form checkbox with the Atmosphere current state sendJS(document.forms[myForm].chatPaneVis.checked = + application.chatPaneVisible);

$.gc()

This global method will force JavaScript memory garbage collection. More clearly, at regular intervals, the Atmosphere JavaScript processor performs memory reset and update for variables and objects which have been deleted in the JavaScript code. When large amounts of processing occurs using objects and variables of *identical* names, the objects or variables may be recreated prior to being deleted by the normal Javascript cleanup routine. If you experience errors under these conditions, you may insert this garbage collection method into your routine to ensure that the reused objects and variables were properly deleted prior to being reused.
//delete and recreate a new array of box SceneGroups function deleteBoxes() { //delete the rst group of boxes for ( i=0; i<50; i++ ) { delete boxes[i].SceneGroup; } //force memory clean up $.gc(); //recreate a new box array for ( i=0; i<50; i++ ) { boxes[i].SceneGroup = SceneGroup(./box.aer); } }

Callbacks
timestep(t, deltaT)

This function is called each frame with the current time in seconds that has elapsed since the world was entered. In worldInit.js the list of animators is traversed by this callback which in turn calls the timestep functions for each of the animators. Use custom timesteps to accomplish animated behavior, such as moving an object from one location to another over a specied duration. Creating custom timesteps require an object as a reference. For in-depth examples on

248

APPENDIX E

the use of the timestep method, follow the Javascript Workshops link at the Adobe Atmosphere website. (Please also note that there is a default function present for the timestep(t, deltaT) method in the worldinit.js le, and it is not recommended that you change this behavior).
box = SceneGroup(./box.aer).add(); box.timestep = function(t, deltaT) { box.orientation = Rotation(y, t); } addAnimator(box);

onLoad()

This function is called after the last and nal JavaScript le associated with the world has been loaded and run. In worldInit.js this event is used to wait for scripts to be loaded before testing whether animators need to have their onLoad methods called. This is done when their loaded ag transitions from false to true. The onLoad() method can be used to initialize objects as they load. Creating a custom onLoad() callback requires an object as an animator. Note: the addAnimator function must be used in order to enable the onLoad callback function. (Please also note that there is a default function present for the global function onLoad() in the worldinit.js le, and it is not recommended that you use this as a global function name in a script.)
box = SceneGroup(./box.aer).add(); box.onLoad = function(now) { chat.print(onLoad called at: + now); } addAnimator(box);

Application
Application
The Application module is is used to communicate with elements of the user interface. These include the keyboard and mouse buttons, which may be read. There are also ags that control the visibility of the chat pane and the toolbar, both of which appear in the Player window. The Application module also maintains an array of View objects that each represent a 3-D rendered view of the current world. (Currently there is exactly one such view.) Global Properties
application

This global variable stores a reference to the object that represents the application.
// Print out properties associated with application dump(application);

ADOBE ATMOSPHERE 249 User Guide

Properties
type

The type of object, returned as Application.


// prints Application to the chat console chat.print(application.type);

controlKeyDown

A boolean ag that is true when the control key is down.


if (application.controlKeyDown) { ... }

shiftKeyDown

A boolean ag that is true when the shift key is down.


if (application.shiftKeyDown) { ... }

leftArrowKeyDown

A boolean ag that is true when the left-arrow key is down.


if (application.leftArrowKeyDown) { ... }

rightArrowKeyDown

A boolean ag that is true when the right-arrow key is down.


if (application.rightArrowKeyDown) { ... }

upArrowKeyDown

A boolean ag that is true when the up-arrow key is down.


if (application.upArrowKeyDown) { ... }

downArrowKeyDown

A boolean ag that is true when the down-arrow key is down.


if (application.downArrowKeyDown) { ... }

mouseButtonDown

A boolean ag that is true when the left mouse button is down.


if (application.mouseButtonDown) { ... }

chatPaneVisible

Controls display of the chat pane in the Player window area.


application.chatPaneVisible = false; //turn it off for maximum viewable area

splitPercentage

Species the percentage of the Player window area which should be occupied by the chat pane.
application.splitPercentage = 20; // set to 20 percent

250

APPENDIX E

toolbarVisible

Controls the display of the toolbar which appears at the lower edge of the Player area.
application.toolbarVisible = false; //turn it off for maximum viewable area

Methods
getView(index)

Returns the View object selected by the value of index. Currently the only valid value for index is 0.
view = application.getView(0); dump(view);

getViewCount()

Returns the number of views in the application. Currently will always return 1.
numViews = application.getViewCount(); chat.print(There is/are + numViews + view(s).);

View
The View module is an object that represents a 2-D rendered window that is being used to image a 3-D world. The module properties include the size of the rendered area and the current mouse coordinates relative to the view. The View module also contains an array of cameras that are being used to image the world onto the 2-D view plane (Currently there is exactly one camera per view.) Properties
type

The type of the application returned at View.


if (foo.type == View) { ... }

imageWidth

The width of the current rendered view in pixels.


view = application.getView(0); chat.print(Current rendered image width = + view.imageWidth);

imageHeight

The height of the current rendered view in pixels.


view = application.getView(0); chat.print(Current rendered image height = + view.imageHeight);

mouseX

The X coordinate of the pixel that the mouse cursor is over in the rendered view. 0 represents the left side of the screen, with the value increasing as the cursor goes to the right.
view = application.getView(0);

ADOBE ATMOSPHERE 251 User Guide


stageModel.getSolidObject(0).rootPrimitive.onClick = function() { chat.print(You clicked down at X-coordinate: + view.mouseX); }

mouseY

The Y coordinate of the pixel that the mouse cursor is over in the rendered view. 0 represents the top of the screen, with the value increasing as the cursor goes down the screen.
view = application.getView(0); stageModel.getSolidObject(0).rootPrimitive.onClick = function() { chat.print(You clicked down at Y-coordinate: + view.mouseY); }

mouseInitialized

This is a boolean property which will return true when the mouse is over the render view area.
view = application.getView(0); if (view.mouseInitialized) { /* ready to track mouse */ }

Methods
getCamera(index)

Function that returns a reference to the camera for given numerical index
camera = view.getCamera(0);

getCameraCount()

Function that returns the number of cameras associated with rendering this view. (Currently exactly one.)
numCameras = view.getCameraCount();

triggerRedisplay()

Forces the view to be fully redrawn during the next time step. This may be necessary when changing the appearance of Viewpoint objects.
view = application.getView(0); view.triggerRedisplay();

Button
The Button module enables a script to add buttons and toggles to the browsers Controls panel. Once created, the buttons and toggles may be added and removed from the panel freely (so that they may be made visible when they are relevant). The script may also change their labels and states at any time. The script may query the state, or may be notied of changes (typically when the user clicks on the button or toggle, but also when the script changes the state) via the onClick() callback.

252

APPENDIX E

Global Methods
Button(label)

creates a Button with the specied label (optional). The Button will not be added to the Control Panel until you call add().
takePicture = Button(Say Cheese);

Toggle(label)

creates a Toggle with the specied label (optional). The Toggle will not be added to the Control Panel until you call add().
fogToggle = Toggle(Fog Enabled);

Properties
state

true if the button or toggle is down/checked, false if it is up/unchecked.


// Init the toggle to reect the current fog state. fogToggle.state = fog.active;

enabled

If false, the button or toggle will not respond to clicks.


// Dont let the user change the fog right now. fogToggle.enabled = false;

label

the button or toggles current label


button.label = Try Again!;

Methods
add()

adds the button or toggle to the control panel associated with the current world. The toggle itself is returned as a convenience.
fogToggle = Toggle(Fog Enabled).add();

remove()

removes the button or toggle from whatever control panel it is currently in.
fogToggle.remove();

Callbacks
onClick(state)

is called when the button is pressed or when the toggle state changes (either due to the user clicking on it, or if toggle.state is changed by JavaScript code).

ADOBE ATMOSPHERE 253 User Guide


fogToggle.onClick = function(state) { fog.active = state; }

Slider
The Slider module enables a script to add sliders and progress bars to the browsers Controls panel. Once created, the sliders may be added and removed from the panel (so they may be, for instance, only made visible when they are relevant). The script may also change their labels and values at any time. The script may query a sliders value, or may be notied when it changes (typically when the user slides the tab or types a new value, but also when the script sets the value directly) via the onChange() callback. Global Methods
Slider(label)

Creates a Slider with the specied label (optional). The Slider will not be added to the control panel until you call add().
fogNearSlider = Slider(Fog Near);

Progress(label)

Creates a Progress Bar with the specied label (optional). The Progress Bar will not be added to the control panel until you call add().
lifeProgress = Progress(Life Force Left);

Properties
enabled

If set to false, greys the slider and makes it unavailable for use. (default = true)
fogNearSlider.enabled = false;

integersOnly

If true, the slider will accept and generate only integer values. False by default. (For progress bars do not set integersOnly to false in the current release.)
// Drop-off expects only integers. fogDropOffSlider.integersOnly = true;

label

The sliders current label


fogNearSlider.label = Fog Near;

range

The min and max values the slider encompasses


fogNearSlider.range = [1, 100];

254

APPENDIX E

value

The current value of the slider.


// Init the slider to the current value. fogNearSlider.value = fog.near;

Methods
add()

Adds the slider or progress bar to the control panel associated with the current world. The slider itself is returned as a convenience.
fogNearSlider = Slider(Fog Near).add();

remove()

Removes the slider from whatever control panel it is currently in.


fogNearSlider.remove();

Callbacks
onChange(value)

Is called when the sliders value changes (either because the user moves it or if slider.value is changed by the script).
fogNearSlider.onChange = function(value) { fog.near = value; }

PrintDevice & Object Synchronization


The PrintDevice is an object which is used to direct text strings to a destination, such as the chat window. This functionality can be used to lter text for custom commands and thereby control your Avatar on a remote user system, and also to lter chat input from visitors to your world. In addition to text ltering, the PrintDevice contains functionality for Object Synchronization between worlds. When two or more visitors enter the same world, an instance (or copy) of each world is actually being run on the local computer for each user. Atmosphere *automatically handles synchronization for the visitors and thier representantive Avatars, as well as for synchronized chatting. However, if other objects are present in the world which have dynamic behavior and/or which can interact with the user, the conditions of the local worlds could easily become signicantly different (objects in different places, different music playing, etc.). Object synchronization is an attempt to overcome this problem to a limited extent, and enable reasonably similar conditions for all visitors to a world, including dynamic objects or media. Be aware that since the Internet has inherent delays in exchanging information, split-second identical conditions for all visitors should not be expected nor is theoretically possible. Object synchronization is accomplished by causing the Atmosphere server to create and maintain shared object names, properties, and values. This information is maintained as long as visitors to a given world are present. Once all visitors have exited, the shared information is deleted by the server, and the conditions are in a manner reset.

ADOBE ATMOSPHERE 255 User Guide

Lastly, successful synchronization requires that a consecutive series of steps be followed for establishing shared object names and their conditions. The Atmosphere website shows an example of this technology, and will aid greatly in creating your own solution. *(Note that Adobe provides a limited quantity of default server power for handling avatar, chat, and object synchronization. See documentation elsewhere regarding). Global Properties
chat

A PrintDevice representing the chat window in the Atmosphere Player.


chat.print(Hello World);

Properties
avatarID

A GUID for your avatar in the current world. This property will allow you to send messages to your remote avatar more easily. Note that it is not possible to obtain the GUID of another avatar.
myCurrentAvatarID = avatarID;

isConnected

This property will return true once a connection with the server has been established.
if (isConnected) { ... }

worldID

A GUID for the world you are currently visiting.


myCurrentWorldID = worldID;

Methods
input(a, b, c, ...)

Concatenates the parameters together into a single string and enters it as if the user had typed it in. Note that the string will not be displayed in your local chat window. This method is presently only available for the chat device, and only for Local Avatar scripts.
chat.input(Hello Everybody!);

print(a, b, c, ...)

Prints the specied strings or values. Note that this method is not available for your Remote Avatar script.
status.print(All is well.);

createSharedObject(str objectName)

Creates a JavaScript object of the given name on the chat server, and which is shared by all visitors. This function will trigger the callback onSharedPropertyChange(sName, sProp, sValue) for the sender only. Note that both sProp and sValue will be empty strings for this rst callback.

256

APPENDIX E

chat.onConnect = function() { chat.createSharedObject(myGlobe); }

getSharedProperty(str objectName, str propertyName)

This method is a local check of the property value; it does not communicate with the server
chat.getSharedProperty(myGlobe,isSpinning);

requestSharedProperty(str objectName, str propertyName)

Notice that only a request method exists; there is no method to create a shared property. This prevents new visitors from forcibly (accidentally) resetting the value of the shared property when they arrive. When this method is called, it will trigger the onSharedPropertyChange(sName, sProp, sValue) callback for the sender only. If the property already exists, the callback will return the property and current value. If it does not exist, the property will be created, and the value will be an empty string upon return.
chat.requestSharedProperty(myGlobe,isSpinning);

setSharedProperty(str objectName, str propertyName, str Value)

Use this method to set the shared property value. This method must be called only after objectName and propertyName are known to exist.
chat.setSharedProperty(myGlobe,isSpinning, true);

Callbacks
lterInput(textInput)

When you type text into the local chat line and then press the Enter key, the string from the chat line is rst passed through this method (if present) before being sent to the chat server. This method can be present in a script attached to your Avatar, or be present in a script which is attached to a world you created. Used in the latter manner, as the world designer you can lter out words for everyone who is visiting your world. It must return true if the input has been captured, and false if the input should be passed on to the chat server.
chat.lterInput = function(msg) { if (msg.match(/^PING!/)) { chat.print(PONG!); return true; //Dont send the PING! on to the server. } else { return false; //Otherwise, let the message pass. } }

ADOBE ATMOSPHERE 257 User Guide

lterOutput(textOutput)

This method is used by your Remote Avatar, which is running on someone elses computer. When you type a message into your chat line and press Enter, the message is sent to the server, and the server in turn sends the message to all the visitors in the world (including you, the original sender). Before your message is placed into the chat window on someone elses computer, it is passed through this chat.lterOutput method, which is running for your Avatar on their computer. The returned string is what will actually be printed to their chat window, or no message will be printed at all if the return value is an empty string or false.
chat.lterOutput = function(msg) { // If the message string contains MyCoolWave, trigger my // remote avatar to wave, and strip the MyCoolWave text // out of the message before sending it to the chat if (msg.match(/MyCoolWave/)) { doWave(); // Run my wave msg = msg.replace(/MyCoolWave/, ); // Strip out MyCoolWave } return msg; }

onConnect( )

A callback which is processed when server connection is established. Call createSharedObject() in this function to establish the objects that will be synchronized. Note that timing limitations exit for script processing, and attempting to induce extensive server callbacks may fail.
chat.onConnect = function() { chat.createSharedObject(myGlobe); }

onSharedPropertyChange(str objectName, str propertyName, str Value)

This is the main callback which occurs when any visitor updates a property value for any shared object.
chat.onSharedPropertyChange = function(objName, objProp, objValue) { ... }

Math
Rotation
A Rotation object encodes an arbitrary relative geometric rotation. Most objects use a Rotation to specify their orientation (a rotation relative to the parent or world coordinate frame). A number of methods are provided to make combining and manipulating Rotations simpler, without regard to their underlying implementation. (Rotations are

258

APPENDIX E

equivalent to orthonormal 3x3 matrices and are stored internally as quaternions. This allows them to be smoothly interpolated or blended to give intermediate rotations.) For objects in the scene, a pivot point is assigned at object creation which is used for rotation purposes. This point is not revealed in the interface currently, and will vary based upon numerous variables such as the use of scale and translate tools. Therefore, do not rely on the object pivot being in a known location. Instead, use an anchor in world space to act as the pivot. An example of this approach can be seen in the rotateContinous preset script included with the Atmosphere application. Lastly, rotation measured for objects in an Atmosphere scene are in the units of Radians (where a complete circle = pi * 2). Global Methods
Rotation(various...)

Creates a new Rotation(rotational transformation object). The following parameter styles are understood: Rotation() - The identity Rotation(no rotation at all) Rotation(X, .7) - Rotate by .7 radians around X. Rotation(Y, .3) - Rotate by .3 radians around Y. Rotation(Z, .9) - Rotate by .9 radians around Z. Rotation(XZY, .7, .9, .3) - Rotate around Y by .3, Z by .9, then X by .7 (Rotations are processed from right to left.) Rotation(vec, angle) - Rotate around Vector vec by angle radians. Rotation(r1, r2) - Rotate by Rotation r2, then by Rotation r1 (think r1 of r2) Rotation(X, .7, r2) - Rotate by Rotation r2, then around X by .7 Rotation(r1.toString()) - decoding from an encoded string. Rotation(r1, r2.toString(), X, .7, ...) - Any number of concatenations are allowed.
critter.orientation = Rotation(Y, critter.yRotation);

Properties
inverse

The inverse (opposite) of the rotation.


// Relative rotation from a to b rel = Rotation(b, a.inverse);

type

Returns the type of object as a string (Rotation).


tempObject = Rotation(X, .7); chat.print(tempObject.type); //Returns Rotation

ADOBE ATMOSPHERE 259 User Guide

Methods
blend(b, fraction)

Returns a rotation that is the interpolation between a and b according to the specied fraction (0..1)
// 10% of the way from a to b c = a.blend(b, .1);

map(vec)

Returns a Vector that results from rotating vec by this Rotation


forward = orientation.map(Vector(0.0, 0.0, -1.0));

mapAxis(axis)

Returns the specied axis(0, 1, 2 == x, y, z) rotated by this Rotation


forward = orientation.mapAxis(2).negate();

power(pow)

Raises the Rotation to the specied power


// b rotates 2.5 times as far as a. b = a.power(2.5);

toString()

Returns the Rotation encoded as a string. This provides a way in which rotation information can be sent over the chat line to another visitor in the same world. The receiving visitor can then decode the rotation using this approach: box.rotation = Rotation(newRotation.toString())
newRotation = currentRotation.toString()

Transform
A Transform is a geometric transformation composed of an arbitrary rotation followed by a translation. Most objects use a Transform to specify their location and orientation. Various methods are provided to make manipulation of Transforms straightforward, without regard to the underlying representation. (A Transform is equivalent to a constrained 3x4 linear transformation matrix with an orthonormal 3x3 rotational sub-matrix. It is actually stored internally as a quaternion and a translation. Due to this, its useful to note that using chat.print(transform) for debugging purposes will return an array of 6 values. This format, however, cannot be used for setting a Transform, but is useful only for observing the results of an operation.) Global Methods
Transform(various...)

Creates a new Transform(spatial transformation object). The following parameter styles are understood: Transform() - The identity transformation (no rotation or translation) Transform(translateVec) - Translate by the given Vector

260

APPENDIX E

Transform(rotor) - Rotate by the given Rotation Transform(translateVec, rotor) - a translation of a rotation Transform(tfm1, tfm2) - tfm1 of tfm2 (apply tfm2, then tfm1) Transform(trans1, tfm2, rot3, tfm4, ...) - Any number of concatenations are allowed. In this manner, multiple iterations of transforms are not in absolute coordinates, but are added relatively Transform(t1.toString()) - decoding from an encoded string.
critter.transform = Transform(critterSpot, Rotation(Y, critter.yRotation));

Properties
inverse

The inverse (opposite) of the transform.


// Relative transformation from a to b rel = Transform(b, a.inverse);

rotation

The rotational component (Rotation) of the Transform.


// Normals only rotate. newNorm = tfm.rotation.map(oldNorm);

translation

The translational component (Vector) of the Transform.


shadowPosition = tfm.translation.change(1.0, 0.0);

Methods
blend(Transform b, oat fraction)

Returns a Transform interpolated the specied fraction (0.0 to 1.0) from a to b.


// 10% of the way from a to b c = a.blend(b, 0.1);

map(vec)

Returns Vector vec rotated and translated by this Transform.


forward = orientation.map(Vector(0.0, 0.0, -1.0));

power(pow)

Raises the Transform to the specied power.


// b transforms 2.5 times as far as a. b = a.power(2.5);

toString()

Returns the Transform encoded as a string. This provides a way in which transform information can be sent over the chat line to another visitor in the same world. The receiving visitor can then decode the transform using this

ADOBE ATMOSPHERE 261 User Guide

approach: box.transform = Transform(newTransform.toString())


newTransform = currentTransform.toString()

Vector
Vectors specify geometric x, y, z offsets. Most objects use Vectors to specify their location (relative to the origin <0, 0, 0>). Many methods are provided for combining and manipulating Vectors without the need to refer to the x, y, z components directly. Global Methods
Vector(various...)

Creates a new Vector (direction or position object). The following parameter styles are understood: Vector() - The zero vector <0.0, 0.0, 0.0> Vector(x, y, z) - The vector <x,y,z> Vector([x, y, z]) - The vector <x, y, z> Vector(v.toString()) - decoding from a string-encoded Vector Also note that anywhere a Vector is accepted as a parameter, an Array of three numbers, [x, y, z] or [r, g, b], will generally also be understood. (The exception is that you cannot dispatch Vector methods this way, so v = Vector(1, 2, 3).add([4, 5, 6]); is valid, but v = [1, 2, 3].add([4, 5, 6]); is not.)
critter.position = Vector(5.0, oorHeight, 17.0);

Properties
[n]

[0..2] return the x, y, z or r, g, b components (read only)


verticalSpeed = velocity[1]; fogBlue = fog.color[2];

x, y, z

Returns the x, y, or z component (read only)


verticalSpeed = velocity.y;

r, g, b

Returns the r, g, or b component (read only)


fogRed = fog.color.r;

length

The length of the vector.

262

APPENDIX E

if (a.subtract(b).length < minDistance) { ... }

negated

The negative (opposite direction) of the vector.


b = a.negated;

normalized

The normalized (length == 1) version of the vector.


b = a.normalized;

Methods
add(B)

Returns the sum of this Vector with Vector B


position = position.add(moveVec);

subtract(Vector)

Returns this Vector minus Vector B


hereToThere = there.subtract(here);

change(index, value)

Returns a new vector with the specied element (0 < index <= 2) changed. It is not possible to modify a component directly except using this method.
// Set y = oorHeight. shadowPlace = position.change(1, oorHeight);

scale(s)

Returns a scaled vector, such that a.scale(s).length() == a.length()*s


moveVec = velocity.scale(deltaTime);

same(B)

Returns true if this Vector is equal to Vector B


if (!newPosition.same(oldPosition)) { ... }

dot(B)

Returns the dot product of this Vector with Vector B. (The dot product of vectors A and B is by denition the cosine of the angle between A and B, times the lengths of both A and B.)
aimQuality = aimVec.dot(targetPosition.subtract(myPosition).normalize())

cross(B)

Returns the cross product of this Vector with Vector B. (The cross product of vectors A and B is by denition a new vector, C, perpendicular to both A and B, whos length is the sine of the angle between A and B, times the

ADOBE ATMOSPHERE 263 User Guide

lengths of both A and B. The direction of C can be determined by the right hand rule: curl the ngers of your right hand in the direction from A to B, then your thumb points in the direction of C.)
upVec = rightVec.cross(forwardVec);

addScaled(B, scale)

Returns the sum of this Vector with a scaled version of Vector B.


// Same as c = a.add(b.scale(.3)); but faster c = a.addScaled(b, .3);

blend(B, fraction)

Returns a Vector interpolated the specied fraction from this Vector to Vector B.
// 50% blend gives average. midPoint = minPoint.blend(maxPoint, .5);

Returns the Vector encoded as a string. This provides a way in which vector information can be sent over the chat line to another visitor in the same world. The receiving visitor can then decode the vector using this approach: tempVector = Vector(newVector.toString())
newVector = currentVector.toString()

Effects
Fog
The fog effect causes your world to be lled with a mist that obscures objects based on their distance from the user. The near and far properties determine the range of this transition and the dropOff property controls the rate of change within that range. For highly complex large worlds, using fog will improve rendering performance, since geometry beyond the far fog distance is efciently culled from the rendering process. An alternative use of fog is to approximate the appearance of localized lighting around the user, by using a fog color of black. Global Properties
fog

This is the global fog effect for the current world.


// Display current fog settings dump(fog);

Properties
active

Species whether the fog is active.

264

APPENDIX E

fog.active = true;

color

The color Vector of the fog.


// Bluish fog fog.color = [.8, .8, 1];

dropOff

The fog drop-off style (0=hard; 1=linear; 2=1/Z-squared).


// Linear style fog.dropOff = 1;

far

The distance at which objects are completely obscured by the fog.


fog.far = 100;

near

The distance at which the fog starts.


fog.near = 10;

Glare
The glare effect creates a diffuse glow over and around an object in the Explorer view if the object was marked with emits light in the Builder. It creates the impression that the light sources are very bright, causing optical effects within the virtual camera that approximate lens are or glare in a real-world camera. This will work for constant color and texture mapped light sources. Global Properties
glareEffect

Represents the glare SceneGroup for the camera.


// Display current glare settings dump(glare);

Properties
active

Species whether the glare effect is active (default is false)


glareEffect.active = true;

brightness

Controls the visible brightness of the glare, which also reects the color of the glare and the color of the light object. The default brightness value is 1.0, with a range limitation of 0.0 to 2.0. Changing the brightness value does not slow down rendering, allowing for animated brightness effects such as pulsating glare.

ADOBE ATMOSPHERE 265 User Guide


glareEffect.brightness = 1.0;

color

An array of three oats representing the scales of the color of the glare in RGB values. The default color scale is a [1.0, 1.0, 1.0]. Please note that changing the color values every frame (such as in a timestep function) is not recommended. Changing the color causes the recomputation of internal data, and slows down rendering performance. However, changing values once at initial load time (or changing it based upon an event) is reasonable.
glareEffect.color = [0.5, 0.7, 1.0];

nonlinearity

The degree of non-linear remapping of the color values. Nonlinearity determines how the glare is combined with the rendered background. A very small value produces a linear response, but can too easily reach the maximum pixel level with a bright background. A high value of non-linearity tends to make the glare more smoothly varying without obvious clamping. The default value is 0.5. Please note that changing the value of nonlinearity every frame (such as in a timestep function) is not recommended. Changing the nonlinearity causes the recomputation of internal data, and slows down rendering performance. However, changing the value once at initial load time (or changing it based upon an event) is reasonable.
glareEffect.nonlinearity = 0.5;

radius

Glare size in screen pixels. The available range for radius is 16 to 64. The current implementation only works accurately for radius values that are multiples of 8.
glareEffect.radius = 16;

Sound
The Sound module enables a script to add sounds to the world. The sounds can be positional (localized), or ambient (uniformly everywhere). They can be started or stopped at any time, and may be set to play once, some number of successive repetitions, or to loop indenitely. Presently, the le formats supported for sound are: WAV, MP3, and CEL) When you use a script to specify a sound le, the Atmosphere application will keep track of the les for you. During publish, any referenced les in your script will be copied and included with the world le, and the le reference will be updated to match the sound le location. Global Methods
Sound(url)

Creates a new Sound in the current world from the specied URL (but does not start playing the sound).
windSound = Sound(http://myDomain.com/myHomePage/wind.wav);

266

APPENDIX E

Properties
active

Is the sound playing?


// Pause the wind windSound.active = false;

far

The distance beyond which the sound will not be audible.


windSound.far = 50.;

near

The distance within which the sound will always be at maximum value. For each additional multiple of minDistance, the sound loudness will decrease by half.
windSound.near = 2.5;

position

The absolute position vector of the sound in the world or null if the sound is ambient. When switching from ambient to positional or vice versa, you must call play() to restart the sound in the new mode.
// Wind sounds coming from outside windSound.position = window.position;

repeats

How many times should the sound repeats (0 = forever). Cannot be changed while the sound is playing.
// knockSound.play() plays knock knock knock! knockSound.repeat = 3;

URL

The URL from which the sound was created (translated to an absolute URL).
chat.print(Now playing: + windSound.URL);

volume

The (maximum) volume of the sound, from 0 to 1.


windSound.volume = .5;

Methods
play()

Plays the sound from the begining.


windSound.play();

stop()

Stops the sound from playing.

ADOBE ATMOSPHERE 267 User Guide


windSound.stop();

Event Handlers
CollisionEventHandler
A CollisionEventHandler is an object that can be used to specify what happens when two or more physical objects collide with each other. Numerous CollisionEventHandlers can be created, each specifying results for a limited scope of events, set by the ltering methods shown below. A CollisionEventHandler has an onCollision method, which is where the actions are dened forthe results of an event (what you want to do when a collision happens). By default, a CollisionEventHandler handles all events in a world. Use the local lter methods shown below to limit event handling to specic physical models. [Note: The Player object itself should not be specied as one of the physical models when ltering events. This is because the Player object is changed during initial world load, and will also be changed if the user changes avatars. To lter for Player events only, see the code example below for the rst property.] Global Methods
CollisionEventHandler()

Creates a new CollisionEventHandler (which possesses onCollision and ltering methods).


boxEvents = CollisionEventHandler();

Local Callbacks
onCollision(PhysicalModelA, PhysicalModelB, normalRelativeVelocity)

A method which denes what will happen when a collision occurs. The two physical models involved in the collision are returned, as well as the normalized relative velocity between the SceneGroups. The velocity may be used to provide scale for actions, such as changing the volume of a sound.
boxEvents.onCollision = function(physicalModelA, physicalModelB, normalRelativeVelocity) { if ( (physicalModelA.getParent() == player) || (physicalModelB.getParent() == player) ) { chat.print(This collision involved the Player!); } }

Local Methods
setFilterNoPhysicalModel()

Species that the collision event handler should respond to all collisions between all physical models (that is, do not limit the event handler to any specic SceneGroups).

268

APPENDIX E

boxEvents.setFilterNoPhysicalModel();

setFilterPhysicalModel(PhysicalModel)

Species that the collision event handler should respond to all collisions for a single physical model.
boxEvents.setFilterPhysicalModel(boxPhysicalModel);

setFilterPhysicalModels(PhysicalModel, PhysicalModel)

Species that the collision event handler should be limited to collisions between two physical models.
boxEvents.setFilterPhysicalModel(boxPhysicalModel, conePhysicalModel);

KeyEventHandler
A KeyEventHandler allows the developer to specify a response when the user presses a key while the focus is on the rendered window. The recognized key events include keyDown, keyUp, and a catch-all lter which recognizes all key events. The KeyEventHandler object is more simplied than the MouseEventHandler. Three ltering methods exist which specify the type of event to which the handler should respond, and the lters do not require that you pass an object to the method. The setFilterOnKeyDown() method will cause the handler to respond only when a key is pressed, and setFilterOnKeyUp() will cause a response only when a key is released. The setFilterEvent() method will respond to all key events. When a key event occurs, Atmosphere searches the list of user created KeyEventHandlers(with their Filtering Methods) to determine if the .OnEvent(keyEvent) callback should be triggered. If triggered, the event object which is returned possesses numerous properties about the key event. Two likely approaches may be used to respond to key events: Create two event handlers, one which uses the setFilterOnKeyDown() method and the other which uses setFilterOnKeyUp(). When the user presses a key, you may respond differently depending upon which key was pressed or released. Check the keyEvent returned to determine which key caused the event. A table is provided below which shows the conversion of key codes to common key names. Create only a one event handler which uses the setFilterEvent() method, and test event in the same manner as above to determine the key used. Your specic application will determine the best approach for you. Global Methods
KeyEventHandler()

Creates a new KeyEventHandler which may be set to process all key events(default), or be limited to down or up events only.
// create a new handler myEventHandler = KeyEventHandler();

ADOBE ATMOSPHERE 269 User Guide

Local Callbacks
onEvent(keyEvent)

A method which denes what will happen when a key event occurs. A KeyEvent object is returned which possesses the key code for the key pressed, as well as several other properties.
myEventHandler = KeyEventHandler(); myEventHandler.setFilterOnKeyDown(); myEventHandler.onEvent = function(keyEvent) { chat.print(Key Code = + keyEvent.keyCode); }

The additional keyEvent properties are as follows:


keyCode KeyDown metaKey1Down metaKey2Down metaKey3Down metaKey4Down // // // // // // the numeric value of the key pressed (see table below) true for key down event, and false for key up true if Shift key was also held down during key event true if Ctrl key was also held down during key event (currently not used) (currently not used)

See the description for KeyEvent below for more details. Local Methods By default, a KeyEventHandler responds to all key events. Filtering Methods are therefore provided below to limit the scope of key events and allow customized responses.
setFilterEvent()

Causes the handler to respond to all keyboard events.


myEventHandler = KeyEventHandler(); myEventHandler.setFilterEvent(); myEventHandler.onEvent = function(keyEvent) { chat.print(Key Code = + keyEvent.keyCode); }

setFilterOnKeyDown()

Causes the handler to respond to all key down events only.


myEventHandler = KeyEventHandler(); myEventHandler.setFilterOnKeyDown(); myEventHandler.onEvent = function(keyEvent) { chat.print(Key down key code = + keyEvent.keyCode); }

setFilterOnKeyUp()

Causes the handler to respond to all key up events only.

270

APPENDIX E

myEventHandler = KeyEventHandler(); myEventHandler.setFilterOnKeyUp(); myEventHandler.onEvent = function(keyEvent) { chat.print(Key up key code = + keyEvent.keyCode); }

KeyEvent
A KeyEvent is not an object that you can modify. Rather, it is an object that is returned in the KeyEventHandler. onEvent(KeyEvent, what) callback. When you create a new KeyEventHandler(), you assign a ltering method to specify the events to which the handler should respond. For example, MyKeyEventHandler.setFilterOnKeyDown() instructs this handler to respond only when the user presses a key while the focus is on the rendered window. Following the click, the handler responds by triggering the MyKeyEventHandler.onEvent(KeyEvent) callback function, and processes the code you have written for this function. The KeyEvent described below is returned as an object, and possesses possesses the key code for the key pressed, as well as several other properties. Properties
keycode

the numeric value of the key pressed (see table below)


keydown

true for key down event, and false for key up


metaKey1Down

true if SHIFT key was also held down during key event
metaKey2Down

true if CTRL key was also held down during key event
metaKey3Down

(currently not used)


metaKey4Down

(currently not used)

ADOBE ATMOSPHERE 271 User Guide

Key Code Table The key code returned by the KeyEvent object is identical to what is returned by Internet Explorer. If you are familiar with key codes and their matching common names for Internet Explorer, the response by Atmosphere will more easily understood. It should be noted that both Atmosphere and Internet Explorer have a limitation when returning key codes: upper and lower case are not differentiated. Therefore, the key code returned for any key will be the same regardless of whether the shift key is also held down. Due to this, shift key position must be also be tested if it is desirable to take case into account. For your convenience, the table below shows key codes matched to the common key names when your regional settings are set to English (United States).
Code 8 9 13 16 17 18 19 20 27 32 33 34 35 36 37 38 39 40 45 46 48 49 50 51 52 53 54 55 56 57 Name Backspace Tab Return Shift Control Alt Pause Caps Lock Esc Space Bar Page Up Page Down End Home Left Arrow Up Arrow Right Arrow Down Arrow Insert Delete 0 1 2 3 4 5 6 7 8 9 Code 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 Name A B C D E F G H I J K L M N O P Q R S T U V W X Y Z Left Window Key Right Window Key Code 96 97 98 99 100 101 102 103 104 105 106 107 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 135 Name Num Pad 0 Num Pad 1 Num Pad 2 Num Pad 3 Num Pad 4 Num Pad 5 Num Pad 6 Num Pad 7 Num Pad 8 Num Pad 9 Num Pad Multiply * Num Pad Add + Num Pad Subtract Num Pad Decimal . Num Pad Divide / F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 F13 F24 Code 144 145 186 187 188 189 190 191 192 219 220 221 222 Name Num Lock Scroll Lock Semicolon ; Equal = Comma , Hyphen Period . Slash \ Left Quote ` Left Bracket [ Virgule / Right Bracket ] Single Quote

272

APPENDIX E

MouseEventHandler
A MouseEventHandler allows the developer to specify a response when the user performs a mouse event in the rendered window. The recognized mouse events include Click, Over, Out, and Move (which can be combined to also create mouse Drag). A new MouseEventHandler() object should be created for each type of mouse event to which you desire to respond. The event responses are separated by designating different Filtering Methods as their names indicate (shown below). The Filtering Methods are also used to specify or limit the scope of world objects which will trigger the MouseEventHandler response. When a mouse event occurs, Atmosphere searches the list of user created MouseEventHandlers(with their Filtering Methods) to determine if the .OnEvent(event, what) callback should be triggered. If triggered, the event object which is returned as the rst argument possesses numerous properties about the mouse event. The second argument what contains a reference to the world object that was under the mouse during the event. Two likely approaches may be used to respond to mouse events: Create only a few event handlers(one for each type), and test the what object that is returned to customize the response based upon the object clicked. A switch - case statement would be useful for this type of approach. Create many custom event handlers with a single object specied in the Filtering Method. Both of these approaches have their advantages, and your specic application will determine whats best for you. Lastly, information on how various world objects respond to mouse events is shown below in the Local Methods section. Global Methods
MouseEventHandler()

Creates a new MouseEventHandler which may be set to process all mouse events(default), or be limited to a specic primitive, viewpoint object, or physical model.
// specify that the main world geometry, or stage will receive click events myEventHandler = MouseEventHandler(); myEventHandler.setFilterOnClick(stageModel.getSolidObject(0)); myEventHandler.onEvent = function(mouseEvent, what) { chat.print(Object = + what); }

Local Callbacks
onEvent(mouseEvent, what)

A method which denes what will happen when a mouse event occurs. A mouseEvent object is returned which possesses numerous properties, and the object under the mouse is returned as the second argument what.
myEventHandler = MouseEventHandler(); myEventHandler.setFilterOnClick(stageModel.getSolidObject(0));

ADOBE ATMOSPHERE 273 User Guide


myEventHandler.onEvent = function(mouseEvent, what) { chat.print(Object = + what); dump(mouseEvent); }

If the above onEvent function is called as shown, a dump of the mouseEvent will return the following properties, which can in turn be used to control other logic for the event:
buttonLeftDown buttonMiddleDown buttonRightDown clickDown clickEvent clickUp metaKey1Down metaKey2Down metaKey3Down metaKey4Down x y // // // // // // // // // // true or false state of the left mouse button true or false state of the middle mouse button (currently always false) true for mouse down event, and false for mouse up acts as a type identier, and returns true for all click events true for mouse up event, and false for mouse down true if Shift key was also held down during click event true if Ctrl key was also held down during click event (currently not used) (currently not used)

// the x-axis pixel position of the mouse during the click event // the y-axis pixel position of the mouse during the click event

Local Methods By default, a MouseEventHandler responds to all mouse events. While this seems advantageous initially, all mouse move events are processed and can quickly become cumbersome. Filtering Methods are therefore provided below to limit the scope of mouse events and allow customized responses. The methods require that an object be specied, and this object will be used to determine if the OnEvent() callback should be triggered. Shown here is a list of object types and their scope during mouse event processing: All world geometry will respond to mouse events. Primitives should be named in the Builder application so that customized responses can be created. The stageModel represents the parent geometry in the world, and will respond to all mouse events if it specied as the lter object. Note that the sky does not respond to mouse events when the stageModel is used as the object. Any portion of a loaded SceneGroup will respond to mouse events, if the top level SceneGroup is referenced as the lter object. The scope can be reduced further by naming primitives in the loaded SceneGroup. Viewpoint objects which are imported into the stage or which are loaded as part of a submodel will respond to mouse events. The entire Viewpoint object is used, and cannot be limited to specic instance components.
setFilterOnClick(object)

Causes the specied object (Primitive, Viewpoint Object, or SceneGroup) to return an OnClick mouse event.
chair = theStage.getPrimitive(chair); myEventHandler.setFilterOnClick(chair);

274

APPENDIX E

setFilterOnMouseOver(object)

Causes the specied object (Primitive, Viewpoint Object, or SceneGroup) to return an OnMouseOver mouse event.
chair = theStage.getPrimitive(chair); myEventHandler.setFilterOnMouseOver(chair);

setFilterOnMouseMove(object)

Causes the specied object (Primitive, Viewpoint Object, or SceneGroup) to return an OnMouseMove mouse event.
chair = theStage.getPrimitive(chair); myEventHandler.setFilterOnMouseMove(chair);

setFilterOnMouseOut(object)

Causes the specied object (Primitive, Viewpoint Object, or SceneGroup) to return an OnMouseOut mouse event.
chair = theStage.getPrimitive(chair); myEventHandler.setFilterOnMouseOut(chair);

setFilterEvent()

Species that no events should be ltered, and all user mouse events (click, over, out, move) should return the event object inclusive with all its properties. Note that using this method will cause the second argument of the onEvent callback to return undened.
myEventHandler.setFilterEvent();

Copyright 2002 Adobe Systems Incorporated. All rights reserved.

MouseEvent
A MouseEvent is not an object that you can modify. Rather, it is an object that is returned as the rst argument of the MouseEventHandler.onEvent(mouseEvent, what) callback. When you create a new MouseEventHandler(), you assign a ltering method to specify the events to which the handler should respond. For example, MyMouseEventHandler.setFilterOnClick(box) instructs this handler to respond only when the user clicks on the box (a world object, found in Javascript, and assigned the variable name box). Following the click, the handler responds by triggering the MyMouseEventHandler.onEvent(mouseEvent, what) callback function, and processes the code you have written for this function. The mouseEvent described below is returned as the rst argument of this function, and the object under the mouse during the event is returned as the second argument, what.

ADOBE ATMOSPHERE 275 User Guide

Local Callbacks
onEvent(mouseEvent, what)

A method which denes what will happen when the mouse event occurs. An event object is returned which possesses numerous properties, and the object under the mouse is returned as the second argument.
myEventHandler = MouseEventHandler(); myEventHandler.setFilterOnClick(stageModel); myEventHandler.onEvent = function(mouseEvent, what) { chat.print(Object = + what); dump(mouseEvent); }

If the above onEvent function is called as shown, a dump of the mouseEvent will return the following properties, which can in turn be used to control other logic for the event:
buttonLeftDown buttonMiddleDown buttonRightDown clickDown clickEvent clickUp metaKey1Down metaKey2Down metaKey3Down metaKey4Down x y // // // // // // // // // // true or false state of the left mouse button true or false state of the middle mouse button (currently always false) true for mouse down event, and false for mouse up acts as a type identier, and returns true for all click events true for mouse up event, and false for mouse down true if Shift key was also held down during click event true if Ctrl key was also held down during click event (currently not used) (currently not used)

// the x-axis pixel position of the mouse during the click event // the y-axis pixel position of the mouse during the click event

OverlapEventHandler
An OverlapEventHandler is an object that can be used to specify what happens when two or more physical objects overlap each other. Numerous OverlapEventHandlers can be created, each specifying results for a limited scope of events (set by the ltering methods shown below). An OverlapEventHandler has onEnter and onLeave methods, which is where the actions are dened forthe results of either event. By default, an OverlapEventHandler handles all events in a world. Use the local lter methods shown below tolimit event handling to specic physical models. Note: Enabling an OverlapEventHandler() for a specic physical model will also disable collision with that physical model; the two are mutually exclusive. It is not possible to collide with and object and also intersect with it at the same time. Global Methods
OverlapEventHandler()

Creates a new OverlapEventHandler (which possesses onEnter, onLeave, and ltering methods).

276

APPENDIX E

buildingOverlap = OverlapEventHandler();

Local Callbacks
onEnter(PhysicalModelA, PhysicalModelB)

A method which denes what will happen when an overlap initially occurs. The two physical models involved in the overlap are also returned. These values can be tested for parent or type, and customized actions performed based upon the results.
buildingOverlap.onEnter = function(physicalModelA, physicalModelB) { if ( physicalModelA.getParent().type == Player || physicalModelB.getParent().type == Player ) { chat.print(The Player has entered the building.); } }

onLeave(PhysicalModelA, PhysicalModelB)

Similar to above, a method which denes what will happen when an overlap is discontinued. The two physical models that were involved in the overlap are also returned. These values can be tested for parent or type, and customized actions performed based upon the results.
buildingOverlap.onLeave = function(physicalModelA, physicalModelB) { if ( physicalModelA.getParent().type == Player || physicalModelB.getParent().type == Player ) { chat.print(The Player has left the building.); } }

Local Methods
setFilterNoPhysicalModel()

Species that the overlap event handler should respond to all overlaps between all physical models (that is, do not limit the event handler to any specic SceneGroups).
buildingOverlap.setFilterNoPhysicalModel();

setFilterPhysicalModel(PhysicalModel)

Species that the overlap event handler should respond to all overlaps for a single physical model.
buildingOverlap.setFilterPhysicalModel(boxPhysicalModel);

setFilterPhysicalModels(PhysicalModel, PhysicalModel)

Species that the overlap event handler should be limited to overlaps between two physical models.
buildingOverlap.setFilterPhysicalModel(boxPhysicalModel, conePhysicalModel);

ADOBE ATMOSPHERE 277 User Guide

Copyright 2002 Adobe Systems Incorporated. All rights reserved.

Scene Objects
Actor
The Actor module is used to represent the user of the application as they navigate the 3-D world. It has a position and orientation that is changed as the user moves. It corresponds the position of the users avatar as seen by other people (and by the user in third person view). The actor also includes properties that control the motion of the user. These include world-relative and screen-relative velocities, ags for enabling and disabling gravity and collisions, ags to disable the default navigation scheme and functions for setting and retrieving the orientation of the user. The user orientation is unusual in that it consists of two parts, a body orientation, which is contrained to only rotate about the Y axis, and the head orientation that includes rotation angles at the neck. The default user interface controls both. The body orientation is used to control rotations about Y, and to rotate the displayed avatar, while the head orientation determines the orientation of the camera in rst person view. See the Camera module for more information. If you desire to move the Actor for any purpose, it is best to use the function setPositionAvoidingCollisions(Ve ctor). This function will account for other objects present at the desired location, and cause the physics engine to momentarily turn off collisions while the function attempts to move the Actor to the desired position. These precautions prevent erratic behavior due to unforseen collisions which may be present. Note that if the Avatar is bigger than the available space at the destination, the avatar may fall through the oor (and continue falling if gravity is on). Be sure to leave sufcient height for large Avatars under these conditions. Global Properties
theActor

The global object representing the person navigating.


dump(theActor); // Display the users properties

Properties
type

The objects type. Returns theActor.


if (foo.type == theActor) { ... }

avatarURL

The URL of the Actors current actual avatar. Note that if the user selects a new avatar, theActor.avatarURL will not update until the new avatar is actually loaded and in use. Similarly, when a user rst enters a world or launches the Browser, theActor.avatarURL will remain undened until their avatar has loaded. This value is readonly.

278

APPENDIX E

chat.print(Current avatar = + theActor.avatarURL);

showAvatar

A ag that determines whether the avatar is rendered.


// Hide the avatar theActor.showAvatar = false;

position

the position as a Vector object


theActor.position = Vector(10, 5, -25);

transform

the Transform representing the combined position and orientation.


theActor.transform = entryPoint.transform;

worldSpacePosition

The worldSpacePosition of the object as a Vector.


// set the worldSpacePosition of the object to a known anchor myObject.worldSpacePosition = myAnchor3.worldSpacePosition;

worldSpaceTransform

The worldSpaceTransform is the combined worldSpacePosition and worldSpaceOrientation of the object.


// set the worldSpaceTransform of the object to a known anchor myObject.worldSpaceTransform = myAnchor3.worldSpaceTransform;

facing

a Vector pointing the direction the Actor is facing


function moveActorForward(direction, distance) { actor.position = theActor.position.addScaled(actor.facing, dist); }

worldSpaceFacing

a Vector pointing the direction the Actor is facing, in world space coordinates.
function moveActorForward(direction, distance) { actor.position = theActor.position.addScaled(actor.worldSpaceFacing, dist); }

bodyYaw

The rotation angle about the Y axis in radians.


angle = theActor.bodyYaw;

headPitch

The pitch or tilt of the head relative to the body in radians.

ADOBE ATMOSPHERE 279 User Guide


pitchAngle = theActor.headPitch;

velocity

the Actors velocity Vector in the World coordinate frame


theActor.velocity = Vector(0, 10, 10); // Jump up and forward

acceleration

An acceleration vector which is applied to the Actor.


// Apply an acceleration in the X direction (continuous). theActor.acceleration = Vector(20, 0, 0);

worldSpaceVelocity

the Actors velocity Vector in the World coordinate frame.


theActor.worldSpaceVelocity = Vector(0, 10, 10); // Jump up and forward

worldSpaceAcceleration

An acceleration vector which is applied to the Actor (in world space coordinates).
// Apply an acceleration in the X direction (continuous). theActor.worldSpaceAcceleration = Vector(20, 0, 0);

bodySpaceVelocity

A vector that represents the velocity of the actor relative to the world.
if (theActor.bodySpaceVelocity.length > 20) { chat.print(The actor is moving fast.); }

targetVelocity

A velocity that the actor tries to match when at rest. This may be set to non-zero when trying to track a moving object.
theActor.targetVelocity = Vector(0.0, 0.0, 1.0);

targetWorldSpaceVelocity

A velocity that the actor tries to match when at rest, in world space coordinates. This may be set to non-zero when trying to track a moving object.
theActor.targetWorldSpaceVelocity = Vector(0.0, 0.0, 1.0);

forwardSpeed

the Actors forward velocity, facing the Actors current direction for this rendered frame
theActor.forwardSpeed += 20; // Jump straight forward

lateralSpeed

the Actors lateral velocity, facing the Actors current direction for this rendered frame
theActor.lateralSpeed += 20; // Jump straight to the right

280

APPENDIX E

verticalSpeed

the Actors vertical velocity, facing the Actors current direction for this rendered frame
theActor.verticalSpeed += 20; // Jump straight up

enableVerticalThrusters

If enableVerticalThrusters is set to true, then holding down the shift key while using the up-arrow key reverses the direction of gravity. If gravity is off then the up and down arrows affect the actors vertical velocity.
theActor.enableVerticalThrusters = true;

gravity

Gravity for theActor is now exposed as a single scalar acceleration value in feet per second, per second (default = 32). This acceleration is applied in the Y direction of world space coordinates. Gravity will not be applied if the user has disabled gravity in the user preferences (located on the right-click context menu). Lastly, gravity may be forced on for your world using the boolean properties described further below.
// Reduce gravity for this particular world. theActor.gravity = 16;

forcedCollideSetting

If ignoreCollidePreference is set to true, the value of forcedCollideSetting determines whether collisions are enabled
// To force collisions to be on, // independent of the control panel setting: theActor.ignoreCollidePreference = true; theActor.forcedCollideSetting = true; // To force collisions to be off // independent of the control panel setting: theActor.ignoreCollidePreference = true; theActor.forcedCollideSetting = false;

ignoreCollidePreference

If set true, this overrides the users collide preference and enables collisions based on the value of forcedCollideSetting.
// To use the collide preference from the control panel: theActor.ignoreCollidePreference = false; // To force collisions to be on, // independent of the control panel setting: theActor.ignoreCollidePreference = true; theActor.forcedCollideSetting = true; // To force collisions to be off, // independent of the control panel setting: theActor.ignoreCollidePreference = true; theActor.forcedCollideSetting = false;

ADOBE ATMOSPHERE 281 User Guide

forcedGravitySetting

If ignoreGravityPreference is set to true, the value of forcedGravitySetting determines whether gravity is enabled
// To force gravity to be on, // independent of the control panel setting: theActor.ignoreGravityPreference = true; theActor.forcedGravitySetting = true; // To force gravity to be off, // independent of the control panel setting: theActor.ignoreGravityPreference = true; theActor.forcedGravitySetting = false;

ignoreGravityPreference

If set true, this overrides the users gravity preference and enables gravity based on the value of forcedGravitySetting
// To use the gravity preference from the control panel: theActor.ignoreGravityPreference = false; // To force gravity to be on, independent of the control panel setting: theActor.ignoreGravityPreference = true; theActor.forcedGravitySetting = true; // To force gravity to be off, independent of the control panel setting: theActor.ignoreGravityPreference = true; theActor.forcedGravitySetting = false;

keyLeftRightMovesEnabled

A ag that determines whether to use the built in navigation scheme for shift+left-arrow or shift right-arrow.
// We wish to prevent such motion theActor.keyLeftRightMovesEnabled = false;

keyUpDownMovesEnabled

A ag that determines whether to use the built in navigation scheme for shift+up-arrow or shift down-arrow.
// We wish to prevent such motion theActor.keyUpDownMovesEnabled = false;

keyForwardBackwardMovesEnabled

A ag that determines whether to use the built in navigation scheme for up-arrow or down-arrow.
// We wish to prevent such motion theActor.keyUpForwardBackwardMovesEnabled = false;

keyLeftRightTurnsEnabled

A ag that determines whether to use the built in navigation scheme for left-arrow or right-arrow.
// We wish to prevent such motion theActor.keyLeftRightTurnsEnabled = false;

282

APPENDIX E

keyUpDownTurnsEnabled

A ag that determines whether to use the built in navigation scheme for ctrl+up-arrow or ctrl down-arrow.
// We wish to prevent such motion theActor.keyUpDownTurnsEnabled = false;

mouseLeftRightMovesEnabled

A ag that determines whether to use the built in navigation scheme for shift+left-arrow or shift right-arrow.
// We wish to prevent such motion theActor.mouseLeftRightMovesEnabled = false;

mouseUpDownMovesEnabled

A ag that determines whether to use the built in navigation scheme for shift+mouse-up or shift mouse-down.
// We wish to prevent such motion theActor.mouseUpDownMovesEnabled = false;

mouseForwardBackwardMovesEnabled

A ag that determines whether to use the built in navigation scheme for mouse-up or mouse-down.
// We wish to prevent such motion theActor.mouseForwardBackwardMovesEnabled = false;

mouseLeftRightTurnsEnabled

A ag that determines whether to use the built in navigation scheme for mouse-left or mouse-right or ctrl mouse-left or ctrl mouse-right.
// We wish to prevent such motion theActor.mouseLeftRightTurnsEnabled = false;

mouseUpDownTurnsEnabled

A ag that determines whether to use the built in navigation scheme for ctrl+ mouse-up or ctrl+mouse-down.
// We wish to prevent such motion theActor.mouseUpDownTurnsEnabled = false;

keyMoveInsteadOfTurn

A ag that determines whether to move instead of turn the theActor when the left-arrow or right-arrow is pressed. Default is false.
// Make the actor strafe theActor.keyMoveInsteadOfTurn = true;

Methods
dist(position)

Returns the distance between the Actor and the provided position Vector.
if (theActor.dist(frog.position) < frog.fearRadius) {

ADOBE ATMOSPHERE 283 User Guide


frog.jumpAwayFrom(theActor.position); }

moveTo(Vector position)

This method schedules an update to the position property using a smooth interpolation over the next time step period. This smooth kinematic motion is more stable when other objects collide with the current object. By the next time step the velocity and acceleration will be set to zero.
target = stageModel.getPrimitive(Target); theActor.moveTo(target.position);

transformTo(transform)

This method schedules an update to the actors orientation and position properties using a smooth interpolation over the next time step period. This smooth kinematic motion is more stable when other objects collide with the current object. By the next time step, the velocity, acceleration, angular velocity, and angular acceleration will be set to zero.
anchor = stageModel.getPrimitive(anchor); theActor.transformTo(anchor.transform);

alignHeadAndBodyTo(Rotation)

Given the Rotation, aligns the body subject to the constraint that it can only rotate around the y-axis, and aligns the head subject to the constraint that it can only rotate around a horizontal axis relative to the body.
// Given a subject, align the actor to look at it deltaPos = theActor.position.subtract(subject.position); actorRange = Math.sqrt(deltaPos.x*deltaPos.x + deltaPos.y*deltaPos.y + deltaPos.z*deltaPos.z); actorRangeXZ = Math.sqrt(deltaPos.x*deltaPos.x + deltaPos.z*deltaPos.z); actorPitch = Math.atan2(-deltaPos.y, actorRangeXZ); actorYaw = Math.atan2(deltaPos.x, deltaPos.z); targetOrientation = Rotation(YX, actorYaw, actorPitch); theActor.alignHeadAndBodyTo(targetOrientation);

getBodyOrientation()

Returns the Transform representing the actors body orientation. Note that the actors body does not tilt up and down, only rotates around the worlds y-axis.
// Calculate the actors bodys yaw bodyOrientation = theActor.getBodyOrientation().map(Vector(0,0,1)); bodyYaw = Math.atan2(bodyOrientation.z, bodyOrientation.x);

getHeadOrientation()

The Transform representing the orientation of the actors head.

284

APPENDIX E

// Places the camera six feet behind the actor offset = Vector(0.0, 0.0, 6.0); bodyRelativeOffset = theActor.getHeadOrientation().map(offset); camera.position = theActor.position.add(bodyRelativeOffset); camera.orientation = theActor.getHeadOrientation();

setPosition(Vector or x,y,z)

Places the eye position of the actor at the specied position, giving no consideration to collisions with other objects.
// Place the actor at the exact location specied. target = Vector(10.0, 0.0, 6.0); theActor.setPosition(target); // or theActor.setPosition(target.x, target.y, target.z);

getPositionAvoidingCollisions(Vector or x,y,z)

Returns a position which is as close to the desiredlocation as possible, taking into consideration the size of the current actor avatar. Modies the passed position (a vector) in the minimum x/y/z direction necessary to place the actor avatar in a location which does not collide with other objects. This call would be useful in smoothing the path of a guided tour, for example. Since avatar sizes differ, attempting to force an unknown avatar along a given path may cause numerous collisions, which in turn are constantly corrected by the collision processor, causing jitters. Using this callto customize path locations will eliminate the collisions, smoothing the experience for all.
// Find a location as close to specied target as possible, // while avoiding collisions with the oor, etc. target = anchor7.position; theActor.getPositionAvoidingCollisions(target); // or theActor.getPositionAvoidingCollisions(target.x, target.y, target.z);

setPositionAvoidingCollisions(Vector or x,y,z)

Places the eye position of the actor as close to the specied position as possible while avoiding collisions with other objects. This is useful when teleporting within a world.
// Places the actor as close to specied target as possible, // while avoiding collisions with the oor etc. target = Vector(10.0, 0.0, 6.0); theActor.setPositionAvoidingCollisions(target); // or theActor.setPositionAvoidingCollisions(target.x, target.y, target.z);

getSolidObjectCount()

Returns the solid object count for the Actors SceneGroup currently in use. This is useful for modifying avatar properties, such as dynamic lighting.
//get the actor SceneGroup geometry, and enable dynamic lighting for (i = 0; i < theActor.getSolidObjectCount(); i++)

ADOBE ATMOSPHERE 285 User Guide


{ theActor.getSolidObject(i).useDynamicLighting = true; }

getSolidObject(index)

Returns the SolidObject at the given index that is contained by the actors SceneGroup.
//print actor height compared to the world currentHeight = ( theActor.getSolidObject(0).position[1] - stageModel.getSolidObject(0).position[1] ); chat.print(Your avatar is currently this high: + currentHeight);

getViewpointObjectCount()

Returns the Viewpoint object count for the Actors SceneGroup currently in use. This is useful for modifying avatar properties, such as dynamic lighting.
for (i = 0; i < theActor.getViewpointObjectCount(); i++) { theActor.getViewpointObject(i).useDynamicLighting = true; theActor.getViewpointObject(i).addDynamicHighlights = true; }

getViewpointObject(index)

Returns the Viewpoint object specied for the actor avatar currently in use.
chat.print(actor Viewpoint object (0) name = + theActor.getViewpointObject(0).name );

Anchor
The Anchor scene element is a useful object for holding a desired position and orientation, which can then be accessed and used at a later time in the browsing experience. An Anchor has no geometric volume, which places its pivot point at the exact origin. This is useful for using an anchor to specify an axis of rotation. A series of numbered Anchors is useful for designating points along a path for use in such things as a guided tour, or to load and place an array of objects in pre-determined positions. Local Properties
type

The objects type; returns Anchor.


if (myObject.type == Anchor) { ... }

name

Returns the name of the object as assigned in the Application.


if (myObject.name == myCoolObject) { ... }

loaded

Returns true once the object has nished loading.

286

APPENDIX E

if (myObject.loaded) { ... }

parent

A reference to the parent SceneGroup containing the object


myParent = myObject.parent;

position

The position of the object as a Vector.


// set the position of the object to a known anchor myObject.position = myAnchor3.position;

orientation

The rotational orientation of the object (as a Rotation).


// set the orientation of the object to a known anchor myObject.orientation = myAnchor3.orientation;

transform

The Transform is the combined position and orientation of the object.


// set the transform of the object to a known anchor myObject.transform = myAnchor3.transform;

worldSpacePosition

The worldSpacePosition of the object as a Vector.


// set the worldSpacePosition of the object to a known anchor myObject.worldSpacePosition = myAnchor3.worldSpacePosition;

worldSpaceOrientation

The worldSpaceOrientation of the object (as a Rotation).


// set the worldSpaceOrientation of the object to a known anchor myObject.worldSpaceOrientation = myAnchor3.worldSpaceOrientation;

worldSpaceTransform

The worldSpaceTransform is the combined worldSpacePosition and worldSpaceOrientation of the object.


// set the worldSpaceTransform of the object to a known anchor myObject.worldSpaceTransform = myAnchor3.worldSpaceTransform;

Camera
The Camera module represents virtual cameras that are used to render a 2-D view from a 3-D SceneGroup. It has properties that control the projection of the camera, such as eld of view, position and orientation. There is a ag that may be used to lock the camera to the rst person view from the actor, and a ag that determines whether the avatar is visible in the image generated by the camera. (This is useful when implementing third person camera controllers.)

ADOBE ATMOSPHERE 287 User Guide

Functions are also supplied for converting pixel coordinates to rays, to ease the creation of ray-test queries. Finally, the 2D center of projection may be shifted relative to the image plane for special effects and unusual projections.
Important Note: A Javascript (PlayerInit.js) which is included with the Player product is currently modifying ve of

these properties: position, orientation, transform, lockToActor, and showAvatar. Since this Javascript provides camera control by default, and since there is currently just one camera, it may not be possible to modify these ve properties with any dependable results. Properties
type

The objects type. Returns Camera.


if (foo.type == Camera) { ... }

orientation

The rotational orientation of the Camera (as a Rotation).


// Rotate the camera to have the same // orientation as the actor camera = application.getView(0).getCamera(0); camera.orientation = theActor.orientation;

position

The position as a Vector.


// Place the camera at x=10, y=5, z=-25 in the world camera = application.getView(0).getCamera(0); camera.position = Vector(10, 5, -25);

transform

The Transform object representing the combined position and orientation of the camera.
// Smoothly animate between EntryPoints ep1 and ep2 // (including their orientations) over 100 frames: camera = application.getView(0).getCamera(0); camera.n = 0; camera.timestep = function() { this.transform = ep1.transform.blend(ep2.transform, this.n++/100); } addAnimator(camera);

eldOfView

The eld of view of the camera in degrees. Can range from 0 to 180, default is 80.
camera = application.getView(0).getCamera(0); camera.eldOfView = 100;

288

APPENDIX E

lockToActor

When true the cameras position and orientation are copied from the actors position and head orientation every time step.
// Make the camera track the actors position // and head orientation camera = application.getView(0).getCamera(0); camera.lockToActor = true;

preferenceShowMyAvatar

Returns the current state of the checkbox in the Actor preferences Show My Avatar, as well as the toggle on the toolbar. This property is read only.
if (application.preferenceShowMyAvatar) { ... }

showAvatar

Controls the third person view of the user avatar in the Actor window.
application.showAvatar = true;

Methods
dist(Vector)

Returns the distance between the supplied position and the cameras position.
camera = application.getView(0).getCamera(0); radialDistance = camera.dist(actor.position);

setPosition(Vector)

Sets the camera position to the Vector specied.


camera = application.getView(0).getCamera(0); camera.setPosition( Vector( 0, 7, 0) ); // 7 units high at the reference point

getPixelXCoordFromRayDirection(Vector rayDirection)

Returns the pixel x coordinate in the image plane for a given ray direction from the camera.
camera = application.getView(0).getCamera(0); direction = Vector(1.0, 0.0, 0.0); xValue = = camera.getPixelXCoordFromRayDirection(direction);

getPixelYCoordFromRayDirection(Vector rayDirection)

Returns the pixel y coordinate in the image plane for a given ray direction from the camera.
camera = application.getView(0).getCamera(0); direction = Vector(1.0, 0.0, 0.0); yValue = = camera.getPixelYCoordFromRayDirection(direction);

getRayDirectionFromPixelCoords(x, y)

Returns the ray direction that corresponds to the given pixel.

ADOBE ATMOSPHERE 289 User Guide


camera = application.getView(0).getCamera(0); // Find ray direction for pixel 20, 40 direction = camera.getRayDirectionFromPixelCoords(20, 40);

setOffsetsFromRayDirectionAndPixelCoords(Vector rayDirection, x, y)

Changes the xOffset and yOffset so that the given ray direction and pixel coordinates correspond in the image plane.
camera = application.getView(0).getCamera(0); direction = Vector(1, 0, 0); camera.setOffsetsFromRayDirectionAndPixelCoords(direction, 50, 60);DistantLight

DistantLight is a module that controls a distant light source for solid objects that have dynamic lighting enabled. Dynamic lighting is added to lightmaps that were computed for radiosity. Distant lights shine parallel light from innity and have a brightness and colour. The central direction for where the light comes from is determined by the direction property, whereas the cone angle determines the spread of rays around that direction. (In real life, the sun and moon, for instance, have a cone angle of approximately half a degree. Area lights may be approximated using larger cone angles.) Large cone angles illuminate more than half of a sphere, leading to softer-looking illumination. Properties
type

Returns a string value of DistantLight


light = stageModel.getDistantLight(0); chat.print(light.type);

worldSpaceDirection

The directional vector pointing towards the distant light


// Set the worldSpaceDirection of the light to point stageModel.getDistantLight(0).worldSpaceDirection = Vector(0, 1, 0);

coneAngle

The angle subtended by the distant light, valid values range from 0 to 360 degrees.
// Set the cone angle to 45 degrees stageModel.getDistantLight(0).coneAngle = 45;

brightness

The scale value of the distant light. Reasonable values range between 1-100, and appropriate initial settings are dependant upon the light map brightness of the objects to be illuminated. Experimentation with the initial value is necessary for obtaining desired results.
// Set the lights brightness to 10 stageModel.getDistantLight(0).brightness = 10;

290

APPENDIX E

castShadows

In worlds where dynamic lighting is enabled, controls whether the DistantLight will cause dynamically lit objects to cast shadows. Note that a dynamically lit object will only require processing (thereby reducing performance) when it moves. Moving your avatar around in the world and changing views does not require an update to the dynamic light, and therefore should not affect performance.
// Enable the lights ability to cast shadows stageModel.getDistantLight(0).castShadows = true;

color

The color of the light as an Array or Vector of three values ordered as (red, green, and blue).
// make the light red stageModel.getDistantLight(0).color = [1, 0, 0]; // make the light green stageModel.getDistantLight(0).color = [0, 1, 0]; // make the light blue stageModel.getDistantLight(0).color = [0, 0, 1];

EntryPoint
The EntryPoint scene element represents the starting position (and orientation) when a visitor enters your world. Identifying the EntryPoint in JavaScript might be useful if you desire to return the visitor to the starting location for any given reason. Multiple entrypoints can be created and used when specifying the URL of the Atmosphere world in your webpage, and are referenced by appending the pound sign followed by the Entrypoint name (example: ./ myFileName.aer#entryPosition2. see more details about EntryPoints in the Atmosphere Application Help). Local Properties
type

The objects type; returns EntryPoint.


if (myObject.type == EntryPoint) { ... }

name

Returns the name of the object as assigned in the Application.


if (myObject.name == myCoolObject) { ... }

loaded

Returns true once the object has nished loading.


if (myObject.loaded) { ... }

parent

A reference to the parent SceneGroup containing the object


myParent = myObject.parent;

ADOBE ATMOSPHERE 291 User Guide

position

The position of the object as a Vector.


// set the position of the object to a known anchor myObject.position = myAnchor3.position;

orientation

The rotational orientation of the object (as a Rotation).


// set the orientation of the object to a known anchor myObject.orientation = myAnchor3.orientation;

transform

The Transform is the combined position and orientation of the object.


// set the transform of the object to a known anchor myObject.transform = myAnchor3.transform;

worldSpacePosition

The worldSpacePosition of the object as a Vector.


// set the worldSpacePosition of the object to a known anchor myObject.worldSpacePosition = myAnchor3.worldSpacePosition;

worldSpaceOrientation

The worldSpaceOrientation of the object (as a Rotation).


// set the worldSpaceOrientation of the object to a known anchor myObject.worldSpaceOrientation = myAnchor3.worldSpaceOrientation;

worldSpaceTransform

The worldSpaceTransform is the combined worldSpacePosition and worldSpaceOrientation of the object.


// set the worldSpaceTransform of the object to a known anchor myObject.worldSpaceTransform = myAnchor3.worldSpaceTransform;

PhysicalModel
The PhysicalModel module enables JavaScript to apply physically accurate motions to SceneGroups, solid objects, surface objects, and Viewpoint objects. Once a physical model has been created from a object, it will respond to real world dynamics as you assign them including collisions, external forces and constraints. The physics processing engine attempts to be efcient when calculating the movement of many objects. As a act of efciency, a physical model will become deactivated if its velocity stays at a low level for a signicant length of time. Therefore, just prior to forcibly setting a velocity or acceleration for a physical model, you should set the active property to true to begin processing of the object once again in the event that it has come to rest. Another alternative is to call the method disableDeactivation() for the object, which will cause it processed at all times. Be aware that calling this method for many objects may reduce performance.

292

APPENDIX E

When positioning a physical model, you are actually specifying the location of its center of mass. This may be different than the position dened for the position of the SceneGroup from which the physical model may have been made. When rst created the physical model will be in the same visual location as the SceneGroup or Viewpoint object from which it was made. The offset between the physical model and the SceneGroup or ojbect position may be computed at that time. The importance of the distinction is apparent when using moveTo or transformTo for the physical model. It should be noted that for any of the physics based constraints or actions, it is necessary to assign reasonable mass values when creating the physical models so that physics processing does not become unstable (driven out of scope). The guidelines for mass and inertia are decribed in the method createPhysicalModel(). If you plan to control the movement of a physical model but want it xed for the moment, set a reasonable mass value when creating it, and also set the xed ag to true. This will prevent angular and lateral motion, but still enable collisions. When moving the object, it is preferable to use moveTo / transformTo / rotateTo so that collisions are properly considered along the move path and nal destination. Properties
type

The objects type; returns PhysicalModel


if (foo.type == PhysicalModel) { ... }

worldSpacePosition

the position of the object used to create the PhysicalModel, in world space coordinates (as a Vector).
myPhysicalModelCreatorObject.worldSpacePosition = myAnchor3.worldSpacePosition;

worldSpaceOrientation

the rotational orientation of the object used to create the PhysicalModel, in world space coordinates (as a Rotation). Note that Atmosphere uses the units of Radians for rotations (where a full circle = pi * 2).
myPhysicalModelCreatorObject.worldSpaceOrientation = myAnchor3.worldSpaceOrientation;

worldSpaceTransform

the Transform object (representing the combined position and orientation) of the object used to create the PhysicalModel, in world space coordinates.
myPhysicalModelCreatorObject.worldSpaceTransform = myAnchor3.worldSpaceTransform;

rigidBodyWorldSpacePosition

the position of the center of mass for the PhysicalModel, in world space coordinates (as a Vector).
myPhysicalModel.rigidBodyWorldSpacePosition = myAnchor3.worldSpacePosition;

rigidBodyWorldSpaceTransform

the Transform (representing the combined position and orientation) of the center of mass for the PhysicalModel, in world space coordinates.
myPhysicalModel.rigidBodyWorldSpaceTransform = myAnchor3.worldSpaceTransform;

ADOBE ATMOSPHERE 293 User Guide

worldSpaceVelocity

the velocity of the object in world space coordinates (as a Vector). Just prior to setting the velocity for an object, you should set the active property to true in case the object has come to rest. (For more information, see the overview at the top of page.)
myPhysicalModel.active = true; myPhysicalModel.worldSpaceVelocity = Vector(0, 5, -25);

worldSpaceAcceleration

the acceleration of the object in world space coordinates (as a Vector). The acceleration applies a force to the center of mass that is proportional to the mass. This approach allows you to simulate a uniform gravitational eld to all objects, such as the acceleration due to gravity. So, acceleration is an input to force generation, rather than a measure of the velocity derivative. (For Earths gravity at sea-level, set acceleration to (0.0, -32.0, 0.0) ). Just prior to setting the acceleration for an object, you should set the active property to true in case the object has come to rest. (For more information, see the overview at the top of page.)
myPhysicalModel.active = true; myPhysicalModel.acceleration = Vector(10, 5, -25);

worldSpaceAngularVelocity

the angular velocity of the object in world space coordinates (as a Vector). Just prior to setting the angularVelocity for an object, you should set the active property to true in case the object has come to rest. (For more information, see the overview at the top of page.) Atmosphere angularVelocity is in the scale of Radians per second.
myPhysicalModel.active = true; myPhysicalModel.angularVelocity = Vector(10, 5, -25);

mass

the mass of the physical model as specied during creation. This property may be modied at any time. Since you can read the volume of the physical model, you could set its mass to reect the density of a given substance such as water. Be sure that the density value you use is in the same units system as the mass units / volume units (volume units are feet cubed).
physicalModel.mass = physicalModel.volume * density;

volume

the volume of the physical model computed from the geometry of the physical model. Note that if you created a convex physical model, it will return the volume of the convex hull, not the original surface. Volume units are feet cubed.
volumeForFloating = myBoat.physicalModel.volume;

active

A ag specifying whether this physical model should be processed by the physics engine at the current moment(default = true). This property is very useful in establishing a more elegant base state for a physics enabled scene. For example, suppose you load an array of bowling pins to be used as physical objects in a bowling game. At initial load, the pins may wiggle somewhat as they experience gravity, and settle to the oor.

294

APPENDIX E

This unnecessary settling can be eliminated by setting the active state to false. The objects will automatically resume physics behavior at the next collision with another object, and this ag will automatically be returned to true. This property should also be set to true prior to specifying an acceleration or velocity of an object, since an object at rest may be in a deactivated state. (see comments regarding deactivation elsewhere on this page.)
for ( i=0 ; i<9 ; i++ ) { bowlingPins[i].physicalModel.active = false; }

collide

Determines if and how this SceneGroup collides with the world and other SceneGroups. If collide is true, collisions with the world and other collidable SceneGroups are taken into account when calling moveTo() (i.e., the world and other objects can affect our position).
// Set the initial position without collisions ball.position = startPosition; // Henceforth, dont let the ball pass through things. ball.collide = true; // Schedule a move with collisions ball.moveTo(endPosition);

xed

A boolean that xes an object in place to prevent physical motion. This ag speeds up collision detection for other objects relative to just setting the velocity and acceleration to zero. If xed is false then the object will move according to its velocity, acceleration, angular velocity and angular accerelation taking collisions into account depending on the value the of the collide property.
box = SceneGroup(./box.aer).add(); box.timestep = function() { if (this.loaded) { this.physicalModel = this.createPhysicalModel(10); this.physicalModel.xed = true; this.physicalModel.friction = .5; this.physicalModel.inertiaScale = 1.5; this.physicalModel.restitution = .6; removeAnimator(this); } } addAnimator(box);

ADOBE ATMOSPHERE 295 User Guide

friction

The coefcient of friction for the physical model. Higher values of friction allow physical models to sit on slopes without sliding. Typical values are in the range of 0.0 to 1.0, although higher values are allowed - negative values are not. The denition of friction is the ratio between the normal force and the largest allowed lateral friction force that may result. Coefcients of friction are combined for two physical models to come up with a single value for interactions between them.
// See xed code sample above for example

intertiaScale

This value scales the moment of inertia of the physical model as it is created. The default value is 1.0. Values larger than 1.0 may be required to aid the stability of long chains of physical models linked together by constraints.
// See xed code sample above for example

restitution

This coefcient affects the degree of bounce of an object. Allowed values are between 0.0 (no bounce) and 1.0 (perfect bounce). It is dened as the ratio of velocities before and after a normal collision to a surface. Coefcients of restitution are combined for colliding physical objects to come up with a single value for interactions between them.
// See xed code sample above for example

useForOverlaps

A ag specifying whether this physical model should be considered when processing an OverlapEventHandler().
box1.physicalModel.useForOverlaps = true;

Methods
applyAngularImpulse(Vector impulse)

This function increments the angular momentum of the physical model by a specied amount. The direction of the impulse vector denes the rotation axis, and the magnitude of the vector determines the amount of angular momentum applied. A torque impulse may be thought of as a large torque applied for a short time, with the magnitude of the torque being multiplied by the duration to get the amount of angular momentum change.
box = SceneGroup(./box.aer).add(); box.timestep = function() { if (this.loaded) { this.physicalModel = this.createPhysicalModel(10); this.physicalModel.collide = true; this.root = this.getSolidObject(0).rootPrimitive; this.root.onClick = function() {

296

APPENDIX E

// Make the box spin when it is clicked on box.physicalModel.applyAngularImpulse(Vector(1,0,0)); } removeAnimator(this); } } addAnimator(box);

applyImpulse(Vector impulse, Vector position)

This function increments the linear momentum of the physical model by a specied amount, and also updates the angular momentum, in a way that is consistent with the impulse being applied to a given position within the physical model. The direction of the impulse vector denes the direction of applied force, and the magnitude of the vector determines the amount of linear momentum applied. A linear impulse may be thought of as a large force applied for a short time, with the magnitude of the force being multiplied by the duration to get the amount of linear momentum change. A classic use of an impulse is to simulate the effect of a bullet hitting an object at a specied location. Since the impulse is not calculated to be at the center of mass, the object might start to spin as well. Lastly, An impulse is measured in units of force times time, or momentum. So, to get an object from rest up to a velocity of 1 foot per second, you would need to apply an impulse equal to the mass of the object.
box = SceneGroup(./box.aer).add(); box.timestep = function() { if(this.loaded) { this.physicalModel = this.createPhysicalModel(10); this.physicalModel.collide = true; this.root = this.getSolidObject(0).rootPrimitive; this.root.onClick = function() { mouseX = application.getView(0).mouseX; mouseY = application.getView(0).mouseY; camera = application.getView(0).getCamera(0); rayOrigin rayDir distance = camera.position; = camera.getRayDirectionFromPixelCoords(mouseX, mouseY); = stageModel.rayIntersectionDistance(rayOrigin, rayDir);

intersection = Vector(rayOrigin.x + rayDir.x * distance, rayOrigin.y + rayDir.y * distance, rayOrigin.z + rayDir.z * distance); impulse = rayDir.scale(10); // Push the box at the point where it is clicked on box.physicalModel.applyImpulse(impulse, intersection);

ADOBE ATMOSPHERE 297 User Guide


} removeAnimator(this); } } addAnimator(box);

applyImpulseToCenterOfMass(Vector impulse)

This function increments the linear momentum of the physical model by a specied amount, and also updates the angular momentum, in a way that is consistent with the impulse being applied to a given position within the physical model. The direction of the impulse vector denes the direction of applied force, and the magnitude of the vector determines the amount of linear momentum applied. A linear impulse may be thought of as a large force applied for a short time, with the magnitude of the force being multiplied by the duration to get the amount of linear momentum change.
box = SceneGroup(./resources/box.aer).add(); box.timestep = function() { if (this.loaded) { this.physicalModel = this.createPhysicalModel(10); this.physicalModel.collide = true; this.root = this.getSolidObject(0).rootPrimitive; this.solidObject.onClick = function() { camera = application.getView(0).getCamera(0); direction = box.position.subtract(camera.position); impulse = direction.normalized.scale(10); // Push the box directly away when it is clicked on box.physicalModel.applyImpulseToCenterOfMass(impulse); } removeAnimator(this); } } addAnimator(box);

disableCollisionsWith(PhysicalModel)

This function allows one physical model to avoid colliding with another physical model. This pair of objects is kept in a list and any collisions detected between the physical models will be ignored. This feature is useful when making mechanisms using constraints and it is necessary to avoid collisions between two objects that are joined together.
box1 = SceneGroup(./resources/box.aer).add(); box2 = SceneGroup(./resources/box.aer).add();

298

APPENDIX E

loader = new Object(); loader.timestep = function() { if(box1.loaded && box2.loaded) { box1.physicalModel = this.createPhysicalModel(2); box2.physicalModel = this.createPhysicalModel(5); box1.physicalModel.disableCollisionsWith(box2.physicalModel); removeAnimator(this); } } addAnimator(loader);

enableCollisionsWith(PhysicalModel)

This function undoes the effect of disableCollisionsWith(physicalModel). It removes the pair of collisions that are currently being ignored from the list, so that collisions between these two objects will no longer be ignored.
box1.physicalModel.enableCollisionsWith(box2.physicalModel);

disableDeactivation()

Prevents the physical model from being deactivated when it comes to rest. For SceneGroups being modied with moveTo and transformTo, the call to disableDeactivation must be made once to prevent the object from being disabled by the automatic deactivation criteria.
box1.physicalModel.disableDeactivation();

enableDeactivation()

For use following the above method, will allow the physical model to once again be deactivated when it comes to rest.
box1.physicalModel.enableDeactivation();

moveTo(Vector position)

This method schedules an update to the position property using a smooth interpolation over the next time step period. This smooth kinematic motion is more stable when other objects collide with the current object. By the next time step the velocity and acceleration will be set to zero. Note that it is not recommended that you set this value in a timestep, meaning to set a new value every frame. The most dependable method for moving a Physical Model (apart from using constraints or the collision with another object) is to use the ApplyImpulse() methods.
anchorA = stageModel.getPrimitive(A); anchorB = stageModel.getPrimitive(B); box = SceneGroup(./box.aer).add(); box.timestep = function() { if (this.loaded) { this.physicalModel = this.createPhysicalModel(10);

ADOBE ATMOSPHERE 299 User Guide


this.physicalModel.transform = anchorA.transform; this.physicalModel.collide = true; this.button = Button(MoveTo Anchor B).add(); this.button.onClick = function() { box.physicalModel.moveTo(anchorB.position); } removeAnimator(this); } } addAnimator(box);

rotateTo(orientation)

This method schedules an update to the orientation property using a smooth interpolation over the next time step period. This smooth kinematic motion is more stable when other objects collide with the current object. By the next time step the angular velocity and angular acceleration will be set to zero.Note that it is not recommended that you set this value in a timestep, meaning to set a new value every frame. The most dependable method for moving a Physical Model (apart from using constraints or the collision with another object) is to use the ApplyImpulse() methods. Note that rotations in Atmosphere are in the units of Radians (a full circle = pi * 2).
anchorA = stageModel.getPrimitive(A); anchorB = stageModel.getPrimitive(B); box = SceneGroup(./box.aer).add(); box.timestep = function() { if(this.loaded) { this.physicalModel = this.createPhysicalModel(10); this.physicalModel.transform = anchorA.transform; this.physicalModel.collide = true; this.button = Button(RotateTo Anchor B).add(); this.button.onClick = function() { box.physicalModel.rotateTo(anchorB.orientation); } removeAnimator(this); } } addAnimator(box);

transformTo(transform)

This method schedules an update to the orientation and position properties using a smooth interpolation over the next time step period. This smooth kinematic motion is more stable when other objects collide with the current object. By the next time step the velocity, acceleration, angular velocity and angular acceleration will

300

APPENDIX E

be set to zero. Note that it is not recommended that you set this value in a timestep, meaning to set a new value every frame. The most dependable method for moving a Physical Model (apart from using constraints or the collision with another object) is to use the ApplyImpulse() methods.
anchorA = stageModel.getPrimitive(A); anchorB = stageModel.getPrimitive(B); box = SceneGroup(./box.aer).add(); box.timestep = function() { if (this.loaded) { this.physicalModel = this.createPhysicalModel(10); this.physicalModel.orienation = anchorA.orienation; this.physicalModel.collide = true; this.button = Button(TransformTo Anchor B).add(); this.button.onClick = function() { box.physicalModel.transformTo(anchorB.transform); } removeAnimator(this); } } addAnimator(box);

getParent()

Returns a reference to the object that was used to create the physical model.
box1Parent = box1.physicalModel.getParent();

Portal
The Portal scene element is used to automatically transport your visitor to another Atmosphere world (or different entrypoint in the current world) when they overlap the Portal area. The Portal is identied by three vertical square planes which are rotating and circling about the overlap area (the planes are colored red, blue, green). It is possible to dynamically specify the URL of the portal in JavaScript, enabling the designer to transport the visitor to different locations based upon the outcome of some logic / condition. Local Properties
type

The objects type; returns Portal.


if (myObject.type == Portal) { ... }

name

Returns the name of the object as assigned in the Application.

ADOBE ATMOSPHERE 301 User Guide


if (myObject.name == myCoolObject) { ... }

loaded

Returns true once the object has nished loading.


if (myObject.loaded) { ... }

parent

A reference to the parent SceneGroup containing the object


myParent = myObject.parent;

position

The position of the object as a Vector.


// set the position of the object to a known anchor myObject.position = myAnchor3.position;

orientation

The rotational orientation of the object (as a Rotation).


// set the orientation of the object to a known anchor myObject.orientation = myAnchor3.orientation;

transform

The Transform is the combined position and orientation of the object.


// set the transform of the object to a known anchor myObject.transform = myAnchor3.transform;

worldSpacePosition

The worldSpacePosition of the object as a Vector.


// set the worldSpacePosition of the object to a known anchor myObject.worldSpacePosition = myAnchor3.worldSpacePosition;

worldSpaceOrientation

The worldSpaceOrientation of the object (as a Rotation).


// set the worldSpaceOrientation of the object to a known anchor myObject.worldSpaceOrientation = myAnchor3.worldSpaceOrientation;

worldSpaceTransform

The worldSpaceTransform is the combined worldSpacePosition and worldSpaceOrientation of the object.


// set the worldSpaceTransform of the object to a known anchor myObject.worldSpaceTransform = myAnchor3.worldSpaceTransform;

url

A new URL for the portal object, which may be any valid URL (relative or absolute) and which may also include an alternate Atmosphere entrypoint (see details on EntryPoints elsewhere in these documents).

302

APPENDIX E

// specify a new URL if the user answers the question correctly if (userAnswer = true) { customPortal3.url = ./myFileName.aer#entryPosition2; }

ReferencePoint
The ReferencePoint scene element is similar in use the Anchor object. Since all Atmosphere worlds contain at least one ReferencePoint, it may be a useful way to specify a common location as you design your worlds. (Note that the primary usage for ReferencePoint is found in the Atmosphere authoring application, where it is used to specify the placement of any new objects or primitives during construction. Note also that the ReferencePoint has no name property, as it cannot be named in the Authoring Appliation.) Local Properties
type

The objects type; returns ReferencePoint.


if (myObject.type == ReferencePoint) { ... }

loaded

Returns true once the object has nished loading.


if (myObject.loaded) { ... }

parent

A reference to the parent SceneGroup containing the object


myParent = myObject.parent;

position

The position of the object as a Vector.


// set the position of the object to a known anchor myObject.position = myAnchor3.position;

orientation

The rotational orientation of the object (as a Rotation).


// set the orientation of the object to a known anchor myObject.orientation = myAnchor3.orientation;

transform

The Transform is the combined position and orientation of the object.


// set the transform of the object to a known anchor myObject.transform = myAnchor3.transform;

ADOBE ATMOSPHERE 303 User Guide

worldSpacePosition

The worldSpacePosition of the object as a Vector.


// set the worldSpacePosition of the object to a known anchor myObject.worldSpacePosition = myAnchor3.worldSpacePosition;

worldSpaceOrientation

The worldSpaceOrientation of the object (as a Rotation).


// set the worldSpaceOrientation of the object to a known anchor myObject.worldSpaceOrientation = myAnchor3.worldSpaceOrientation;

worldSpaceTransform

The worldSpaceTransform is the combined worldSpacePosition and worldSpaceOrientation of the object.


// set the worldSpaceTransform of the object to a known anchor myObject.worldSpaceTransform = myAnchor3.worldSpaceTransform;

SceneGroup
The SceneGroup module is used to represent a single SceneGroup in the scene graph. A SceneGroup contains a transformation that affects the location of everything contained within the SceneGroup. A SceneGroup includes an array of solid objects, an array of Viewpoint objects and an array of child SceneGroups. The SceneGroup may be in coordinates relative to its parent SceneGroup, or in world coordinates. This is determined by the value of the ag attachedToParentModel. When the value of this ag is changed, the position coordinates are updated to maintain the same location in world space. Any Atmosphere world saved from the Builder may be loaded as a SceneGroup. Avatars are also examples of SceneGroups. When positioning a SceneGroup, you are actually specifying the location of the pivot point of the SceneGroup within the parent SceneGroup. The origin of the coordinate frame of a SceneGroup is coincident with the location and orientation of the EntryPoint with title Pivot or Eye if one is present. (Eye is prefered for avatars and Pivot for scene SceneGroups.) If neither is present the pivot point is the origin of the coordinate system for the SceneGroup as specied in the Builder. To allow a SceneGroup to exhibit physically-realistic motion, a function is used to create a physical model. This then updates the orientation and position of the SceneGroup every time step. Note: Any SceneGroup methods that access or perform operations on the geometry or elements within a SceneGroup can only be done once the SceneGroup has fully loaded. Examples of this are createPhysicalModel, crea teConvexPhysicalModel, getSolidObjectCount, getSolidObject, getViewpointObjectCount, getViewpointObject, and getDistantLightCount, getDistantLight. Global Properties
mySceneGroup

Loaded SceneGroups can have attached scripts, use mySceneGroup to access the SceneGroup from within its script. In the case of avatar scripts, it refers to the avatars SceneGroup.
mySceneGroup.getSolidObject(0).useDynamicLighting = false;

304

APPENDIX E

theStage

The loaded worlds SceneGroup. Provides access to all objects and elements in the base scene. Note that it is not possible to set an object property to be theStage. You must use the theStage global if you need to access theStage in a script.
numSolidObjects = theStage.getSolidObjectCount(); numViewpointObjects = theStage.getViewpointObjectCount(); chat.print((numSolidObject + numViewpointObject) + objects in the world.)

theWorld

The top level SceneGroup containing all objects in the current Atmosphere instance, including theActor. Provides access to all objects and elements in the scene.
myCoolObject = theWorld.getChild(coolObjectName);

Global Methods
SceneGroup(url)

The SceneGroup constructor, it loads an Atmosphere world le from the given URL and returns it as an object. Just like Web links, SceneGroup URLs can be either relative or absolute. Note that the SceneGroup is not visible (rendered) until you use the local add() method shown below.
// Absolute URL spider = SceneGroup(http://www.myDomain.com/myHomePage/spider.aer); // Relative URLs y1 = SceneGroup(./y.aer); y2 = SceneGroup(../y.aer); y3 = SceneGroup(../../y.aer); y4 = SceneGroup(./bugs/y.aer); y5 = SceneGroup(/y.aer);

// // // // //

current folder up one folder up two folders in the folder called bugs in the root folder

Properties
type

The objects type. Returns SceneGroup.


if (foo.type == SceneGroup) { ... }

loaded

This ag is true once the SceneGroup has nished loading. Note that if a SceneGroup contains ViewpointObjects, the SceneGroup.loaded ag will properly wait for the ViewpointObject.loaded ags to become true only under the following conditions: The SceneGroup is in the rst level directly under the stage in the Scene Hierarchy. The SceneGroup was added to the scene by a Javascript calling the .add() function.
box = SceneGroup(./box.aer); box.timestep = function()

ADOBE ATMOSPHERE 305 User Guide


{ if (!box.loaded) { return; } chat.print(The box is loaded now.); removeAnimator(this) } addAnimator(box);

parent

A reference to the parent SceneGroup containing the object


myParent = myObject.parent;

orientation

The rotational orientation of the SceneGroup (as a Rotation).


// Rotate the arrow to have the same orientation as the player arrow = SceneGroup(./arrow.aer); arrow.orientation = player.orientation;

position

The position as a Vector.


// Place the box at x=10, y=5, z=-25 in the world box = SceneGroup(./box.aer); box.position = Vector(10, 5, -25);

transform

The Transform object representing the combined position and orientation.


// Smoothly animate between EntryPoints ep1 and ep2 // (including their orientations) over 100 frames: box = SceneGroup(./box.aer); box.n = 0; box.timestep = function() { this.transform = ep1.transform.blend(ep2.transform, this.n++/100); } addAnimator(box);

worldSpacePosition

The worldSpacePosition of the object as a Vector.


// set the worldSpacePosition of the object to a known anchor myObject.worldSpacePosition = myAnchor3.worldSpacePosition;

worldSpaceOrientation

The worldSpaceOrientation of the object (as a Rotation).


// set the worldSpaceOrientation of the object to a known anchor myObject.worldSpaceOrientation = myAnchor3.worldSpaceOrientation;

306

APPENDIX E

worldSpaceTransform

The worldSpaceTransform is the combined worldSpacePosition and worldSpaceOrientation of the object.


// set the worldSpaceTransform of the object to a known anchor myObject.worldSpaceTransform = myAnchor3.worldSpaceTransform;

bounds

The min and max extent of the SceneGroup in local coordinates, relative to the SceneGroups Eye position and orientation, expressed as an array of two Vectors [min, max].
spider = SceneGroup(./spider.aer); // Make spiders feet just touch the oor height = oorHeight - spider.bounds[0].y; spider.position = Vector(spider.position.x, height, spider.position.z);

visible

Allows the SceneGroup to be visibly removed from the rendered scene. Note that the SceneGroup geometry will still be present; this would be useful for creating an object which causes collisions, but which is invisible.
box = SceneGroup(./box.aer); box.visible = false;

attachedToParent

A ag that is set to true when a SceneGroup is attached to another SceneGroup using the addTo() method. A SceneGroup that is attached to its parent will be transformed with the parent. If this ag is then set to false the child SceneGroup will act as an independant SceneGroup.
box1 = SceneGroup(./box.aer); box2 = SceneGroup(./box.aer); loader = new Object() loader.timestep = function() { if (!box1.loaded && !box2.loaded) { return; } box1.add(); box2.addTo(box1); box1.physicalModel = box2.createPhysicalModel(5); box2.physicalModel = box2.createPhysicalModel(10); box2.attachedToParent = false; removeAnimator(this); } addAnimator(loader);

ADOBE ATMOSPHERE 307 User Guide

Methods
add()

Adds the SceneGroup to the top-level World. Returns a reference to the SceneGroup as a convenience.
// Load the spider and add it to the world spider = SceneGroup(./spider.aer).add();

addTo(parent)

Adds the SceneGroup as a child to the specied SceneGroup. Returns the SceneGroup as a convenience.
// Load the hat and add it to my avatar myHat = SceneGroup(./hat.aer).addTo(mySceneGroup);

remove()

Removes the SceneGroup from the top-level World. Note that the SceneGroup is still present in memory, but is no longer processed by the rendering engine(and therefore not visible). This understanding may be useful for performance improvement when many dynamic SceneGroups are present in the world. Using remove(), it is not necessary to create and load the SceneGroups again, but simply to add() them back into the scene. It is also now possible to remove SceneGroups from memory, if desired. To accomplish this, rst remove the SceneGroup from the rendered world using remove() as shown below, then use the global JavaScript delete method to remove the SceneGroup from memory.
// Remove the spider from the world spider.remove(); // Also remove the SceneGroup from memory, if desired delete spider;

getPrimitive(name)

Returns the rst Primitive with the given name from the SceneGroups array of SolidObjects.
thePrimitive = theStage.getPrimitive(Lamp);

createDistantLight()

All worlds have one DistantLight by default. Additional DistantLights can be created with this method. Note that light coordinate systems (X,Y,Z) are local to the SceneGroup from which they were created. (See the documentation on DistantLight for a description of appearance and behavior.)
anotherLight = theStage.createDistantLight();

getDistantLight(index)

Returns the corresponding DistantLight at the given index.


theLight = theStage.getDistantLight(0);

getDistantLightCount()

Returns the number of DistantLights in the scene.


chat.print(There are + stage.distantLightCount() + light(s) in the scene.);

308

APPENDIX E

mapLocalPositionToWorldPosition(Vector)

Given a position Vector in local coordinates returns the corresponding position Vector in world-relative coordinates.
// Find the local space position of the wheel axle in the SceneGroup anchor = car.getPrimitive(wheel1); desiredOffset = anchor.position; // Place the wheel SceneGroup in world space wheel.position = car.mapLocalPositionToWorldPosition(desiredOffset);

mapLocalTransformToWorldTransform(Transform)

Given a Transform in local coordinates returns the corresponding Transform in world-relative coordinates.
carRelativeTransform = Transform(Vector(0, 4, 6), Rotation(Z, 0.0)); box.transform = car.mapLocalTransformToWorldTransform(carRelativeTransform);

setPosition(x, y, z)

Sets the absolute position of the SceneGroup within its parent World (if any) ignoring the collision ag. The velocity and acceleration are unaffected.
mySceneGroup.setPosition(10,0,15);

getParent()

Returns the parent SceneGroup; will return NULL if the given SceneGroup is the World.
theParent = SceneGroup.getParent();

getChild(index or name)

Returns the corresponding child object at the given index or name that is contained by the SceneGroup.
theChild = SceneGroup.getChild(0);

getChildCount()

Returns the number of Children objects in the given SceneGroup.


chat.print(There stage contains + stage.getChildCount() + child objects.);

getSceneGroup(index or name)

Returns the corresponding SceneGroup at the given index or name that is contained by the SceneGroup.
theChildSceneGroup = SceneGroup.getSceneGroup(0);

getSceneGroupCount()

Returns the number of SceneGroups in the given SceneGroup.


chat.print(There stage contains + stage.getSceneGroupCount() + child SceneGroups.);

getSolidObject(index or name)

Returns the corresponding SolidObject at the given index or name that is contained by the SceneGroup.
theSolidObject = theStage.getSolidObject(0);

ADOBE ATMOSPHERE 309 User Guide

getSolidObjectCount()

Returns the number of SolidObjects in the given SceneGroup.


chat.print(There are + stage.solidObjectCount() + SolidObject(s) in the scene.);

getSurfaceObject(index or name)

Returns the corresponding SurfaceObject at the given index or name that is contained by the SceneGroup.
theSurfaceObject = theStage.getSurfaceObject(0);

getSurfaceObjectCount()

Returns the number of SurfaceObjects in the given SceneGroup.


chat.print(There are + stage.getSurfaceObject() + SurfaceObject(s) in the scene.);

getViewpointObject(index or name)

Returns the corresponding ViewpointObject at the given index or name that is contained by the SceneGroup.
viewpointObject1 = theStage.getViewpointObject(0); viewpointObject2 = theStage.getViewpointObject(sphere);

getViewpointObjectCount()

Returns the number of ViewpointObjects in the scene.


chat.print(There are + stage.viewpointObjectCount() + ViewpointObject(s) in the scene.);

createPhysicalModel(mass, inertiaScale)

A function that takes the SceneGroups geometry and creates a PhysicalModel with the given mass. This is done for all the pieces of the SceneGroup that dont already have PhysicalModels. Once created, the physical model will modify the tranform of the SceneGroup as it experiences external forces, collisions and constraints. For this version of the function, the physical model uses the full geometry of the SceneGroup, which may slow down the physics simulation if done for many complex objects. The one exception is if the physical model is created with a mass of 0, in which case it will be xed in place, and will allow for more efcient collision computations with other objects. Mass is a relative scale, and a density index of 1 per square foot of geometric volume is a reasonable starting point. For example, a box with thedimensions of [1x1x1] would be assigned a mass of 1. A box which is [2x2x2] would be assigned amass of 8, since the volume of the box is 8 square feet. It should be noted that for any of the physics based constraints or actions, there are conditions under which the physics processing may become unstable. Exerting very large forces on very lightobjects may cause the calculations to be driven out of scope(to innity). These conditions can beavoided by assigning reasonable mass values when creating the physical models, as described above. The designer should experiment with mass values and forces applied to insure that physics and javascript processing are not brought to a halt. The inertia scale may be used to scale the moment of inertia of the object. Sometimes constraints may be made more stable by scaling up the moments of inertia of the physical models that they affect.
box = SceneGroup(./box.aer).add(); box.timestep = function()

310

APPENDIX E

{ if (this.loaded) { physicalModel = this.createPhysicalModel(10); removeAnimator(this); } } addAnimator(box);

createConvexPhysicalModel(mass, inertiaScale)

Same as the method createPhysicalModel, though in this version the function, the physical model uses the convex hull of the SceneGroup, which allows collisions to be much more efciently computed by the physics engine. Settings for mass and inertia should adhere to the same guidelines also described above. Again, note that setting the mass to 0 will cause the physical model to be xed in place, and will also produce more efcient(faster) collision computation.
star = SceneGroup(./star.aer).add(); star.timestep = function() { if (this.loaded) { physicalModel = this.createConvexPhysicalModel(5); removeAnimator(this); } } addAnimator(box);

getPhysicalModel()

Gets the PhysicalModel created by the above methods.


//get the physicalModel already created from a loaded SceneGroup star.getPhysicalModel();

deletePhysicalModel()

Deletes the PhysicalModel created by the above methods, and all associated physics processing.
//delete the physical model already created from a loaded SceneGroup star.deletePhysicalModel();

rayIntersectionDistance(Vector rayOrigin, Vector rayDirection)

Given an origin and direction shoots a ray and returns the distance between the origin and the point on the surface the ray intersects. Note: the vectors must be normalized or the result will be unpredictable.
camera mouseX mouseY rayOrigin rayDir = application.getView(0).getCamera(0); = application.getView(0).mouseX; = application.getView(0).mouseY = player.position; = camera.getRayDirectionFromPixelCoords(mouseX, mouseY);

ADOBE ATMOSPHERE 311 User Guide


// Calculates the distance to the object // clicked on by the mouse distance = theStage.rayIntersectionDistance(rayOrigin, rayDir);

rayIntersectionNormal(Vector rayOrigin, Vector rayDirection)

Given an origin and direction shoots a ray and returns the normal vector of the surface the ray intersects.
camera mouseX mouseY rayOrigin rayDir = application.getView(0).getCamera(0); = application.getView(0).mouseX; = application.getView(0).mouseY = player.position; = camera.getRayDirectionFromPixelCoords(mouseX, mouseY);

// Calculates the normal vector of the surface // clicked on by the mouse normal = theStage.rayIntersectionNormal(rayOrigin, rayDir);

rayIntersectionUTangent(Vector rayOrigin, Vector rayDirection)

Given an origin and direction shoots a ray and returns the side vector of the surface the ray intersects.
camera mouseX mouseY rayOrigin rayDir = application.getView(0).getCamera(0); = application.getView(0).mouseX; = application.getView(0).mouseY = player.position; = camera.getRayDirectionFromPixelCoords(mouseX, mouseY);

// Calculates the side vector of the surface // clicked on by the mouse sideVector = theStage.rayIntersectionUTangent(rayOrigin, rayDir);

rayIntersectionVTangent(Vector rayOrigin, Vector rayDirection)

Given an origin and direction shoots a ray and returns the up vector of the surface the ray intersects.
camera mouseX mouseY rayOrigin rayDir = application.getView(0).getCamera(0); = application.getView(0).mouseX; = application.getView(0).mouseY = player.position; = camera.getRayDirectionFromPixelCoords(mouseX, mouseY);

// Calculates the up vector of the surface // clicked on by the mouse upVector = theStage.rayIntersectionVTangent(rayOrigin, rayDir);

312

APPENDIX E

Callbacks
suggestLocation(loc)

A SceneGroup scripts mySceneGroup.suggestLocation(loc) is called to notify the SceneGroup that it should move to a new location (position and orientation, represented as a single Transform object). A default (prototype) implementation of suggestLocation is provided which performs a simple linear interpolation between the old location and the new. Avatars are moved via mySceneGroup.suggestLocation, so overriding this with your own function allows you to provide your own method of interpolation. (The frequency with which suggestLocation will be called for avatar motion is undened, as it depends on network and other unpredictable factors.) World scripts which create SceneGroups may also call suggestLocation on those SceneGroups. Any such external calls are passed into the SceneGroups own script as a call to mySceneGroup.suggestLocation(loc), which by default will envoke the prototype linear interpolation or may be overridden by the SceneGroups script.
// Save the default version which does linear interpolation: mySceneGroup.interpolateTo = mySceneGroup.suggestLocation; // Override with our own method which prints the // target location for our information and then // invokes the default linear interpolation: mySceneGroup.suggestLocation = function(location) { chat.print(Avatar has been asked to move to: + location); this.interpolateTo(location); }

Script
The Script scene element is a powerful object to causing dynamic activity in an Atmosphere world, and the purpose for which these documents were written! The Script object itself is now exposed in the Atmosphere API, which enables it to use its own properties of position, orientation, and transform when performing object movement and other vector math. A Script also has no geometric volume, which places its pivot point at the exact origin. This is useful for using a Script to specify an axis of rotation. A very powerful new aspect of Atmosphere JavaScripts is the ability to divide the script into two sections; a top section which is processed when the script is loaded in the Authoring Application, and a bottom section which is processed when the script is run in the Atmosphere Player. Many scripts are included with the Atmosphere Authoring application, and observing their code content will help greatly in understanding how the scripts are used. To aid further, an explanation of the script workow is as follows: A top section of the script is rst dened by two custom comment lines: //BEGIN_AUTHORING_PROPERTIES //END_AUTHORING_PROPERTIES Any Javascript within this top section is read and processed only when the script is added to a world, or when a saved world is reloaded into the authoring application.

ADOBE ATMOSPHERE 313 User Guide

Within this top section, the script writer uses the deneCustomPropertyValue method shown below to create properties (variables and functions) which can be seen by the user in the Inspector Palette. During use of the Authoring Application, the default values for these properties can be modied by the user. Also during Application use, functions (called actions) can be linked to other objects or script properties. This allows the output of a function from one script (for example, onClick) to trigger the function from another script (such as playSound). The user modied values are stored in both the .atmo project le and the .aer published le (which is used for viewing in the webpage). When the .aer published le is opened in the Atmosphere Player, the rest of the script is read and processed (again, the top section is ignored). In this bottom section, the script designer retrieves the custom user values using the get CustomPropertyValue(name) methods shown below. The script designer then performs the script driven tasks and activity using the custom values retrieved. Final comments: If default values are specied when the properties are created in the top section of the script, these default values will be saved even if the user doesnt modify them. In this manner it may possible for the script to accomplish much with very little input from the user. Its wise to use the keyword this when retrieving the custom property values. If you tie all the properties to the this object, then variable names from one script will not collide with another script in the world. (example: this.target = this.getCustomPropertyValue(target); ) Lastly, its useful to put instructions for how to use your script into comment lines at the top of the script. Once a user loads your script into the world, the instructions can be viewed by simply clicking the Edit button on the Inspector palette when your script is selected. The Atmosphere development team recommends designating your instruction section with the lines //BEGIN_ INSTRUCTIONS and //END_INSTRUCTIONS. This will aid the casual user of the script in knowing where the instructions are dened, but Atmosphere may also add functionality in the future to show these instructions in a different manner, making it easier to reference your guidelines as they work with the script during world design. Local Properties
type

The objects type; returns Script.


if (myObject.type == Script) { ... }

name

Returns the name of the object as assigned in the Application.


if (myObject.name == myCoolObject) { ... }

loaded

Returns true once the object has nished loading.


if (myObject.loaded) { ... }

314

APPENDIX E

parent

A reference to the parent SceneGroup containing the object


myParent = myObject.parent;

position

The position of the object as a Vector.


// set the position of the object to a known anchor myObject.position = myAnchor3.position;

orientation

The rotational orientation of the object (as a Rotation).


// set the orientation of the object to a known anchor myObject.orientation = myAnchor3.orientation;

transform

The Transform is the combined position and orientation of the object.


// set the transform of the object to a known anchor myObject.transform = myAnchor3.transform;

worldSpacePosition

The worldSpacePosition of the object as a Vector.


// set the worldSpacePosition of the object to a known anchor myObject.worldSpacePosition = myAnchor3.worldSpacePosition;

worldSpaceOrientation

The worldSpaceOrientation of the object (as a Rotation).


// set the worldSpaceOrientation of the object to a known anchor myObject.worldSpaceOrientation = myAnchor3.worldSpaceOrientation;

worldSpaceTransform

The worldSpaceTransform is the combined worldSpacePosition and worldSpaceOrientation of the object.


// set the worldSpaceTransform of the object to a known anchor myObject.worldSpaceTransform = myAnchor3.worldSpaceTransform;

Local Methods
deneCustomPropertyValue(type, name, value, ref, mod)

For use in the top section of the script to create the custom properties which will be exposed in the Authoring Application Inspector Palette. The Authoring Application user may modify the default values (if you allow), and link properties from one script to another. This method should only be used to create the custom properties, and again, only in the authoring section of the script. A description of the arguments for this call are shown below in the code example.
// The target object which will be moved. this.deneCustomPropertyValue(

ADOBE ATMOSPHERE 315 User Guide


object, //type - see the Inspector Palette drop down menu //for property types available. target, //name - specify a unique name for each property. null, //value - the default value you would like to assign. false, //referenced - whether or not this property will be visible //in the Scene Hierarchy palette. true //modify - whether or not this property can be modied );

getCustomPropertyCount()

Returns the count of the custom properties and actions created in the top section of the script (between the key comment lines //BEGIN_AUTHORING_PROPERTIES and //END_AUTHORING_PROPERTIES).
for ( i = 0; i < this.getCustomPropertyCount(); i++ ) { ... //do task for each property }

getCustomPropertyName(index)

Returns the custom property name at the index specied in the array of custom properties.
this.Name2 = this.getCustomPropertyName(2);

getCustomPropertyValue(name)

Likely the most common of the methods to be used. Retrieves the value for the property of known name. If the user has modied the default value using the Inspector Palette, the modied value will be returned (its stored in both the .atmo project le and the .aer published le).
this.target = this.getCustomPropertyValue(target);

setCustomPropertyValue(name, value)

Its also possible to set the local variable for custom properties using this call.
this.setCustomPropertyValue(volume, 0.7);

callCustomPropertyValue(name)

Will trigger a custom action (function):


if (userAnswer = true) { callCustomPropertyValue(playSound); }

SolidObject
A SolidObject is used to represent the surface that results from combining a number of primitives specied in the Builder. These can include subtractive and additive primitives, allowing for holes etc. The primitives within a solid object are held rigidly relative to each other. However, the entire solid object may be manipulated using its orientation

316

APPENDIX E

and position. Primitives may be accessed via the root primitive, which is the top of the tree of primitives for the solid object. Objects within this tree may be accessed using the nd method of Primitive. By default, a solid object will be rendered using the light map computed in the Builder to modulate the surface texture, if present. By setting the ag useDynamicLighting to true, the rendering will scale the surface light map by the value of lightMapBrightness, and will add the contribution of any dynamic lights in the scene. For the current release, only a single DistantLight is supported, and that is owned by the stage SceneGroup. The ambient color is added to the diffuse color times the light contribution. These are then both added to the scaled light map color. In this way it is possible to have realistic diffuse lighting effects on objects that are being animated using a script or using a physical model. For objects that will be rotated in a world, it is best to light it in the Builder using only the background light and not the sun. The effect of the sun can then be approximated using a distant light in the script. Note that SolidObjects are not solid, and the description is not based on whether they have a physical model. A solid object is dened by a geometry which has an enclosed volumes (allowing boolean operations such as subtractions). Surface objects, in contrast may have open surfaces, and do not support boolean operations. Properties
type

The objects type. Returns SolidObject.


if (foo.type == SolidObject) { ... }

name

Returns the name of the SolidObject assigned in the Application.


if (foo.name == myCoolSolidObject) { ... }

loaded

Returns true once the object has nished loading.


if (myObject.loaded) { ... }

parent

A reference to the SceneGroup containing the SolidObject


objectParent = solidObject.parent;

root

Is the primitive representing the root of the geometry of the SolidObject.


car = SceneGroup(car.aer); car.onLoad = function() { this.wheel = this.getSolidObject(0).root.nd(.../wheel); } addAnimator(car);

rootPrimitive

The top-level group of a Solid Object.

ADOBE ATMOSPHERE 317 User Guide


theStage.getSolidObject(0).rootPrimitive.onClick = function() { chat.print(You clicked the rst SolidObject.); }

position

The position as a Vector.


mySceneGroup.position = Vector (10, 5, -25);

orientation

The rotational orientation of the SceneGroup (as a Rotation).


// Rotate incrementally (10%) toward the players orientation // (see the Rotation module documentation for more): mySceneGroup.orientation = mySceneGroup.orientation.blend(player.orientation, 0.1);

transform

The Transform object representing the combined position and orientation.


// Smoothly animate between two EntryPoints // (including their orientations) over 100 frames: mySceneGroup.n = 0; mySceneGroup.timestep = function() { this.transform = entryPoint1.transform.blend(entryPoint2.transform, this.n++/100); } addAnimator(mySceneGroup);

worldSpacePosition

The worldSpacePosition of the object as a Vector.


// set the worldSpacePosition of the object to a known anchor myObject.worldSpacePosition = myAnchor3.worldSpacePosition;

worldSpaceOrientation

The worldSpaceOrientation of the object (as a Rotation).


// set the worldSpaceOrientation of the object to a known anchor myObject.worldSpaceOrientation = myAnchor3.worldSpaceOrientation;

worldSpaceTransform

The worldSpaceTransform is the combined worldSpacePosition and worldSpaceOrientation of the object.


// set the worldSpaceTransform of the object to a known anchor myObject.worldSpaceTransform = myAnchor3.worldSpaceTransform;

bounds

The min and max extent of the SolidObject in local coordinates, relative to the SolidObjects Eye position and orientation, expressed as an array of two Vectors [min, max].

318

APPENDIX E

// Make the spiders feet just touch the oor spider.y = oorHeight-spider.bounds[0].y;

opacity

The percentage value of opaqueness of the SolidObject. Valid values range from 0 to 1. (0.0, 0.125, 0.25, 0.375, 0.5, 0.625, 0.75, 0.875, 1.0)
// A ghost spider spider.opacity = .5;

transparentParity

Shifts the scanline at which the transparent masking pattern is displayed.


box1.transparentParity = 1; // see other boxes through this box2.transparentParity = 0; box3.transparentParity = 0;

useDynamicLighting

A boolean ag that when set to true enables the DistantLight dened in the script to modulate the lighting on the SolidObject.
// Dynamically light the spider spider.useDynamicLighting = true;

visible

A boolean ag that sets if the SolidObject is visible or not. Default is true.


spider.visible = false; // Hide the spider for now

ambientBrightness

The scale value that modulates the ambient term. Default is 0.


sphere = SceneGroup (./sphere.aer); solidObject = spheres[i].getSolidObject(0); solidObject.ambientBrightness = .1;

ambientColor

A Vector representing the color of the ambient term. Default is Vector(1, 1, 1).
sphere = SceneGroup (./sphere.aer); solidObject = spheres[i].getSolidObject(0); solidObject.ambientColor = Vector (.25, .25, .28);

diffuseBrightness

The scale value that modulates the brightness of the lighting from Distant Light sources. Default is 0.75.
sphere = SceneGroup (./sphere.aer); solidObject = spheres[i].getSolidObject(0); solidObject.diffuseBrightness = .6;

ADOBE ATMOSPHERE 319 User Guide

diffuseColor

A Vector representing the color to modulate the light coming from Distant Light sources. Default is Vector(1, 1, 1).
sphere = SceneGroup (./sphere.aer); solidObject = spheres[i].getSolidObject(0); solidObject.diffuseColor = Vector (1, 1, .98);

lightMapBrightness

The scale value that modulates the brightness of the objects light map. Default is 0.25.
sphere = SceneGroup (./sphere.aer); solidObject = spheres[i].getSolidObject(0); solidObject.lightMapBrightness = .35;

lightMapColor

A Vector representing the color to modulate the objects light map with. Default is Vector(1, 1, 1).
sphere = SceneGroup (./sphere.aer); solidObject = spheres[i].getSolidObject(0); solidObject.lightMapColor = Vector (1, 1, 1);

castShadowsOntoOthers

A boolean value that species whether this object will cast a shadow onto other objects in the scene. This property requires that dynamic lighting is enabled for the scene, and that this object and the shadow receiving object specify the property useDynamicLighting at true. The receiving object must also specify receiveShadows as true. Since dynamic lighting is very costly in regards to processing requirements, numerous lighting properties have been made available so that the world designer can tailor dynamic lighting behavior for their particular purposes.
solidObject.castShadowsOntoOthers = true;

castShadowsOntoSelf

A boolean value that species whether this object will cast a shadow onto itself. This property requires that dynamic lighting is enabled for the scene, and that the property useDynamicLighting is also set to true. Since dynamic lighting is very costly in regards to processing requirements, numerous lighting properties have been made available so that the world designer can tailor dynamic lighting behavior for their particular purposes.
solidObject.castShadowsOntoSelf = true;

receiveShadows

A boolean value that species whether this object will receive shadows. This property requires that dynamic lighting is enabled for the scene, and that the property useDynamicLighting is set to true. Since dynamic lighting is very costly in regards to processing requirements, numerous lighting properties have been made available so that the world designer can tailor dynamic lighting behavior for their particular purposes.

320

APPENDIX E

solidObject.receiveShadows = true;

Methods
createPhysicalModel(mass, inertiaScale)

A function that takes the current SolidObject geometry and creates a physical model with the given mass. Once created, the physical model will modify the tranform of the SolidObject object as it experiences external forces, collisions and constraints. For this version of the function, the physical model uses the full geometry of the SolidObject, which may slow down the physics simulation if done for many complex objects. The one exception is if the physical model is created with a mass of zero, in which case it will be xed in place, and will allow for efcient collision computations with other objects. Mass is a relative scale, and a density index of 1 per square foot of geometric volume is a reasonable starting point. For example, a box with thedimensions of [1x1x1] would be assigned a mass of 1. A box which is [2x2x2] would be assigned amass of 8, since the volume of the box is 8 square feet. It should be noted that for any of the physics based constraints or actions, there are conditions under which the physics processing may become unstable. Exerting very large forces on very lightobjects may cause the calculations to be driven out of scope(to innity). These conditions can be avoided by assigning reasonable mass values when creating the physical models, as described above. The designer should experiment with mass values and forces applied to insure that physics and javascript processing are not brought to a halt. The inertia scale may be used to scale the moment of inertia of the object. Sometimes constraints may be made more stable by scaling up the moments of inertia of the physical models that they affect.
boxPhysicalModel = boxSolidObject.createPhysicalModel(1, 1);

createConvexPhysicalModel(mass, inertiaScale)

A function that takes the current SolidObject geometry and creates a physical model with the given mass. The inertia scale may be used to scale the moment of inertia of the object. Sometimes constraints may be made more stable by scaling up the moments of inertia of the physical models that they affect. Once created, the physical model will modify the tranform of the SolidObject object as it experiences external forces, collisions and constraints. For this version of the function, the physical model uses the convex hull of the SolidObject object, which allows collisions to be much more efciently computed by the physics engine. Care should be given to following the guidelines for mass and inertia values as described in createPhysicalModel() above.
boxPhysicalModel = boxSolidObject.createConvexPhysicalModel(1, 1);

getPhysicalModel()

Gets the PhysicalModel created by the above methods.


boxPhysicalModel = boxObject.getPhysicalModel();

deletePhysicalModel()

Deletes the PhysicalModel created by the above methods, and removes all associated physics processing.

ADOBE ATMOSPHERE 321 User Guide


boxObject.deletePhysicalModel();

getParent()

Returns the parent SceneGroup; will return NULL if the given SceneGroup is the World.
theParent = SceneGroup.getParent();

getPrimitive(name)

Returns the rst Primitive with the given name from the SolidObjects array of primitives. Functionally equivalent to solidObject.rootPrimitive.nd(name).
myLongBox = mySolidObject.getPrimitive(LongBox);

mapLocalPositionToWorldPosition(Vector position)

Given a position Vector in local coordinates returns the corresponding position Vector in world-relative coordinates.
// Find the local space position of the wheel axle in the SceneGroup anchor = car.getPrimtive(wheel1); desiredOffset = anchor.position; // Place the wheel SceneGroup in world space wheel.position = car.getSolidObject(0).mapLocalPositionToWorldPosition(desiredOffset);

mapLocalTransformToWorldTransform(Transform)

Given a Transform in local coordinates returns the corresponding Transform in world-relative coordinates.
carRelativeTransform = Transform(Vector(0, 4, 6), Rotation(Z, 0.0)); theCarSolid = car.getSolidObject(0); box.transform = theCarSolid.mapLocalTransformToWorldTransform(carRelativeTransform);

SurfaceObject
A SurfaceObject is generated when a Viewpoint object is imported, and then Convert to Surface is selected from the Object menu in the Atmosphere authoring application. Converting a Viewpoint object to a SurfaceObject is useful in that the object can now recieve its lighting from the Atmoshpere lighting process (direction, brightness, etc.). Additionally, the object textures can also now be modied from within Atmosphere. Properties
type

The objects type; returns SurfaceObject.


if (foo.type == SurfaceObject) { ... }

name

Returns the name of the SurfaceObject assigned in the Application.


if (foo.name == myCoolSurfaceObject) { ... }

322

APPENDIX E

loaded

Returns true once the object has nished loading.


if (myObject.loaded) { ... }

parent

A reference to the SceneGroup containing the SurfaceObject


objectParent = SurfaceObject.parent;

attachedToParent

A ag that is set to true when a SurfaceObject is attached to a SceneGroup using the addTo() method. A SurfaceObject that is attached to its parent will be transformed with the parent. If this ag is then set to false, the child SurfaceObject will act as an independant SceneGroup.
box1 = SceneGroup(./box.aer); box2 = theWorld.getSurfaceObject(mySurfaceObject); loader = new Object() loader.timestep = function() { if (!box1.loaded && !box2.loaded) { return; } box1.add(); box2.addTo(box1); box1.physicalModel = box1.createPhysicalModel(5); box2.physicalModel = box2.createPhysicalModel(10); box2.attachedToParent = false; removeAnimator(this); } addAnimator(loader);

position

The position as a Vector.


SurfaceObject.position = Vector (10, 5, -25);

orientation

The rotational orientation of the SurfaceObject (as a Rotation).


SurfaceObject.orientation = anchor3.orientation;

transform

The Transform object representing the combined position and orientation.


// Smoothly animate between two EntryPoints // (including their orientations) over 100 frames:

ADOBE ATMOSPHERE 323 User Guide

SurfaceObject.n = 0; SurfaceObject.timestep = function() { this.transform = entryPoint1.transform.blend(entryPoint2.transform, this.n++/100); } addAnimator(SurfaceObject);

worldSpacePosition

The worldSpacePosition of the object as a Vector.


// set the worldSpacePosition of the object to a known anchor myObject.worldSpacePosition = myAnchor3.worldSpacePosition;

worldSpaceOrientation

The worldSpaceOrientation of the object (as a Rotation).


// set the worldSpaceOrientation of the object to a known anchor myObject.worldSpaceOrientation = myAnchor3.worldSpaceOrientation;

worldSpaceTransform

The worldSpaceTransform is the combined worldSpacePosition and worldSpaceOrientation of the object.


// set the worldSpaceTransform of the object to a known anchor myObject.worldSpaceTransform = myAnchor3.worldSpaceTransform;

bounds

The min and max extent of the SurfaceObject in local coordinates, expressed as an array of two Vectors [min, max].
// Make the spiders feet just touch the oor spider.y = oorHeight-spider.bounds[0].y;

includeInParentRigidBody

When the parent SceneGroup containing the SurfaceObject is used to create a physical model, this ag species whether the SurfaceObject should be included. If set to false, the SurfaceObject will not experience collisions, but will still be attached to the parent SceneGroup.
SurfaceObject.includeInModelRigidBody = false; newPM = parent.createConvexPhysicalModel(1.0);

useDynamicLighting

A boolean ag that when set to true enables the DistantLight dened in the script to modulate the lighting on the SurfaceObject.
// Dynamically light the spider spider.useDynamicLighting = true;

324

APPENDIX E

receiveShadows

A boolean value that species whether this object will receive shadows. This property requires that dynamic lighting is enabled for the scene, and that the property useDynamicLighting is set to true.
SurfaceObject.receiveShadows = true;

visible

A boolean ag that sets if the SurfaceObject is visible or not. Default is true.


spider.visible = false; // Hide the spider for now

Methods
createPhysicalModel(mass, inertiaScale)

A function that takes the current SurfaceObject geometry and creates a physical model with the given mass. Once created, the physical model will modify the tranform of the SurfaceObject object as it experiences external forces, collisions and constraints. For this version of the function, the physical model uses the full geometry of the SurfaceObject, which may slow down the physics simulation if done for many complex objects. The one exception is if the physical model is created with a mass of zero, in which case it will be xed in place, and will allow for efcient collision computations with other objects. Mass is a relative scale, and a density index of 1 per cubic foot of geometric volume is a reasonable starting point. For example, a box with thedimensions of [1x1x1] would be assigned a mass of 1. A box which is [2x2x2] would be assigned a mass of 8, since the volume of the box is 8 cubic feet. It should be noted that for any of the physics based constraints or actions, there are conditions under which the physics processing may become unstable. Exerting very large forces on very lightobjects may cause the calculations to be driven out of scope(to innity). These conditions can be avoided by assigning reasonable mass values when creating the physical models, as described above. The designer should experiment with mass values and forces applied to insure that physics and javascript processing are not brought to a halt. The inertia scale may be used to scale the moment of inertia of the object. Sometimes constraints may be made more stable by scaling up the moments of inertia of the physical models that they affect.
boxPhysicalModel = boxSurfaceObject.createPhysicalModel(1, 1);

createConvexPhysicalModel(mass, inertiaScale)

A function that takes the current SurfaceObject geometry and creates a physical model with the given mass. The inertia scale may be used to scale the moment of inertia of the object. Sometimes constraints may be made more stable by scaling up the moments of inertia of the physical models that they affect. Once created, the physical model will modify the tranform of the SurfaceObject object as it experiences external forces, collisions and constraints. For this version of the function, the physical model uses the convex hull of the SurfaceObject object, which allows collisions to be much more efciently computed by the physics engine. Care should be given to following the guidelines for mass and inertia values as described in createPhysicalModel() above.

ADOBE ATMOSPHERE 325 User Guide


boxPhysicalModel = boxSurfaceObject.createConvexPhysicalModel(1, 1);

getPhysicalModel()

Gets the PhysicalModel created by the above methods.


boxPhysicalModel = boxObject.getPhysicalModel();

deletePhysicalModel()

Deletes the PhysicalModel created by the above methods, and removes all associated physics processing.
boxObject.deletePhysicalModel();

getParent()

Returns the parent SceneGroup; will return NULL if the given SceneGroup is the World.
theParent = SceneGroup.getParent();

mapLocalPositionToWorldPosition(Vector position)

Given a position Vector in local coordinates returns the corresponding position Vector in world-relative coordinates.
// Find the local space position of the wheel axle in the SceneGroup anchor = car.getPrimtive(whee1); desiredOffset = anchor.position; // Place the wheel SceneGroup in world space wheel.position = car.getSurfaceObject(0).mapLocalPositionToWorldPosition(desiredOffset);

mapLocalTransformToWorldTransform(Transform)

Given a Transform in local coordinates returns the corresponding Transform in world-relative coordinates.
carRelativeTransform = Transform(Vector(0, 4, 6), Rotation(Z, 0.0)); theCarSurface = car.getSurfaceObject(0); box.transform = theCarSurface.mapLocalTransformToWorldTransform(carRelativeTransform);

ViewpointObject
A ViewpointObject is a SceneGroup which is imported into the Atmosphere Builder from an MTX le (and optional associated MTS le). It contains a reference to the full MTSScene which is described in both the MTX and MTS les (if present). The scene may contain geometries, transformations, textures, materials, time elements (animations), text objects, SWF movies, and other related XML properties. The Viewpoint object has a transform that positions it relative to its parent SceneGroup (or world space if attachedToParentModel is set to false). Methods are also available to dene a physical model which will cause the Viewpoint object to experience physical interaction with other objects. (Note that the current physical model will not alter its shape when animations are run in the ViewpointObject.)

326

APPENDIX E

Note that within a Viewpoint scene, the Z coordinate is reversed for position. Therefore, if a Viewpoint scene contains multiple instances, moving those instances relative to each other will require using an inverted Z value as compared to the normal Atmosphere coordinate system. Properties
type

Returns the string ViewpointObject for this object.


if (object.type == ViewpointObject) { ... }

position

The object position as an array of three values [ X, Y, Z ].


viewpointObject.position = [ 5, 2, 12 ];

orientation

The object orientation in radians as a Rotation object.


viewpointObject.orientation = Rotation(X, 1.2);

transform

The object transform representing the combined position and orientation values.
// Set by creating a Transform explicitly viewpointObject.transform = Transform([8.0, 8.0, -20.0], Rotation(XYZ, 1.57, 1.57, 1.57)); // Set equal to another Transform viewpointObject.transform = anchorPoint1.Transform;

worldSpacePosition

The worldSpacePosition of the object as a Vector.


// set the worldSpacePosition of the object to a known anchor myObject.worldSpacePosition = myAnchor3.worldSpacePosition;

worldSpaceOrientation

The worldSpaceOrientation of the object (as a Rotation).


// set the worldSpaceOrientation of the object to a known anchor myObject.worldSpaceOrientation = myAnchor3.worldSpaceOrientation;

worldSpaceTransform

The worldSpaceTransform is the combined worldSpacePosition and worldSpaceOrientation of the object.


// set the worldSpaceTransform of the object to a known anchor myObject.worldSpaceTransform = myAnchor3.worldSpaceTransform;

ADOBE ATMOSPHERE 327 User Guide

attachedToParent

Specied whether the Viewpoint object is attached to the parent SceneGroup. If the parent SceneGroup also contains a physical model, setting this ag to false will also remove the physical model of the Viewpoint object, and it will become as separate object.
viewpointObject.attachedToParent = false;

bounds

The bounds of the object in world coordinates, as an array of two Vectors [min, max].
// Hang the spider from the ceiling spider.y = room.bounds[0].y - 2;

includeInParentRigidBody

When the parent SceneGroup containing the Viewpoint object is used to create a physical model, this ag species whether the Viewpoint object should be included. If set to false,the Viewpoint object will not experience collisions, but will still be attached to the parent SceneGroup.
viewpointObject.includeInModelRigidBody = false; newPM = parent.createConvexPhysicalModel(1.0);

loaded

Returns true once the Viewpoint object (MTX and MTS data) has nished loading.
if (myObject.loaded) { ... }

name

Returns the object name as dened in the Builder application.


objectName = viewpointObject.name;

parent

Returns the parent SceneGroup which contains this Viewpoint object.


VPparent = viewpointObject.parent;

scene

Contains a reference to the entire scenegraph of the Viewpoint object. Returns an object of type MTSScene.
handInstance = viewpointObject.scene.getInstance(hand);

receivesMouseEvents

A ag specifying whether mouse events are to be handled by the interactors of the Viewpoint object. Default is true.
//Mouse events will not trigger the Viewpoint object viewpointObject.receivesMouseEvents = false;

addDynamicHighlights

A ag specifying whether dynamic highlighting should be applied to the Viewpoint object.


viewpointObject.addDynamicHighlights = true;

328

APPENDIX E

useDynamicLighting

A ag specifying whether dynamic lighting should be enabled for this Viewpoint object.
viewpointObject.useDynamicLighting = true;

visible

A ag specifying whether the Viewpoint object should be rendered in the scene.


viewpointObject.visible = false;

Methods
createPhysicalModel(mass, inertiaScale)

A function that takes the current Viewpoint geometry and creates a physical model with the given mass.Once created, the physical model will modify the tranform of the Viewpoint object as it experiences external forces, collisions and constraints. For this version of the function, the physical model uses the full geometry of the SceneGroup, which may slow down the physics simulation if done for many complex objects. The one exception is if the physical model is created with a mass of zero, in which case it will be xed in place, and will allow for efcient collision computations with other objects. Mass is a relative scale, and a density index of 1 per square foot of geometric volume is a reasonable starting point. For example, a box with thedimensions of [1x1x1] would be assigned a mass of 1. A box which is [2x2x2] would be assigned amass of 8, since the volume of the box is 8 square feet. It should be noted that for any of the physics based constraints or actions, there are conditions under which the physics processing may become unstable. Exerting very large forces on very lightobjects may cause the calculations to be driven out of scope(to innity). These conditions can be avoided by assigning reasonable mass values when creating the physical models, as described above. The designer should experiment with mass values and forces applied to insure that physics and javascript processing are not brought to a halt. The inertia scale may be used to scale the moment of inertia of the object. Sometimes constraints may be made more stable by scaling up the moments of inertia of the physical models that they affect.
boxPhysicalModel = boxViewPointObject.createPhysicalModel(1, 1);

createPhysicalModelForMTSInstance(mass, inertiaScale)

A function similar to above, but which can be used at the instance level (more specic). For example, in a viewpoint scene which contains a number of instances, thismethod can be applied to just one of those instances. In doing so, the physical model created and the instance itself will now be rendered and processed as a separate object. Care should be given to following the guidelines for mass and inertia values as described in createPhysicalModel() above.
boxPhysicalModel = boxInstance.createPhysicalModelForMTSInstance(1, 1);

createConvexPhysicalModel(mass, inertiaScale)

A function that takes the current Viewpoint geometry and creates a physical model with the given mass. The inertia scale may be used to scale the moment of inertia of the object. Sometimes constraints may be made

ADOBE ATMOSPHERE 329 User Guide

more stable by scaling up the moments of inertia of the physical models that they affect. Once created, the physical model will modfy the tranform of the Viewpoint object as it experiences external forces, collisions and constraints. For this version of the function, the physical model uses the convex hull of the Viewpoint object, which allows collisions to be much more efciently computed by the physics engine. Care should be given to following the guidelines for mass and inertia values as described in createPhysicalModel() above.
boxPhysicalModel = boxViewPointObject.createConvexPhysicalModel(1, 1);

createConvexPhysicalModelForMTSInstance(mass, inertiaScale)

A function similar to above, but which can be used at the instance level (more specic). For example, in a viewpoint scene which contains a number of instances, thismethod can be applied to just one of those instances. In doing so, the physical model created and the instance itself will now be rendered and processed as a separate object. Care should be given to following the guidelines for mass and inertia values as described in createPhysicalModel() above.
boxPhysicalModel = boxInstance.createConvexPhysicalModelForMTSInstance(1, 1);

toString()

Returns the name of the object (assigned in the Builder) as a string. If a name was not assigned,the type is returned.
objectName = ViewPointObject.toString();

getPhysicalModel()

Gets the PhysicalModel created by the above methods.


boxPhysicalModel = boxObject.getPhysicalModel();

deletePhysicalModel()

Deletes the PhysicalModel created by the above methods, and removes all associated physics processing.
boxObject.deletePhysicalModel();

getParent()

Returns the parent SceneGroup; will return NULL if the given SceneGroup is the World.
theParent = SceneGroup.getParent();

Callbacks
onClick(what, mods)

This function is called when the user clicks on the Viewpoint object. what is the lowest-level geometry that was hit. mods is an integer bitmask indicating modier keys (e.g., shift, control, etc..) which were down during the click event.
box.onClick = function(what, mods) { if (what.name == lid)

330

APPENDIX E

{ chat.print(You clicked on the boxs lid!); } else { chat.print(You clicked on the box!); } }

onMouseOver()

This function is called when the cursor rst hovers over the Viewpoint object.
viewpointObject.onMouseOver = function() { // get the objects border theBorder = viewpointObject.scene.getMaterial(border) // set the borders color to white theBorder.diffuseColor = [ 1.0, 1.0, 1.0 ]; }

onMouseOut()

This function is called when the cursor stops hovering over the Viewpoint object.
viewpointObject.onMouseOut = function() { // get the objects border theBorder = viewpointObject.scene.getMaterial(border) // set the borders color to dark grey theBorder.diffuseColor = [ 0.3, 0.3, 0.3 ]; }

Solid Object Structure


Face
A Face module represents a planar surface of a solid object. It includes the tangents and normals for both texture mapping and light mapping, and allows access to a surface texture if that is attached to the face. Properties
type

The objects type. Returns Face.


if (foo.type == Face) { ... }

normal

The faces normal Vector. This value is read-only.

ADOBE ATMOSPHERE 331 User Guide

objectFaceNo

The face number of the primitive. This value is read-only.


lightMapOrigin

The origin of the faces light map as a Vector. This value is read-only.
lightMapUTangent

The tangent to the light maps U-axis as a Vector. This value is read-only.
lightMapVTangent

The tangent to the light maps V-axis as a Vector. This value is read-only.
textureOrigin

The origin of the faces texture as a Vector. This value is read-only.


textureUTangent

The tangent to the textures U-axis as a Vector. This value is read-only.


textureVTangent

The tangent to the textures V-axis as a Vector. This value is read-only. Methods
getSurfaceTexture()

Returns the SurfaceTexture object attached to the face. Code Sample


box = SceneGroup(./box.aer).add(); loader = new Object(); loader.timestep = function() { if (box.loaded) { thePrimitive = box.solidObject.rootPrimitive; theFace = thePrimitive.getFace(0); theSurfaceTexture = theFace.getSurfaceTexture(); chat.print(Face chat.print(Face chat.print(Face chat.print(Face chat.print(Face chat.print(Face chat.print(Face chat.print(Face normal Vector: + theFace.normal); number: + theFace.objectFaceNo); light map origin: + theFace.lightMapOrigin); light map U-tangent: + theFace.lightMapUTangent); light map V-tangent: + theFace.lightMapVTangent); texture origin: + theFace.textureOrigin); texture U-tangent: + theFace.textureUTangent); texture V-tangent: + theFace.textureVTangent);

removeAnimator(this); }

332

APPENDIX E

} addAnimator(loader);

Primitive
A Primitive is a module used to represent a Builder group, anchor, entrypoint or geometric primitive. Every solid object has a rootPrimitive which is the top level group from the Builder le for that solid object. (Currently there is only one solid object per SceneGroup.) This root primitive may be searched by name to nd other primitives using the nd function. Anchors are a form of primitive often used to pass locations and orientations to scripts from the Builder. Other primitives will be actual geometry which will contain faces. Global Properties
rootPrimitive

The top-level group of a Solid Object.


stageModel.getSolidObject(0).rootPrimitive.onClick = function() { chat.print(You clicked the world); }

Properties
type

The objects type. Returns Primitive.


if (foo.type == Primitive) { ... }

subType

The primitives type. I.e. the type of solid it is in the Builder: Column, Box, Cone, etc.
if (foo.subYype == Column) { ... }

loaded

Boolean ag that is set to true when the Primitives owner SceneGroup is fully loaded and ready.
foo.timestep = function() { if (!this.loaded) { return; } // loaded, now do something } addAnimator(foo);

orientation

The orientation of the Primitive as set in the Builder, expressed as a Rotation. Presently this only applies to Entrypoints and Anchors.
root = stageModel.getSolidObject(0).rootPrimitive; anchor = root.nd(.../anchorPoint);

ADOBE ATMOSPHERE 333 User Guide

box = SceneGroup(./box.aer); box.orientation = anchor.orientation;

position

The position (or min of bounds) of the Primitive in the world, expressed as a Vector.
anchor = stageModel.getPrimitive(anchorPoint); box = SceneGroup(./box.aer); box.position = anchor.position;

transform

The Transform of the Primitive representing the combined position and orientation. Presently this only applies to Entrypoints and Anchors.
anchor = stageModel.getPrimitive(anchorPoint); box = SceneGroup(./box.aer); box.transform = anchor.transform;

name

The name attached to the primitive in the Builder.


if (foo.name == Head) { ... }

visibleInActorView

The boolean ag that mirrors the checkbox in the Builder Visible in Actor View.
if (foo.visibleInActorView) { chat.print(Primitive is visible); }

subtractive

The boolean ag that mirrors the checkbox in the Builder Subtractive.


if (foo.subtractive) { chat.print(Primitive is subtractive); }

bounds

The min and max extent of the Primitive in local coordinates, relative to the Primitives SceneGroups Eye position and orientation, expressed as an array of two Vectors [min, max].
min = foo.bounds[0]; max = foo.bounds[1];

334

APPENDIX E

volume = (max.x - min.x) * (max.y - min.y) * (max.z - min.z); chat.print(Primitives bounding-box volume is + volume);

children

An array of Primitives that are children to the given Primitive in the Builder object hierarcy. If children is undened the Primitive has no children.
if (foo.children == undened) { chat.print(Primitive has no children); } else { chat.print(First childs name is + foo.children[0].name); }

parent

The Primitives parent. If parent is undened then it is the rootPrimitive of the SolidObject.
if (foo.parent == undened) { chat.print(Primitive has no parent); } else { chat.print(Parents name is + foo.parent.name); }

Methods
nd(path)

Returns the rst descendant of this object which matches the specied path. The path is similar to a le path, where / separates each element, and where each element is one of: A name refers to the child with that name . refers to the current Primitive .. refers to the parent of the current Primitive ... refers to any number of elements (other than ..) * refers to any one element (other than ..)
root = stageModel.getSolidObject(0).rootPrimitive; rstTorch = root.nd(.../torch);

ndAll(path1, path2, path3, ...)

Similar to the method nd but returns an array of all the matching Primitives.
root = stageModel.getSolidObject(0).rootPrimitive; torches = root.ndAll (.../torch);

ADOBE ATMOSPHERE 335 User Guide

getFace(index)

Returns the Face of the Primitive at the given index.


billboard = stageModel.getPrimitive(Box); theFace = billboard.getFace(2);

getFaceCount()

Returns the number of Faces the Primitive has.


billboard = stageModel.getPrimitive(Box); numFaces = billboard.getFaceCount(); chat.print(The primitive has + numFaces + face(s));

getParentSceneObject()

Returns the parent SceneObject for this primitive. Currently, this object will be of type SolidObject only. (Future updates may enable many types of objects to have primitives.)
myPrimitiveParent = myPrimitive.getParentSceneObject();

toString()

Returns the name of the object (assigned in the Builder) as a string. If a name was not assigned, the type is returned.
for ( i=0 ; i < stageModel.getSolidObject(0).rootPrimitive.children.length ; i++ ) { chat.print( stageModel.getSolidObject(0).rootPrimitive.children[i].toString() ); }

Callbacks
onClick(string what, mods)

Called when the user clicks on the associated Primitive. what is the lowest-level WorldObject that was hit, which may differ from this if this is, e.g., a Group which contains a number of child Primitives. mods is an integer bitmask indicating modier keys (e.g., shift, control, etc..) which were down during the click event, and may contain other ags as well. The exact interpretation of mods is presently still under development and subject to change.
stageModel.getSolidObject(0).rootPrimitive.onClick = function(what) { if (what.name != null) { chat.print(You clicked on + what.name); } }

336

APPENDIX E

Materials
SurfaceTexture
A SurfaceTexture is a module used to represent the mapping between a texture image and a surface. It contains a reference to a Texture module, that contains the image, along with parameters that control the location, size and rotation angle of the texture relative to the surface. Texture swapping is enabled by changing the texture property to reference to a different texture object. A form of texture animation may be achieved by referencing a different texture object each time step. Properties
type

The objects type. Returns SurfaceTexture


if (foo.type == SurfaceTexture) { ... }

hasTexture

A boolean ag that is true when the SurfaceTexture has an attached texture, and false if the surface uses a texture color only. If there is no texture or surface color specied in the Builder application, the SurfaceTexture object will be undened, and this property will not be useful. Additionally, this property should not be used as a test for the presence of a texture object. Instead, test to see if getFace(n).getSurfaceTexture() is dened.
surfaceTextureType

The type of texturing scheme used on a particular face, either Texture or AnchoredTexture.
texture

The texture object that is attached to the SurfaceTexture.


offsetU

The offset of the diffuse texture map in U. Default is 0.


offsetV

The offset of the diffuse texture map in V. Default is 0.


rotationAngleInDegrees

The angle to rotate the texture around its origin.


sizeU

The size of a texture tile along U.


sizeV

The size of a texture tile along V.


wrapU

A boolean ag specifying whether the texture should wrap along U.


wrapV

A boolean ag specifying whether the texture should wrap along V.

ADOBE ATMOSPHERE 337 User Guide

Methods
getTexture()

Returns the Texture object attached to the surface. Code Sample


box = SceneGroup(./box.aer).add(); loader = new Object(); loader.timestep = function() { if(box.loaded) { aTexture = Texture(); aTexture.URL = http://www.myDomain.com/myHomePage/grass.gif; thePrimitive theFace theSurfaceTexture = box.solidObject.rootPrimitive; = thePrimitive.getFace(0); = theFace.getSurfaceTexture();

if (theSurfaceTexture.hasTexture) { chat.print(The SurfaceTexture has a texture.); chat.print(Its type is + theSurfaceTexture.surfaceTextureType); } theSurfaceTexture.sizeU = 2.0; theSurfaceTexture.sizeV = 2.0; theSurfaceTexture.offsetU = .25; theSurfaceTexture.offsetU = .75; theSurfaceTexture.rotationAngleInDegrees = 45; theSurfaceTexture.texture = aTexture; theTexture = theSurfaceTexture.getTexture(); removeAnimator(this); } } addAnimator(loader);

Texture
A Texture module is used to represent the image loaded to be used as a texture on a surface. The actual mapping is controlled using a SurfaceTexture module. The a string property (URLString) controls the source of the image le and another property (cached) controls whether the image is cached locally.

338

APPENDIX E

Global Methods
Texture()

The Texture constructor function, creates a new texture object.


tex = Texture();

Properties
type

The type of object, returned as Application.


tex = Texture(); chat.print(tex.type); // prints Texture to the chat console

cached

A boolean ag that determines if the image le loaded by a Texture object should be cached by the Player application. By default this is set to true.
tex = Texture(); tex.cached = true;

URL

The URL path of an image le to be loaded as a texture. Supports .PNG, .JPG, and .GIF graphic le formats. Note that the URL for a given texture can only be set once; attempting to change the URL will cause a JavaScript error. If it is desired to swap textures for a Surface Texture, create numerous texture objects with unique URLs, and then change the SurfaceTexture.texture property to reference any of the texture objects.
// texture object with absolute URL tex1 = Texture(); tex1.URL = http://myDomain.com/myHomePage/grass.gif; // texture object with relative URL tex2 = Texture(); tex2.URL = ./grid.jpg;

Methods
restartTextureLoad()

Reloads the image le designated by the Texture objects URL.


tex = Texture(); tex.URL = face.png; // ... tex.restartTextureLoad();

ADOBE ATMOSPHERE 339 User Guide

Viewpoint Object Structure


MTSBaseObject
These methods are inherited by all Viewpoint objects, and are useful for determining basic information about the object in question. Methods
getBaseMetatype()

Returns an integer that describes the Viewpoint type of the objects base class.
if ( a.baseMetatype() != b.baseMetatype() ) { chat.print(Not the same base type); }

getBaseMetatypeName()

Returns the Viewpoint base type as a 4-character string.


chat.print( Object base type = + a.getBaseMetatypeName() );

getMetatype()

Returns an integer that determines the Viewpoint type of the object.


if ( a.metatype() != b.metatype() ) { chat.print(Not the same type); }

getMetatypeName()

Returns a string that contains the Viewpoint type of the object as a 4-character string.
chat.print( Object type = + a.metatypeName() );

getName()

Returns the name of the object.


chat.print( This object is called + object.getName() );

getProperty(index or name)

Returns the value of a Viewpoint internal property either by index or via the 4-character name returned by getPropertyName(); below.
scale = object.getProperty(scl_); // - or scale = object.getProperty(2);

getPropertyCount()

Returns the number of properties for that object.

340

APPENDIX E

numProps = object.getPropertyCount();

getPropertyName(index)

Returns the 4-character name for the property for that index value.
propName = object.getPropertyName(2);

getPropertyType(index)

Returns the data type for the property for that index value as a long integer.
if ( a.getPropertyType(1) == a.getPropertyType(2) ) { chat.print (Same type); }

getPropertyTypeName(index)

Returns the data type for the property for that index value as a 4-character string.
chat.print( Type = + a.getPropertyTypeName() );

hasProperty(name)

Returns whether an object has the property with the 4-character string name.
hasScale = a.hasProperty(scl_);

setProperty(name, value)

Sets the named property with the supplied value.


a.setProperty( scl_, [1.0, 2.0, 3.0] );

MTSImageStream
An MTSImageStream object is used to represent a Viewpoint time element of type MTSImageStream. These time elements are typically used to load an image for a texture (MTSTexture). Using these methods, you can change the image based upon any given event without needing to reload the world, or the object. Properties
aolArt

America Online performs further compression on GIF and JPG images to aid in reducing download time. Atmosphere has the capacity to decompress these les. This boolean ag species whether the AOL image les should be decompressed. (Off by default)
VPobject = stageModel.getViewpointObject(plane1); timeElem = VPobject.scene.getTimeElem(imgStream); timeElem.aolArt = true;

path

Returns or sets the path for the timeElement. Note that in order to set or change the path, the timeElem must not be running.

ADOBE ATMOSPHERE 341 User Guide


timeElem.running = false; timeElem.path = http://www.mydomain.com/newPhoto.jpg; timeElem.running = true;

running

Returns or sets the running state of the timeElement.


curRunningState = timeElem.running

isStreaming

Returns the streaming state of the timeElement (is it actively streaming or not).
if (timeElem.isStreaming) { chat.print(Currently downloading the large image you requested...); }

MTSScene
An MTSScene object is used to represent the container for the instances, geometry and materials within a single Viewpoint object created by reading in an MTX le. This type of object also supports the methods and properties of MTSBaseObject. Global Properties
scene

The object representing a Viewpoint scene tree within a ViewpointObject.


dir(scene); // List all the parameters of the top level of the scene tree

Properties
antiAlias

Returns and controls whether antialiasing is active.


scene.antiAlias = 1;

edgeBias

Returns and controls the edge bias for antialiased rendering.


value = scene.edgeBias;

Methods
getInstance(index or name)

Gets a reference to the specied instance. The argument can either be a string or a numeric index.
leg = scene.getInstance(leg);

getInstanceFromIndex(index)

Gets a reference to the specied instance. The index must be an integer greater than or equal to zero.

342

APPENDIX E

leg = scene.getInstanceFromIndex(0);

getInstanceCount()

Returns the number of instances in the scene.


instanceCount = scene.getInstanceCount();

getRepository()

Gets a reference to the scene repository.


repository = scene.getRepository();

getTimeElem(index or name)

Gets a reference to the specied time element. The argument can either be a string or a numeric index.
walkTimeElem = scene.getTimeElem(Walking);

getTimeElemFromIndex(index)

Gets a reference to the specied time element. The index must be an integer greater than or equal to zero.
walkTimeElem = scene.getTimeElemFromIndex(0);

getTimeElemCount()

Returns the number of time elements (animations) in the scene.


animCount = scene.getTimeElemCount();

resetTimeElem()

Resets a named time element to the beginning of its time interval and evaluates the time.
scene.resetTimeElem(Walking);

rewindTimeElem()

Rewinds a named time element to the beginning of its time interval but does not evaluate the time.
scene.rewindTimeElem(Walking);

startTimeElem()

Starts a named time element playing from its current time value.
scene.startTimeElem(Walking);

stopTimeElem()

Stops a named time element at its current time value.


scene.stopTimeElem(Walking);

triggerTimeElem()

Rewinds and starts a named time element playing from the beginning of its time interval.
scene.triggerTimeElem(Walking);

ADOBE ATMOSPHERE 343 User Guide

MTSGeometry
An MTSGeometry object is used to represent a Viewpoint surface. This object also supports the methods and properties of MTSBaseObject. Properties
backFaceCull

Enables back-face culling during rendering. This will make closed surfaces render more quickly, but may look strange with open surfaces.
geometry.backFaceCull = true;

backFaceDirection

Determines the backface culling sense.


geometry.backFaceDirection = 1;

creaseAngle

The crease angle parameter controls the degree of simplication of the geometry.
geometry.creaseAngle = 5.0;

zBuffer

Enables the use of z-buffering when rendering (and is recommended).


geometry.zBuffer = true;

Methods getTriangleCount() Returns the count of the triangles used to represent the object.
numTriangles = geometry.getTriangleCount();

getVertexCount()

Returns the number of vertices present in the object.


numVertexes = geometry.getVertexCount();

MTSInstance
An MTSInstance object is used to represent a Viewpoint instance within a Viewpoint object scene. Such an instance contains a reference to a piece of geometry, along with one or more materials and one or more transformations. An instance also constains an array of child instances. This type of object also supports the methods and properties of MTSBaseObject.

344

APPENDIX E

(Note that within a Viewpoint scene, the Z coordinate is reversed for position. Therefore, if a Viewpoint scene contains multiple instances, moving those instances relative to each other will require using an inverted Z value as compared to the normal Atmosphere coordinate system.) Properties
position / location

contains the position for the instance as an array of three values. (The identical property location is also maintained for backward compatibility.)
instance.location = [1.0, 2.0, 1.0];

rotationAnglesInDegrees

contains the rotation angles in degrees as an array of three values.


instance.rotationAnglesInDegrees = [xAngle, yAngle, zAngle];

rotationAnglesInRadians

contains the rotation angles in radians as an array of three values.


instance.rotationAnglesInRadians = [xAngle, yAngle, zAngle];

opacity

contains the opacity values (1 - transparency). Note that opacity is not recursive down the instance tree, but applies only to the instance which is directly set.
instance.opacity = 0.75;

remove

is set to remove the object from the scene during rendering.


instance.remove = true;

scale

contains the scale factors along x, y and z as an array of three values.


instance.scale = [xScale, yScale, zScale];

visible

contains the ag for whether the object is drawn. Note that visibility is not recursive down the instance tree, but applies only to the instance which is directly set.
instance.visible = false;

prelite

controls whether the edge highlight (prelite) of a geometry is visible.


instance.prelite = true;

preliteColor

controls the preliteColor in an array of three values.

ADOBE ATMOSPHERE 345 User Guide


instance.preliteColor = [ 1, 0, 0, ]; //set to red

usePreliteColor

switches between the default value or the newly dened color.


instance.usePreliteColor = true; //use newly dened color

renderLayer

controls the order in which layers are rendered.


sphereIns.renderLayer coneIns.renderLayer boxIns.renderLayer = 0; = 1; = 2;

Methods
getChild(index or name)

gets the child instance specied by the name or index.


childInstance = instance.getChild(Foot);

getChildCount()

gets the number of child instances


numChildren = instance.getChildCount();

getGeometry()

returns a reference to the geometry used by the instance.


geometry = instance.getGeometry();

getInstance2d - or getGeometry2d()

contains the 2d text object dened using LayerData in an instance.


textObject = instance.getInstance2d(); //get the LayerData object

getMaterial(index or name)

gets a reference to the material with the name or index.


paintMaterial = instance.getMaterial(paint);

getMaterialCount()

gets the number of materials associated with the instance.


numMaterials = instance.getMaterialCount();

346

APPENDIX E

MTSTexture
An MTSTexture object is used to represent a Viewpoint texture, which may be used by a Viewpoint material to control the appearance of a surface. This object also inherits all the methods of the MTSBaseObject. Properties
scaleX

Species the texture scale in the horizontal direction.


textureObj.scaleX = 3;

scaleX

Species the texture scale in the vertical direction.


textureObj.scaleY = 5;

translateX

Change the origin of the texture in the horizontal direction where 1.0 is the width of the texture cell.
textureObj.translateX = 0.5; //offset the texture by horizontally by 50%

translateY

Change the origin of the texture in the vertical direction where 1.0 is the height of the texture cell.
// offset the texture vertically by 20% textureObj.translateY = 0.2;

llColor

Specify the ll color for the texture as an array of three values [ R, G, B ]. Note that setting this property will cover the texture with the color specied. The texture can be exposed again by resetting the texture path using the MTSImageStream property path.
// set to red textureOjb.llColor = [ 1, 0, 0 ];

size

Returns the size of the image as stored in the Viewpoint buffer. (Does not necessarily represent the original image size. See the methods below to obtain exact pixel dimensions of the image used for the texture.)
[localPropertyCodeSample]

mip

Returns whether the texture object is using MipMapping (specied in the MTX le).
isMipped = textureObj.mip;

mipBias

Sets the Mip bias for the texture object (if Mipmapping is enabled in the MTX le). Mipmapping causes the texture to appear blurred at a distance, and helps to eliminate pixelation anomalies during rendering. Typical appropriate values range from 0.25 to 8.0.

ADOBE ATMOSPHERE 347 User Guide


textureObj.mipBias = 0.5;

Methods
getHeight()

Returns the original vertical size in pixels of the image used for the texture object.
imageHeight = textureObj.getHeight();

getWidth()

Returns the original horizontal size in pixels of the image used for the texture object.
imageWidth = textureObj.getWidth();

MTSInstance2d
An MTSInstance2D object is used to represent a Viewpoint text object. The text may be attached to an Atmosphere object in 3D, or may be placed in a xed position in the display window. (See the instructions for dstPin below.) The geometry object must be rst dened in an XML description le. (It is dened using a <LayerData> tag of a Viewpoint instance. The instance must also contain a geometry tag describing the type of Viewpoint geometry.) Once loaded nearly all aspects of the text object may be modied in real time. It is important to note that the attribute AlwaysVisible=1 must be present in the MTX description le in order for the text to be displayed in Atmosphere. (Text created with the Viewpoint Scene Builder application has this attribute off (0) by default, but can be set to on (1) using the command Show Hot Spot text in the Hot Spot menu.) Properties
text

Species the content (the actual words) to be displayed by the text object.
textObj.text = Hello world!;

textSize

Species the text size, which corresponds directly to the Windows Font size.
textObj.textSize = 24 // set font to size 24

textColor

Contains the text color as an array of three values [ R, G, B ].


textObj.textColor = [ 0, 0, 1 ] // blue text

font

Species the font to be used by the text object. Any Windows font which appears in the Control Panel may be utilized. The default font used by Atmosphere will be the same as the users current default system font.
textObj.font = Times New Roman;

348

APPENDIX E

bold

Apply or remove this font style to the text object. (Default is false, or off.)
textObj.bold = true;

italic

Apply or remove this font style to the text object. (Default is false, or off.)
textObj.italic = true;

underline

Apply or remove this font style to the text object. (Default is false, or off.)
textObj.underline = true;

strikeout

Apply or remove this font style to the text object. (Default is false, or off.)
textObj.strikeout = false;

center

Species the offset of the text object around the geometry as an array of three values [ X, Y, Z ]. Note that these values may be overwritten by the radius property, if it is also present. The last property to be specied (radius or center) is what will take precedent.
textObj.center = [ 5, 2, 0 ];

textAlign

Sets the alignment of text relative to the end of the geometry pointer line. (left aligned = -1; centered = 0; right aligned = 1;)
textObj.textAlign = -1;

anchor

Species the location of the end of the pointer line to the text object as an array of two values [ X, Y ].
textObj.anchor = [ 0.7, 0 ];

radius

Species the distance from the geometry to the text object. Note that this value may be overwritten by the center property, if it is also present. The last property to be specied (radius or center) is what will take precedent.
textObj.radius = 10;

trackPoint

Species the location of the end of the pointer line on the instance as an array of three values [ X, Y, Z ].
textObj.trackPoint = [ 0, 2, 0 ];

ADOBE ATMOSPHERE 349 User Guide

dstPin

For text which is xed in the window space(immovable), this property species the distance from the window corner in pixels as an array of two numbers [ X, Y ]. The distance may also be specied as a percentage of the window size using dstPinRelative = true (shown below). Note that in order for text to be xed in the window space, the Viewpoint XML le which denes the text object must also contain these two properties: AnchorWidget = 1 WidgetLine = 0 The second property removes the pointer line which connects the text to the geometry from which it originates. Also, the default origination for xed text is the top left corner of the window. A different origin may be specied using dstPinFlag shown below.
textObj.dstPin = [ 100, -50 ];

dstPinFlag

Species which corner of the window should be used as the point of origination for text which is xed in the window: 0 = top left (the default origin) 1 = top right 2 = bottom left 3 = bottom right
// set the text origin to bottom right textObj.dstPinFlag = 3

dstPinRelative

Causes the property dstpin (above) to use a percentage of window size, where 1.0 equals 100%. When this property is false, dstPin returns to using absolute pixels.
textObj.dstPinRelative = true;

shadow

Applies a transparent drop shadow to the text object.


textObj.shadow = true;

shadowColor

Sets the color of the text drop shadow as an array of three values [ R, G, B ].
// green shadow text textObj.shadowColor = [ 0, 1, 0 ];

shadowRadius

Sets the radius in pixels of the text drop shadow.


textObj.shadowRadius = 3;

350

APPENDIX E

alwaysVisible

Returns whether the text will always be visible in Atmosphere, or will only show during a MouseOver event. Note that for this release, changing this property has no effect and should be considered read only. Its also important to note that this attribute must be present in the MTX description le, and set to 1 in order for the text to be visible in Atmosphere.
bIsVisible = textObj.alwaysVisible;

MTSMaterial
An MTSMaterial is an object used to represent a Viewpoint material. This allows for control of different aspects of a surfaces appearance including surface and bump textures, specular and diffuse shading coefcients and opacity. An MTSMaterial object also supports all the methods of MTSBaseObject. Properties
ambientColor

Species the ambient color of the material as an array of three values [ R, G, B ].


material.ambientColor = [ 0, 0, 0.5 ]; //set to 50% blue

bumpStrength

Scales the apparent depth of the bump map on the surface of the geometry.
material.bumpStrength = 0.7; //set bump strength to 70% intensity

bumpTextureName

Returns the value of the name property for the bump texture.
btName = material.bumpTextureName;

diffuseColor

Species the diffuse color of the material as an array of three values [ R, G, B ]. When rendermode is set to 12 (see below), the diffuse color is composited (combined) with the diffuse texture.
material.diffuseColor = [1.0, 0.0, 0.0]; //set the diffuse color to red.

diffuseTextureName

Returns the value of the name property for the diffuse texture.
dtName = material.diffuseTextureName;

emmissiveColor

Species the emissive color as an array of three values [ R, G, B ].


material.emmissiveColor = [ 0, 1, 0 ]; //set to green

environmentTextureName

Returns the value of the name property for the environment texture.
name = material.environmentTextureName;

ADOBE ATMOSPHERE 351 User Guide

opacity

Sets the opacity of a material ( 0.0 - 1.0 ) , which allows the underlying geometry to appear transparent.
material.opacity = 0.2; //Nearly transparent

renderMode

Changes the manner in which the Viewpoint scene is rendered. The following settings are most commonly used: renderMode = 1024 (default) renderMode = 7; (wireframe) renderMode = 8; (points & lines) renderMode = 11; (full) renderMode = 12; (color & texture composite)
material.renderMode = 12; //composite the diffuse color and diffuse texture

specularCoefcient

Species the specular coefcient of the material.


material.specularCoefcient = 10.0;

specularColor

Species the specular color to be used on the material as an array of three values [ R, G, B ]. A bright or white value gives the appearance of a hard or smooth surface.
material.specularColor = [0.3, 0.3, 0.3]; // Future enhancement

Methods
getBumpTexture()

Gets a reference to the bump texture used by the material, if present.


material.getBumpTexture()

getDiffuseTexture()

Gets a reference to the diffuse texture used by the material, if present.


material.getDiffuseTexture()

MTSTimeElem
An MTSTimeElem object is used to present a Viewpoint time element or animation object. Note that these objects are called TimeElem in the MTX le. This type of object also supports the methods and properties of MTSBaseObject. Properties
pauseTime

The ag to control whether the animation is paused. If set to true, while running is also set to true, this ag allows the animator to be set (and rendered) to a particular time.

352

APPENDIX E

// Pause the time element prior to setting the time timeElem.pauseTime = true;

time

The time used to evaluate the animation when timeElem.pauseTime and timeElem.running are both set to true.
// Evaluate the animation at time 1.5 seconds timeElem.time = 1.5;

timeIncrement

The timeIncrement used to update the animation when pauseTime and running are both set to true. It is best to leave this value at zero when evaluating an animation directly using time in a script.
// Increment the time by 0.0 per frame // since we update time in the script timeElem.timeIncrement = 0.0;

speed

The speed at which the animation is to play back when running. This value may be changed continuously such as when adjusting walking speed.
// Play back the animation at 70% of the normal speed timeElem.speed = 0.7;

duration

If the TimeElem has a metatype of kgrp then it is a keyframe group and has a corresponding duration given by this property.
// returns the duration as a oat in seconds walkTime = timeElem.duration;

running

The ag to control whether the animation is currently running.


// Set the time element to run timeElem.running = true;

Methods
start()

Tells the time element to increment time with each frame update and to evaluate itself.
timeElem.start ();

stop()

Tells the time element to no-longer increment time with each frame update.
timeElem.stop ();

rewind()

Sets the time value for the time elements to the beginning of the interval but does not evaluate the time element.

ADOBE ATMOSPHERE 353 User Guide


timeElem.rewind ();

trigger()

Tells the time element to rewind and start playing.


timeElem.trigger ();

setSpeed()

Sets the speed of the time element and all its children.
timeElem.setSpeed (0.5);

setPlayOnce()

Set the play once ag, that if true, tells the time element to play once and then stop.
timeElem.setPlayOnce (false);

getChild(index or name)

Gets the child time element specied by the name or index.


child = timeElem.getChild (Foot);

getChildCount()

Gets the number of child time elements.


numChildren = timeElem.getChildCount ();

MTSTimeElemSWFView
An MTSTimeElemSWFView is used to represent a Viewpoint Time Element of type SWFView. An SWFView contains an SWF vector-based animation and renders it into a surface texture each timestep. This object also inherits all the methods of the MTSBaseObject. Properties
running

Controls whether the SWF movie is playing.


isRunning = SWFtimeElem.running;

pauseTime

Pauses time at the current location in the SWF movie.


SWFtimeElem.pauseTime = true;

realTime

Attempts to drops frames as necessary to maintain movie animation rate.


SWFtimeElem.realTime = true;

354

APPENDIX E

time

Moves the SWF movie to the specied time, and renders it. Note that the movie must be paused for this property to have an effect.
SWFtimeElem.time = 5; //render the movie at the 5 second mark

loop

Causes the SWF movie to loop continously from beginning to end when playing.
SWFtimeElem.loop = true;

opacity

Sets the opacity of the SWF movie where 1 = 100%.


SWFtimeElem.opacity = 0.5; //set to 50% opacity

comp

Composites the movie frame by frame. This causes the movie to only update changed portions of the frame, without redrawing the entire movie area.
SWFtimeElem.comp = true;

clip

Sets the clipping state of the SWF movie.


SWFtimeElem.clip = true;

base

Returns the path of the folder in which the SWF movie resides.
rootFolder = SWFtimeElem.base;

path

Returns the full path of the SWF movie le.


moviePath = SWFtimeElem.path;

Methods
start()

Starts playing the SWF movie from the last position stopped.
SWFtimeElem.start();

stop()

Stops the SWF movie.


SWFtimeElem.stop();

rewind()

Rewinds the SWF movie to the beginning. Note that the movie area will not be updated until you call start() again.

ADOBE ATMOSPHERE 355 User Guide


SWFtimeElem.rewind();

trigger()

Rewinds the SWF movie to the beginning and also starts the movie playing.
SWFtimeElem.trigger();

setSpeed()

Sets the speed of the SWF movie where 1 = 100%.


//run the movie at 50% speed SWFtimeElem.setSpeed(0.5);

setPlayOnce()

Flags the movie to play only one time.


SWFtimeElem.setPlayOnce(true);

reverseDirection()

Sets the SWF movie to play backwards.


SWFtimeElem.reverseDirection(true);

getChild(index or name)

Gets the child Time Element specied by index or name.


secondChild = SWFtimeElem.getChild(1); // or otherMovie = SWFtimeElem.getChild(smallSWF);

getChildCount()

Returns the number of children Time Elements contained by this parent.


totalTimeElems = SWFtimeElem.getChildCount();

Physics
FastConstraintSolver
A FastConstraintSolver is an object that contains a list constraints or actions between physical models. During physics simulation, the FastConstraintSolver tries to satisfy all of the requirements for each listed contraint/action by changing the position, orientation, and velocity of the physical models affected. After creating a new FastConstraintSolver using the global method, the Solver has Local methods which are then used to create different types of constraints and actions. Once a constraint/action is created, it must be added to an existing Solver list using the Add...() methods shown below. Several guidelines should be considered when determining which constraints or actions should be added to an existing Solver:

356

APPENDIX E

Any physical model involved in a constraint or action should have all of its constraints and actions included in the same FastConstraintSolver. Faster processing may be achieved if unrelated constraints belong to different solvers, such as a hingeConstraint for a door and a wheelConstraint for a vehicle. Constraints and Actions may also be removed or re-added to a Solver list following creation.

(Angular Dashpots and Actions are not constraints by denition, but need to be processed and included in a FastConstraintSolver.) Global Methods
FastConstraintSolver()

Creates and returns a new FastConstraintSolver.


solver = FastConstraintSolver();

Local Methods
createHingeConstraint(PhysicalModel, PhysicalModel)

Creates and returns a new HingeConstraint between the two PhysicalModels. This constraint imitates the common concept of a hinge, such as is used on a door or lid.
solver = FastConstraintSolver(); constraint = solver.createHingeConstraint(a.physicalModel, b.physicalModel); solver.addConstraint(constraint);

createPointToPointConstraint(PhysicalModel, PhysicalModel)

Creates and returns a new PointToPointConstraint between the two PhysicalModels.


solver = FastConstraintSolver(); constraint = solver.createPointToPointConstraint(a.physicalModel, b.physicalModel); solver.addConstraint(constraint);

createPrismaticConstraint(PhysicalModel, PhysicalModel)

Creates and returns a new PrismaticConstraint between the two PhysicalModels. This constraint limits an object to a single direction of movement, such as is used in a sliding door.
solver = FastConstraintSolver(); constraint = solver.createPrismaticConstraint(a.physicalModel, b.physicalModel); solver.addConstraint(constraint);

createStiffSpringConstraint(PhysicalModel, PhysicalModel)

Creates and returns a new StiffSpringConstraint between the two PhysicalModels.


solver = FastConstraintSolver(); constraint = solver.createStiffSpringConstraint(a.physicalModel, b.physicalModel); solver.addConstraint(constraint);

ADOBE ATMOSPHERE 357 User Guide

createWheelConstraint(PhysicalModel, PhysicalModel)

Creates and returns a new WheelConstraint between the two PhysicalModels. The rst PhysicalModel is the chassis, the second is the wheel.
solver = FastConstraintSolver(); constraint = solver.createWheelConstraint(frame.physicalModel, wheel.physicalModel); solver.addConstraint(constraint);

addConstraint(constraint)

Adds the constraint to the Solver for calculation.


solver.addConstraint(constraint);

removeConstraint(constraint)

Removes the constraint from the Solver.


solver.removeConstraint(constraint);

createBreakableConstraint(Constraint, linearStrength, angularStrength)

Creates a BreakableConstraint which is added to an existing constraint. This unique type of constraint acts as an arbitrator that determines if a given constraint should remain active. Values for angularStrength and linearStrength specify the forces beyond which the constraint will be abandoned, and the physical models will break apart.
solver = FastConstraintSolver(); constraint = solver.createWheelConstraint(frame.physicalModel, wheel.physicalModel); solver.addConstraint(constraint); breakableConstraint = solver.createBreakableConstraint(constraint, 50, 50); solver.addConstraint(breakableConstraint);

createAngularDashpot(PhysicalModel, PhysicalModel)

Creates and returns a new AngularDashpot between the two PhysicalModels.


solver = FastConstraintSolver(); angularDashpot = solver.createAngularDashpot(a.physicalModel, b.physicalModel);

addAngularDashpot(AngularDashpot)

Adds the AngularDashpot to the solver for calculation.


solver = FastConstraintSolver(); angularDashpot = solver.createAngularDashpot(a.physicalModel, b.physicalModel); solver.addAngularDashpot(angularDashpot);

removeAngularDashpot(AngularDashpot)

Removes the AngularDashpot from the solver.


solver = FastConstraintSolver(); angularDashpot = solver.createAngularDashpot(a.physicalModel, b.physicalModel); solver.addAngularDashpot(angularDashpot); solver.removeAngularDashpot(angularDashpot);

358

APPENDIX E

createDragAction()

Creates and returns a new DragAction.The action has the effect of slowing down the momentum of objects for both direction and rotation.
solver = FastConstraintSolver(); velocityDrag = 1; angularVelocityDrag = 1; dragAction = solverA.createDragAction(velocityDrag, angularVelocityDrag); solverA.addAction(dragAction);

createFluidAction()

Creates and returns a new FluidAction. A Fluid Action causes all dynamic physical models in the world to behave as though the world were lled with a uid.
solver = FastConstraintSolver(); uidAction = solver.createFluidAction(); uidAction.damping = 1; solver.addAction(uidAction);

createMagneticAction(strength, falloff, angle, maxDistance, position, direction)

Creates and returns a new MagneticAction. This action simulates the effect of magnetic attraction or repulsion on physical models. Note that only active, falloff , and strength may be modied following the creation of the Magnetic Action. All other properties are specied at creation time only, and remain constant thereafter.
strength falloff angle maxDistance position direction = = = = 100; 0; 2.0 * 3.1415927; 100;

= Vector( 0, 0, 0 ); = Vector( 0, 0, 0 );

solver = FastConstraintSolver(); magAction = solver.createMagneticAction(strength, falloff, angle, maxDistance, position, direction); magAction.addPhysicalModel(box.physicalModel); magAction.addPhysicalModel(cone.physicalModel); solver.addAction(magAction);

createMotorAction(PhysicalModel, axis, spinRate, gain, maxTorque)

Creates and returns a new MotorAction. This action simulates the effect of wind on a physical model.
axis = Vector( 0, 0, 0 ); spinRate = 3.0; gain = 3.0; maxTorque = 3.0; solver = FastConstraintSolver(); motorAction = solver.createMotorAction(PhysicalModel, axis, spinRate, gain, maxTorque); solver.addAction(motorAction);

ADOBE ATMOSPHERE 359 User Guide

createSimpleRigidWindAction(PhysicalModel, direction, strength)

Creates and returns a new SimpleRigidWindAction. This action simulates the effect of wind on a single physical model. (Additional wind actions may be created.)
direction strength solver = Vector( 0, 0, -1.0 ); = 3.0; = FastConstraintSolver();

windAction = solver.createSimpleRigidWindAction(PhysicalModel, direction, strength); solver.addAction(windAction);

createSingleDragAction()

Creates and returns a new SingleDragAction. The effect is that of slowing down the momentum of the object for both direction and rotation. This action differs from DragAction in that the effect is limited to a single physical model.
solver = FastConstraintSolver(); velocityDrag = 1; angularVelocityDrag = 1; dragAction = solverA.createSingleDragAction(velocityDrag, angularVelocityDrag); solverA.addAction(dragAction);

addAction(action)

Adds the action to the Solver for calculation.


solver.addAction(action);

removeAction(action)

Removes the action from the Solver.


solver.removeAction(action);

AngularDashpot
An angular dashpot is a physical entity that applies torques to two physical models in proportion to the degree to which they are away from a preferred relative orientation. They may be thought of as angular springs whose torque depends on the relative orientation and difference in angular velocity between the two physical models. The preferred relative orientation is set using a rotation object. It should be noted that for any of the physics based constraints or actions, it is necessary to assign reasonable mass values when creating the physical models so that physics processing does not become unstable (driven out of scope). The guidelines for mass and inertia are decribed in the method createPhysicalModel(). Properties
damping

The level of damping of the dashpot.


angularDashpot.damping = 0.5;

360

APPENDIX E

strength

The strength or stiffness of the dashpot.


angularDashpot.damping = 0.5;

Methods
setRotation(rotation)

Sets the desired resting rotation relative to the rst PhysicalModels coordinate frame.
angularDashpot.setRotation( Rotation(Z, 0.01) );

Code Sample
box1 = SceneGroup(./box.aer).add(); box2 = SceneGroup(./box.aer).add(); loader = new Object(); loader.timestep = function() { if(box1.loaded && box2.loaded) { box1.physicalModel = box1.createPhysicalModel(1); box2.physicalModel = box2.createPhysicalModel(1); solver = FastConstraintSolver(); angularDashpot = solver.createAngularDashpot(box1.physicalModel, box2.physicalModel); angularDashpot.damping = 0.5; angularDashpot.strength = 0.5; rotationValue = Rotation(Z, 0.00000001); angularDashpot.setRotation(rotationValue); solver.addAngularDashpot(angularDashpot); removeAnimator(this); } } addAnimator(loader);

Actions
DragAction
A Drag Action is a subtle force that is applied to all dynamic physical models in the world. The effect is that of slowing down the momentum of objects for both direction and rotation. A Drag Action is created by a method of the FastCon straintSolver(),and has global properties for velocity and angular velocity of drag (maximum = 1).

ADOBE ATMOSPHERE 361 User Guide

It should be noted that for any of the physics based constraints or actions, it is necessary to assign reasonable mass values when creating the physical models so that physics processing does not become unstable (driven out of scope). The guidelines for mass and inertia are decribed in the method createPhysicalModel(). Local Properties
angularVelocityDrag

The strength of the drag as it applies to object angular velocity (rotation).


dragAction.angularVelocityDrag = 1;

velocityDrag

The strength of the drag as it applies to object velocity.


dragAction.velocityDrag = 1;

Code Sample
solverA = FastConstraintSolver(); velocityDrag = 1; angularVelocityDrag = 1; dragAction = solverA.createDragAction( velocityDrag, angularVelocityDrag ); solverA.addAction(dragAction);

FluidAction
A Fluid Action causes dynamic physical models in the world to behave as though the world were lled with a uid. The effect is more signicant than a Drag Action, and similarly applied to both the direction and rotation of objects. A Fluid Action is created by a method of the FastConstraintSolver(), and has a global scalar property for damping. It should be noted that for any of the physics based constraints or actions, it is necessary to assign reasonable mass values when creating the physical models so that physics processing does not become unstable (driven out of scope). The guidelines for mass and inertia are decribed in the method createPhysicalModel(). Local Properties
damping

A property representing the effective viscosity of the uid (water ~ 1). Code Sample
solverA = FastConstraintSolver(); uidAction = solverA.createFluidAction(); uidAction.damping = 1;

362

APPENDIX E

MagneticAction
The MagneticAction simulates the effect of magnetic attraction or repulsion on physical models. The action is created by a method of the FastConstraintSolver, and the source position of the effect is specied as a vector. The effect may be applied to as many SceneGroups as desired using the addPhysicalModel(modelName) method. Note that only three of the properties may be modied following the creation of the Magnetic Action; active, falloff , strength. All other properties are specied at creation time only, and remain constant (affected properties are noted below for convenience.) It should be noted that for any of the physics based constraints or actions, it is necessary to assign reasonable mass values when creating the physical models so that physics processing does not become unstable (driven out of scope). The guidelines for mass and inertia are decribed in the method createPhysicalModel(). Properties
active

A boolean ag controlling whether the magnetic effect is currently processed. (default = true)
magneticAction.active = true;

angle

The cone angle around which the magnetic effect will be experienced (specied in Radians). [Note: this property is specied at creation time only, and remains constant.]
angle = (2.0 * 3.1415927);

falloff

Species the rate at which the magnetic forces will decrease with distance.
magneticAction.falloff = 0;

direction

The direction the magnetic force is aimed (as a Vector). Note that this value only has meaning if the angle property (described above) is reduced from 360 degrees (specied in radians). [Note: this property is specied at creation time only, and remains constant.]
direction = Vector( 0.0, 0.0, -1.0 ); //straight away in Z

maxDistance

The distance beyond which no magnetic force is experienced (specied in feet). [Note: this property is specied at creation time only, and remains constant.]
maxDistance = 100;

position

The source position of the the magnetic force (as a Vector). [Note: this property is specied at creation time only, and remains constant.]
magCenter = theStage.getPrimitive(magCenter);

ADOBE ATMOSPHERE 363 User Guide


position = magCenter.position;

strength

The relative strength of the magnetic force. Positive values result in an attractive force, and negative values apply a repulsive force. Useful range is between -1000 and 1000.
magneticAction.strength = 200;

Local Methods
addPhysicalModel (PhysicalModel)

Species a PhysicalModel which will experience the Magnetic Action. Many SceneGroups may be added.
magneticAction.addPhysicalModel(box.physicalModel);

Code Sample
box box.anchor box.transform magCenter magSolver = SceneGroup(./box.aer).add(); = theStage.getPrimitive(anchor1); = box.anchor.transform; = theStage.getPrimitive(magCenter); = FastConstraintSolver();

loader = new Object(); loader.timestep = function(now) { if (!box.loaded) return; box.physicalModel box.physicalModel.collide box.physicalModel.acceleration = box.createConvexPhysicalModel(10); = true; = Vector(0.0, -32.0, 0.0);

strength = 200; falloff = 0; angle = 2.0 * 3.1415927; maxDistance = 100; position = magCenter.position; direction = Vector( 0, 0, 0 ); magAction = magSolver.createMagneticAction( strength, falloff, angle, maxDistance, position, direction); magAction.addPhysicalModel(box.physicalModel); magSolver.addAction(magAction); removeAnimator(loader); } addAnimator(loader);

364

APPENDIX E

MotorAction
A MotorAction may be used to apply rotational behavior to a physical model. The motor action is created by a method of the FastConstraintSolver, and applies to a single physical model. Motor action properties represent the common controls and measurements available in real-world motor controllers. Local Properties
gain

This property represents the strength of the motor at any given moment, calculated as the difference between current speed and the desired speed times the gain. If you desire for the motor to have sufcient strength to move other objects, values of 100 or greater should likely be used (depending upon the mass of the objects to be moved). Default value for the controller-motor preset script is 100.
motorAction.gain = 3;

maxTorque

The maximum torque available to the motor (torque is a measurement of the rotational force produced by the motor armature). In the Atmosphere application, maxTorque acts as a limit to the gain property.
motorAction.maxTorque = 3;

spinRate

The rotational speed desired for the motor (angular velocity). Note that if insufcient torque is available, themotor will not reach the desired speed. See the description for maxTorque above.
motorAction.spinRate = 3;

Code Sample
armature armature.anchor armature.transform = SceneGroup(./armature.aer).add(); = theStage.getPrimitive(anchor); = armature.anchor.transform;

armature.solver = FastConstraintSolver(); armature.timestep = function(now) { if (!armature.loaded) { return; } armature.physicalModel = armature.createPhysicalModel(1); armature.physicalModel.collide = true; armature.physicalModel.acceleration = Vector(0.0, 0.0, 0.0); //method expects 5 parameters armature.action = armature.solver.createMotorAction( armature.physicalModel, //physicalModel armature.anchor.position, //axis 3, //spinRate 3, //gain 3); //maxTorque

ADOBE ATMOSPHERE 365 User Guide

solverA.addAction(armature.action); removeAnimator(armature); } addAnimator(armature);

SingleDragAction
A Single Drag Action is a subtle force that is applied to a specied dynamic physical model. The effect is that of slowing down the momentum of the object for both direction and rotation. This module differs from Drag Action in that the effect can be limited to one object. Numerous Single Drag Actions can be created so that different physical models can experienced customized drag. A Single Drag Action is created by a method of the FastConstraintSolver(), and has adjustable properties for velocity and angular velocity of drag (maximum = 1). It should be noted that for any of the physics based constraints or actions, it is necessary to assign reasonable mass values when creating the physical models so that physics processing does not become unstable (driven out of scope). The guidelines for mass and inertia are decribed in the method createPhysicalModel(). Properties
angularVelocityDrag

The strength of the drag as it applies to object angular velocity (rotation).


singleDragAction.angularVelocityDrag = 1;

velocityDrag

The strength of the drag as it applies to object velocity.


singleDragAction.velocityDrag = 1;

Code Sample
cone = SceneGroup(./cone.aer).add(); cone.anchor = stageModel.getSolidObject(0).rootPrimitive.nd(./anchor1); cone.transform = cone.anchor.transform; cone.solver = FastConstraintSolver(); cone.timestep = function(now) { if (!cone.loaded) return; cone.physicalModel = cone.createConvexPhysicalModel(1); cone.physicalModel.collide = true; cone.physicalModel.acceleration = Vector(0.0, -32.0, 0.0); cone.velocityDrag = 1; cone.angularVelocityDrag = 1;

366

APPENDIX E

cone.singleDragAction

= cone.solver.createSingleDragAction( cone.physicalModel, cone.velocityDrag, cone.angularVelocityDrag );

cone.solver.addAction(singleDragAction); removeAnimator(cone); } addAnimator(cone);

SimpleRigidWindAction
As the name implies, a SimpleRigidWindAction simulates the effect of wind on a physical model. The wind action is created by a method of the FastConstraintSolver. A single SceneGroup is controlled for each wind action, and numerous wind actions can be created. In addition, there are adjustable properties for wind strength and direction, as decribed below. It should be noted that for any of the physics based constraints or actions, it is necessary to assign reasonable mass values when creating the physical models so that physics processing does not become unstable (driven out of scope). The guidelines for mass and inertia are decribed in the method createPhysicalModel(). Properties
active

A boolean ag controlling whether the wind effect is currently processed. (default = true)
simpleRigidWindAction.active = true;

direction

The direction of the wind as a Vector.


simpleRigidWindAction.direction = Vector( 0.0, 0.0, -1.0 ); //straight away in Z

strength

The relative strength of the wind. Useful values range from 0 - 100.
simpleRigidWindAction.strength = 3;

Code Sample
stage = stageModel.getSolidObject(0).rootPrimitive; sphere = SceneGroup(./sphere.aer).add(); sphere.anchor = stage1.nd(./anchor); sphere.position = sphere.anchor.position; sphere.solver = FastConstraintSolver(); sphere.onLoad = function() { sphere.physicalModel = sphere.createPhysicalModel(1); sphere.physicalModel.collide = true; sphere.physicalModel.acceleration = Vector( 0.0, -32.0, 0.0 );

ADOBE ATMOSPHERE 367 User Guide


sphere.windStrength sphere.windDirection = 3; = Vector( 0.0, 0.0, -1.0 );

sphere.windAction = sphere.solver.createSimpleRigidWindAction(sphere.physicalModel, sphere.windDirection, sphere.windStrength); sphere.solver.addAction(sphere.windAction); removeAnimator(sphere); } addAnimator(sphere);

Constraints
BreakableConstraint
A breakable constraint is actually an arbitrator that determines if a given constraint should remain active. The breakable contraint is created by a method of the FastConstraintSolver, and is passed a constraint name and values for linear and angular strength. If the specied constraint experiences stresses which are beyond the strength values given, the constraint is abandoned, and the physical models will break apart. Properties
angularStrength

Species the value at which the constraint will fail for angular stresses (such as experienced at a pivot point).
breakableConstraint.angularStrength = 50;

linearStrength

Species the value at which the constraint will fail for linear stresses (similar to tensile strength).
breakableConstraint.linearStrength = 50;

Code Sample
doorLeft doorLeft.anchor doorLeft.position doorLeft.orientation doorLeft.pivot doorLeft.axis hingeLeft hingeLeft.anchor hingeLeft.position hingeLeft.orientation loader loader.solver = = = = = = = = = = SceneGroup(./resources/doorLeft.aer).add(); theStage.getPrimitive(doorLeft); doorLeft.anchor.position; doorLeft.anchor.orientation; doorLeft.anchor.position; // location of hinge Vector (0,1,0); // axis of hinge SceneGroup(./resources/hingeLeft.aer).add(); stageModel.getSolidObject(0).rootPrimitive.nd(.../hingeLeft); hingeLeft.anchor.position; hingeLeft.anchor.orientation;

= new Object(); = FastConstraintSolver();

368

APPENDIX E

loader.timestep = function(now) { if (!doorLeft.loaded) { return; } if (!hingeLeft.loaded) { return; } doorLeft.physicalModel = doorLeft.createConvexPhysicalModel(2); doorLeft.physicalModel.collide = true; doorLeft.physicalModel.acceleration = Vector(0.0, -32.0, 0.0); hingeLeft.physicalModel hingeLeft.physicalModel.xed = hingeLeft.createConvexPhysicalModel(0); = true;

constraint = this.solver.createHingeConstraint(doorLeft.physicalModel, hingeLeft.physicalModel); constraint.setWorldSpacePivotAndAxis(doorLeft.pivot, doorLeft.axis); breakableConstraint = this.solver.createBreakableConstraint(constraint, 50, 50); this.solver.addConstraint(breakableConstraint); doorLeft.angularDashpot = this.solver.createAngularDashpot(doorLeft.physicalModel, hingeLeft.physicalModel); doorLeft.angularDashpot.setRotation(Rotation(Y, 0.0)); doorLeft.angularDashpot.strength = .5; this.solver.addAngularDashpot(doorLeft.angularDashpot); removeAnimator(this); } addAnimator(loader);

HingeConstraint
A hinge constraint between two physical models simulates the effects of a physical hinge. The constraint includes a pivot point and a rotation axis. The pivot point and axis are specied in world space when being dened relative to the initial position of the physical models. Such a constraint is created using a fast constraint solver. After that, the two objects will be constrained to act as if there is a hinge between them. It should be noted that for any of the physics based constraints or actions, it is necessary to assign reasonable mass values when creating the physical models so that physics processing does not become unstable (driven out of scope). The guidelines for mass and inertia are decribed in the method createPhysicalModel(). Properties
tau

The time constant for the constraint, similar to damping.


strength

The strength or stiffness of the constraint.

ADOBE ATMOSPHERE 369 User Guide

Methods
setWorldSpacePivotAndAxis(Vector pivot, Vector axis)

A point dening the location of the constraint, and the hinge axis direction. Code Sample
cube = SceneGroup(./cube.aer).add(); star = SceneGroup(./star.aer).add(); loader = new Object(); loader.timestep = function() { if (cube.loaded && star.loaded) { cube.physicalModel = cube.createPhysicalModel(1); star.physicalModel = star.createPhysicalModel(10); solver = FastConstraintSolver(); constraint = solver.createHingeConstraint(cube.physicalModel, star.physicalModel); constraint.strength = 1.0; constraint.tau = 1.0; pivot = Vector(0, 0, 0); axis = Vector(0, 1, 0); constraint.setWorldSpacePivotAndAxis(pivot, axis); removeAnimator(this); } } addAnimator(loader);

PointToPointConstraint
A point to point constraint between two physical models simulates the effects of a physical ball joint. The constraint includes a pivot point about which the two physical models rotate freely. The pivot point is specied in world space for the initial placement relative to the two physical models. Such a constraint is created using a fast constraint solver. After that, the two objects will be constrained to act as if there is a ball-joint between them. It should be noted that for any of the physics based constraints or actions, it is necessary to assign reasonable mass values when creating the physical models so that physics processing does not become unstable (driven out of scope). The guidelines for mass and inertia are decribed in the method createPhysicalModel(). Properties
strength

The strength or stiffness of the constraint.

370

APPENDIX E

tau

The time constant for the constraint, similar to damping. Methods


setWorldSpacePivotPoint(Vector pivot)

The point in world space that denes the location of the constraint. Code Sample
cube = SceneGroup(./cube.aer).add(); star = SceneGroup(./star.aer).add(); loader = new Object(); loader.timestep = function() { if (cube.loaded && star.loaded) { cube.physicalModel = cube.createPhysicalModel(1); star.physicalModel = star.createPhysicalModel(10); solver = FastConstraintSolver(); constraint = solver.createPointToPointConstraint(cube.physicalModel, star.physicalModel); constraint.strength = 1.0; constraint.tau = 1.0; pivot = Vector(0, 0, 0); constraint.setWorldSpacePivotPoint(pivot); removeAnimator(this); } } addAnimator(loader);

PrismaticConstraint
A PrismaticConstraint is a physical constraint between two physical models that simulates the effect of sliding on a rail. The objects are held in a xed relative orientation to each other, and at a x displacement orthogonal to the rail, but are free to slide along the rail direction. It is useful for sliding doors, elevators etc. The constraint is created using a fast constraint solver, after which the relative motion will be constrained to sliding along the axis direction. It should be noted that for any of the physics based constraints or actions, it is necessary to assign reasonable mass values when creating the physical models so that physics processing does not become unstable (driven out of scope). The guidelines for mass and inertia are decribed in the method createPhysicalModel().

ADOBE ATMOSPHERE 371 User Guide

Properties
tau

The time constant for the constraint, similar to damping.


strength

The strength or stiffness of the constraint.


relativeOrientation

The orientation of the axis of constraint relative to the rst PhysicalModel.


relativeTranslation

The translation of the axis of constraint relative to the rst PhysicalModel.


slideDirection

The Vector representing the direction of motion to which the PhysicalModels will be constrained. Code Sample
ring = SceneGroup(./ring.aer).add(); pole = SceneGroup(./pole.aer).add(); loader = new Object(); loader.timestep = function() { if (ring.loaded && pole.loaded) { ring.physicalModel = ring.createPhysicalModel(1); pole.physicalModel = pole.createPhysicalModel(10); solver = FastConstraintSolver(); constraint = solver.createPrismaticConstraint(ring.physicalModel, pole.physicalModel); constraint.strength = 1.0; constraint.tau = 1.0; constraint.relativeOrientation = Rotation(Z, 1.0); constraint.relativeTranslation = Vector(1.0, 2.0, 3.0); constraint.slideDirection = Vector(0.0, 1.0, 0.0); removeAnimator(this); } } addAnimator(loader);

StiffSpringConstraint
A stiff spring constraint between two physical models constrains two points on those bodies to remain at a specied distance from each other not matter what other physical motion they may experience. The constraint is created using a fast constraint solver and may be thought of as a stiff physical spring.

372

APPENDIX E

It should be noted that for any of the physics based constraints or actions, it is necessary to assignreasonable mass values when creating the physical models so that physics processing does not become unstable(driven out of scope). The guidelines for mass and inertia are decribed in the methodcreatePhysicalModel(). Properties
length

The resting length of the spring.


strength

The strength or stiffness of the constraint.


tau

The time constant for the constraint, similar to damping. (Note that reasonable values range from 0.0 to 1.0.) Methods
setWorldSpacePivotPoints(Vector pivot1, Vector pivot2)

Sets the two points representing the ends of the spring. These points are in world space coordinates (i.e. they are relative to the origin of the StageModel).
setLocalSpacePivotPoints(Vector pivot1, Vector pivot2)

Sets the two points representing the ends of the spring. These points are in local space coordinates (i.e. they are relative to the origins of the corresponding SceneGroups specied when the constraint was created). Code Sample
box1 = SceneGroup(./box.aer).add(); box2 = SceneGroup(./box.aer).add(); loader = new Object(); loader.timestep = function() { if (box1.loaded && box2.loaded) { box1.physicalModel = box1.createPhysicalModel(10); box2.physicalModel = box2.createPhysicalModel(2); solver = FastConstraintSolver(); constraint = solver.createStiffSpringConstraint(box1.physicalModel, box2.physicalModel); constraint.length = 1.0; constraint.strength = 1.0; constraint.tau = 1.0; pivot1 = Vector (0, 0, 0); pivot2 = Vector (1, 0, 0) constraint.setWorldSpacePivotPoints(pivot1, pivot2)

ADOBE ATMOSPHERE 373 User Guide


solver.addConstraint(constraint); removeAnimator(this); } } addAnimator(loader);

WheelConstraint
A wheel constraint simulates the effects of a wheel being held by a stiff suspension along with a motor to apply torque to the wheels. There are functions to control the preferred speed of the wheels as well as the desired steering angle of the wheel. A set of wheel constraints may be used to attach physical models for the wheels to a physical model for a chassis. A physically realistic vehicle will result. Properties
strength

The strength or stiffness of the constraint.


tau

The time constant for the constraint, similar to damping. Methods


setMotorSpeedAndMaxTorque(oat speed, oat maxTorque)

Sets the desired speed of the motor driving the wheel and the maximum angular force the motor can exert.
setSteeringAngle(oat angleInRadians)

Sets the degree of the angle the wheels are turned around the suspension. Valid range is from -180 to 180 degrees. Default is 0.0 degrees.
setWorldSpacePivotAxleAndSuspension(Vector pivot, Vector axle, Vector suspension)

Sets the point where the wheel constraint is, the axle around which it spins, and the suspension around which the steering angle is set. Code Sample
frame = SceneGroup(./frame.aer).add(); wheel = SceneGroup(./wheel.aer).add(); loader = new Object(); loader.timestep = function() { if (frame.loaded && wheel.loaded) { frame.physicalModel = frame.createPhysicalModel(10); wheel.physicalModel = wheel.createPhysicalModel(2); solver = FastConstraintSolver();

374

APPENDIX E

constraint = solver.createWheelConstraint(frame.physicalModel, wheel.physicalModel); constraint.strength = 1.0; constraint.tau = 1.0; speed = 2.0; maxTorque = 5.0; constraint.setMotorSpeedAndMaxTorque(speed, maxTorque); setSteeringAngle(45); pivot = Vector (0, 0, 0); axle = Vector (1, 0, 0) suspension = Vector(0, 1, 0); constraint.setWorldSpacePivotAxleAndSuspension(pivot, axle, suspension) solver.addConstraint(constraint); removeAnimator(this); } } addAnimator(loader);

ADOBE ATMOSPHERE 375 User Guide

Adobe Atmosphere

Adobe Systems Incoporated 345 Park Avenue, San Jose, CA 95110-2704 USA www.adobe.com 90047303 11/03

Вам также может понравиться