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.
ADOBE ATMOSPHERE i User Guide Contents Chapter 1: The Atmosphere Platform Platform Features. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1 The Atmosphere Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1 Why 3-D?. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
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 . . . . . . . . . . . . . . . . . . . . . . .
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. . . . . . . . . . . . . . . . . . . . .
iv CONTENTS Tutorial: Making Alphabet Letters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136 Chapter 11: Applying Colors and Textures The Appearance Editor. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139 Adding Color . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139 Tutorial: Coloring Chess Pieces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ADOBE ATMOSPHERE v User Guide Tutorial: Preparing Textures for Lighting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180 Chapter 14: Adding Interactivity Drag and Drop Scripting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181 Tutorial: Adding Fog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183 Defining Properties and Setting Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
vi CONTENTS Textures – Set 2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223 Objects – Set 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227 Objects – Set 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229 Objects – Set 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ADOBE ATMOSPHERE vii User Guide OverlapEventHandler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275 Scene Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277 Actor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277 Anchor. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
viii CONTENTS SingleDragAction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365 SimpleRigidWindAction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366 Constraints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367 BreakableConstraint. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367 HingeConstraint. . . . . . . . . . . . . .
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.
2 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.
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.
4 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.
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 i 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.
6 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, let’s 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.
8 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 find 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.
ADOBE ATMOSPHERE 9 User Guide Tutorial: Viewing Atmosphere Environments in Photoshop Album Even if you’ve 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.
10 CHAPTER 2 An Atmosphere environment created using Photoshop Album’s 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. i The Atmosphere web pages at http://www.adobe.
ADOBE ATMOSPHERE 11 User Guide The Mad Hater’s 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. i 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.
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. i Using the Ctrl key to tilt the view will not change your horizontal or vertical movements.
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 file Gallery.html and press Open.
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.
ADOBE ATMOSPHERE 15 User Guide Atmosphere Player Toolbar Buttons Icon Name Enables collision detection in the environment Gravity toggle Enables gravity in the world Show My Avatar toggle Chat Controls Preferences Users Avatars Bookmarks i Description Collide toggle 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 l
16 CHAPTER 2 Tutorial: Moving to an Overhead View of the Environment Using the Shift and Ctrl keys, you can quickly get a bird’s-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.
ADOBE ATMOSPHERE 17 User Guide Working with Bookmarks You can bookmark scenes that you would like to revisit. Bookmarks aren’t 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.
18 CHAPTER 2 Tutorial: Bookmarking New Environments If you find 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.
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.
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.
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.
22 CHAPTER 2 The Preferences panel includes controls for defining 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.
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.
24 CHAPTER 2 To speed up the Player, you can turn off textures. To further speed the Player’s 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, floating window – by toggling this option.
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.
28 Chapter 3 Tutorial: Jumping Between Environments When buiding Atmosphere environments, you may find 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.
ADOBE ATMOSPHERE 29 User Guide Understanding Entry Points When you first 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.
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 first 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.
ADOBE ATMOSPHERE 31 User Guide Identifying Users The Users palette lists all the current visitors in the environment. The names that are displayed are specified in the Nickname field 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 specific user, check the Whisper box next to the user. The Users palette lists all the current visitors in an environment.
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.
ADOBE ATMOSPHERE 33 User Guide An example of an environment that uses scripted interactive objects. This environment lets you click on objects that are floating in the scene. Physics simulation Atmosphere’s 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.
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.
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.
38 CHAPTER 4 Scene Modeling In this phase of the workflow, 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.
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. i Although the Player View shows textures and lighting, it does not preview scripted behaviors.
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.
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 doesn’t delete the texture file, only the reference to the file. When an environment is published, Atmosphere reads the reference to copy the resource file to the published file.
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.
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.
44 CHAPTER 5 Using the Menus Located in the menu bar, Atmosphere’s 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.
ADOBE ATMOSPHERE 45 User Guide of the File menu is a list of recently opened files. Selecting one of these choices will re-open the selected file. The File menu commands are covered in more detail in Chapter 6, “Working with Files.” i Keyboard shortcuts are useful for working efficiently 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.
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.
ADOBE ATMOSPHERE 47 User Guide General Toolbar Tools Icon Name Description Selection Tool (V) Used to select objects Direct Selection Tool (A) Used to select objects and/or connectors Rotate Tool (R) Used to rotate objects Scale Tool (S) Used to scale objects Orbit Camera Tool (C) Used to spin the camera along its center axis Hand Tool (H) Used to pan the current view Dynamic Zoom Tool (D) Used to zoom by clicking and dragging Zoom Tool (Z) Used to zoom by dragging an area in the view Na
48 CHAPTER 5 Scene Toolbar Tools Icon Name Description Place Scene Object Preset Places the currently selected Scene Object Preset in the scene Place Empty Solid Object Places an Empty Solid Object in the scene Script Places an Script in the scene Portal Places a Portal in the scene Entry Point Places an Entry Point in the scene Anchor Places an Anchor point in the scene Texture Tools The Texture Tools toolbar is used to apply, edit and remove textures from objects.
ADOBE ATMOSPHERE 49 User Guide Working with Palettes Palettes are small windows that group related controls including drop-down lists, checkboxes, value fields 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.
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 floating toolbars and palettes because they can move them close to where they are working. Others like everything docked, so they know exactly where to find them. Atmosphere offers you the flexibility to handle both cases. For those who find themselves in the second camp, you might want to follow these steps.
ADOBE ATMOSPHERE 51 User Guide The interface with all toolbars and palettes docked, configured 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 reflect the actions up to that point, just as if you’d repeatedly used the Edit > Undo (Ctrl+Z) menu command.
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.
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 field 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.
54 CHAPTER 5 The Movie tab lets you set the number of times the movie loops and the volume of the movie’s 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.
ADOBE ATMOSPHERE 55 User Guide The Scene Hierarchy palette shows all of the Scene Objects in the current document’s 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.
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.
ADOBE ATMOSPHERE 57 User Guide Click the right mouse button 2 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).
58 CHAPTER 5 The Preferences dialog box includes controls to customize Atmosphere. Output Settings To make Atmosphere files smaller, you can enable the Save in Compressed Format option. Compressed files 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 first loaded. The Launch Web Browser on Publish option will open a specified web browser once the Publish command is used.
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 file 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 file formats. Understanding the Atmosphere Formats Atmosphere defines two native formats – ATMO and AER.
62 CHAPTER 6 The File > Open menu command will open a Windows File dialog box from which you canselect a file to open. This is a standard Windows file 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 files in the current directory as Thumbnails, Tiles, Icons, List, and Details.
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 file a different name and/or location to be saved. The name given to the environment in the file dialog box will be displayed in the title bar of each of the views.
64 CHAPTER 6 Importing Scripts Scripts are used to control the behavior of objects and environments. The Import menu will open JavaScript (JS) files. 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.
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.
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.
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 files added via the Presets menu will stay in the Presets palette as icons and can more easily be placed multiple times in a scene.
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 find Atmosphere has created file names such as Material001.amt, Model001.asc and ScriptObject001.ajs.
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.
70 CHAPTER 6 object as an AER file. 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.” i 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.
72 CHAPTER 7 Working with the View Windows Each view window includes a title bar that lists the file name of the project currently being edited, the current Editor, and the view’s 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.
ADOBE ATMOSPHERE 73 User Guide Notice that the background color changes when selecting Solid Object and Scene Editor. By default the Solid Object Editor’s background is a dark blue and the Scene Editor’s 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.
74 CHAPTER 7 The fountain once again in the Player View. The Appearance Editor’s 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 figure . The easiest way to select the Actor object is to click on its name in the Scene Hierarchy palette.
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.
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).
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 identified 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 difficult to find a specific view.
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, filling 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.
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.
82 CHAPTER 7 Zooming to fit Objects The View menu includes two useful commands that zoom the current view to fit all the current objects or just the selected object. View > Fit All (Ctrl+0) fits the whole scene to the current window. View > Fit Selected (Shift+Ctrl+0) fits 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.
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.
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.
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.
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).
88 CHAPTER 8 2 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.
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.
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 files into this format.
ADOBE ATMOSPHERE 91 User Guide The export path to Viewpoint format from major 3-D software packages Software package Viewpoint exporter? 3ds max® Yes Maya® Yes LightWave® Yes SoftImage® No Bryce® Yes Poser® Yes Carrara® Yes TrueSpace® Yes Export first to...
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.
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 files. Creating Avatars Atmosphere can also be used to create avatars. In fact, many of the existing preset avatars were created using Atmosphere’s primitives, including the default blue man.
94 CHAPTER 8 An avatar’s eye level must be aligned with the scene’s 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 finds 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.
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 first arrive when they visit your environment. When a new file 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.
96 CHAPTER 8 The Inspector palette for the Entry Point object includes buttons to change the Entry Point’s location. The Inspector palette also allows you to give the Entry Point a Name (if it’s 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 defined, you can script actions based on the Anchor’s position.
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.
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 Atmosphere’s 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.
100 CHAPTER 9 Understanding Boolean Operations Atmosphere’s 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.
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 defined by their Connector positions.
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 palette’s Name field. Alternately, select the primitive in the Object Hierarchy palette and click on the name. The field will become editable and you can change the name. Note that the object type will still appear next to the name in brackets.
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 “floor” will appear.
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.
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 flight of stairs can be constructed as a single Stairs primitive, by defining the position of only four Connectors.
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 floor.
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 Atmosphere’s 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.
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.
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.
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. i 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.
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.
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. i Locking a group will automatically lock all the objects contained within the group also. Locked objects are easily identified in the Object Hierarchy palette. The Object > Lock > Others command locks all objects except those that are selected.
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.
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 object’s name in the Object Hierarchy palette. The selected object’s name will be highlighted in blue when clicked.
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.
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.
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.
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 object’s connectors.
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 object’s 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.
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.
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 Column’s 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 object’s corners to align with the grid corners automatically.
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 fields. Spacing is the distance from the origin to the first major division. This value will appear next to the first 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.
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 finer movements when Snap to Grid is enabled. The Snap to Grid is also available in the Contextual menu.
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.
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 file. 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.
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 point–enough to show a slight tilt. The top after rotating 15 degrees around its center point.
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.
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 first Triangular Slab. 6 For the B and C letters, create five Floor objects and move their connectors so that they form the letters.
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 Editor’s Player view. To open a Player view, select the View > Player View menu command (F4).
140 CHAPTER 11 The Inspector palette lets you define 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.
ADOBE ATMOSPHERE 141 User Guide i 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.
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.
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.
144 CHAPTER 11 The color preset icon identifies 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 preset’s color value in the Inspector. Selected color presets can be set using the Inspector. You can store all your project’s colors in the Paint Presets palette. The color and values for each color are displayed at the bottom of each preset icon.
ADOBE ATMOSPHERE 145 User Guide Texture Formats Textures are image files that can be wrapped around or tiled over the surface of an object. The file 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.
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.” i Although colors can be applied to the sky, you cannot apply a texture to the sky background.
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 files 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.
148 CHAPTER 11 • MPEG • Windows Media Files (WMV) All of these formats can be opened using the file dialog that appears from the Add Texture Preset menu command on the Paint Presets palette menu. Video files normally appear with the poster frame as a thumbnail. Movie options Once a movie file 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.
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 fix 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.
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 find that Atmosphere makes it easy to access parameters for tiling and parametric and projective scaling.
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 field in the Surface tab of the Inspector palette. In this example, you’ll apply a texture to the front of a grandfather clock. 1 Locate the Help\Tutorials\Clock folder under the directory where Atmosphere was installed.
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.
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.
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 image’s proportions, while the Parametric scaling type will stretch the image as needed to completely fill an object’s face.
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 fits perfectly across the object face. Size expresses the size of the entire image in feet.
ADOBE ATMOSPHERE 157 User Guide The Parametric Scaling Type fits 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 floor. 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 field of this soccer stadium was created by wrapping a small grass texture horizontally and vertically.
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 filter category).
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, define 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.
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.
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 image’s 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 files. The alpha map of the tree. 4 To process the images in Viewpoint Scene Builder, apply both to a VP primitive plane.
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 Century’s 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 flat and cartoonish without lighting. Atmosphere offers advanced Radiosity lighting that can bathe your world in foggy film noir mystery or blazing brilliance.
166 CHAPTER 13 Even sophisticated environments seem flat 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.
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.
168 CHAPTER 13 Any Solid Object or Surface Object in the scene can be an emissive surface. The fluorescent 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.
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.
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 first 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.
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.
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.
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 Draft Quality Final Quality Preview Quality 2 4 16 Background Sampling Density Sun Sampling Density 1 4 8 Solid Object Emissive Surface Sample Size 8 4 2 Surface Object Emissive Surface Sample Size 4 2 1 Light Map Sample Size Minimum 1 1 0.
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.
ADOBE ATMOSPHERE 175 User Guide The Sun tab lets you adjust the Sun’s light. Understanding Elevation and Azimuth Elevation and Azimuth define the position of the Sun on an imaginary sphere that encompasses an Atmosphere environment. The position of the sun in the sky influences 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.
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. i 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.
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.
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.
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 Atmosphere’s lighting.
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 Atmosphere’s 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.
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 Atmosphere’s 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.
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. i 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.
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 i 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.
184 CHAPTER 14 An Atmosphere environment with the fog script applied. The amount of fog can be set by adjusting the script’s 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 field that holds the path to the imported script. You can set the script’s 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.
ADOBE ATMOSPHERE 185 User Guide Clicking the Edit button will open the script in a text editor. Defining Properties and Setting Values The Properties section in the Inspector palette holds all the defined properties for the script. You can enter new parameter values by selecting a property and typing its new value into the Value field. You can also right-click in a value field to select more parameters like a file name and path. Entering a wrong value type will make the script run incorrectly.
186 CHAPTER 14 i This approach allows developers to protect their script work, since AER files only open in the Player and can’t 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.
ADOBE ATMOSPHERE 187 User Guide 5 In the Inspector palette, click on the URL property to select it. Then right click on the Value field and select Sounds from the pop-up menu. In the file 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.
188 CHAPTER 14 The New Script Property dialog box lets you define 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, modified and whether it is an array or not.
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. i 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.
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 file Showroom.atmo and press Open.
ADOBE ATMOSPHERE 191 User Guide 6 Select File > Publish > World (Ctrl+P) to see the car object rotating in the scene. i 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 Atmosphere’s JavaScript API allows access to the built-in Havok physics-simulation engine.
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 file 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.
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 first 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 file to play or stop playing depending on the state when the button is pushed.
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 final steps to make your environment visible online. The process of publishing will bundle all of the files that make up your world–geometry, texture, light maps, sound, video and scripts–into a single, remarkably compact AER file ready for a web page or PDF file. Once published, the entire world will be able to see you creation, but they won’t be able to open and “borrow” any of its components.
196 CHAPTER 15 The Chat palette in the Player will display JavaScript errors. Incorrectly positioned Entry Point If the environment loads, but the floor 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.
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 defines the location of the Collaboration Server if you wish to enable chat and object synchronization.
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 specified directory using the ATMO file format. It will not launch a web browser. Publishing Preferences The Preferences dialog offers an option to Launch Web Browser on Publish.
ADOBE ATMOSPHERE 199 User Guide Publishing in a PDF Document The web is not the only way to publish Atmosphere environments. Atmosphere files 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.
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 file before publishing. Optimized files will be smaller and download faster. Optimized files embedded in PDF documents can help keep them smaller, too..
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.
202 CHAPTER 15
ADOBE ATMOSPHERE 203 User Guide Appendix A: Installing and Configuring 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.
204 APPENDIX A Hardware Rendering will improve the performance and the appearance of Atmosphere environments. i 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 computer’s CPU has to do all the work of rendering a 3-D scene for each frame.
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 configure Atmosphere to recognize your video chip set by manually entering it into its list of supported devices. Atmosphere uses a configuration file called AtmoHWConfig.
ADOBE ATMOSPHERE 207 User Guide [1002] - ATI Technologies chipsets This line, for example, identifies 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 file (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 file and relaunch Atmosphere.
208 APPENDIX A [xxxx] – vendor description (tab)xxxx – chipset description In the first 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 entry–Atmosphere ignores the description text. Save the file and relaunch Atmosphere.
ADOBE ATMOSPHERE 209 User Guide Appendix B: Keyboard Shortcuts Learning and using the keyboard shortcuts will help you become much more efficient with Atmosphere. The following list includes all the keyboard shortcuts for Adobe Atmosphere.
210 APPENDIX B Command Shortcut View > New View Shift+Ctrl+N View > Preview F4 View > Top F5 View > Front F6 View > Right F7 View > Perspective F8 View > Bottom Shift+F5 View > Back Shift+F6 View > Left Shift+F7 View > Isometric Shift+F8 View > Zoom In Ctrl++ View > Zoom Out Ctrl+- View > Fit All Ctrl+0 View > Fit Selected Shift+Ctrl+0 View > Grid Ctrl+’ View > Snap to Grid Shift+Ctrl+’ View > Guidelines Ctrl+; View > Shadows Shift+Ctrl+; View > Reset Views Shift+Ctr
ADOBE ATMOSPHERE 211 User Guide Toolbar Keyboard Shortcuts Command Shortcut Selection Tool V Direct Selection Tool A Rotate Tool R Scale Tool S Orbit Camera Tool C Hand Tool H or spacebar Dynamic Zoom Tool D Zoom Tool Z Navigate Tool N Remove Texture Tool E Sample Texture Tool I Apply Texture Tool K Misc Keyboard Shortcuts Command Shortcut Access File menu Alt+F Access Edit menu Alt+E Access Object menu Alt+O Access View menu Alt+V Access Window menu Alt+W Access Help
212 APPENDIX B Player Navigation Keyboard Shortcuts Command Shortcut Move forward Up arrow Move backward Down arrow Turn to right Right arrow Turn to left Left arrow Move upward Shift+up arrow Move downward (with Gravity disabled) Shift+down arrow Tilt view upward Ctrl+up arrow Tilt view downward Ctrl+down arrow Strafe right Shift+right arrow Strafe left 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 Description createPhysicalModel Causes the target object will now possess a physical model, and experience physics using the property values set in the inspector palette. distantLight (default) 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).
ADOBE ATMOSPHERE 233 User Guide Scripts - Set 2 - Intermediate Name Description angularDashpot When you publish the world and it is viewed in the Player, the script will cause the target solid object to attempt to maintain it’s 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’.
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 don’t 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 won’t make one for it.
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.
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.
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, floors, 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 fixed shape.
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.
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 flags that determine whether they are fixed in space, and whether they will collide with other physical models.
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.
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.
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 it’s supporting web page.
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 user’s client. worldContext the value of the ‘context’ global in a world script.
ADOBE ATMOSPHERE 245 User Guide dir(object) Displays a hierarchical list of the object’s 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.
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 difficult 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.
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.
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” file, and it is not recommended that you change this behavior). box = SceneGroup(“./box.aer”).add(); box.timestep = function(t, deltaT) { box.
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 flag that is true when the control key is down. if (application.controlKeyDown) { ... } shiftKeyDown A boolean flag that is true when the shift key is down. if (application.shiftKeyDown) { ... } leftArrowKeyDown A boolean flag that is true when the left-arrow key is down. if (application.leftArrowKeyDown) { .
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.
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.
252 APPENDIX E Global Methods Button(label) creates a Button with the specified 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 specified 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.
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 browser’s 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.
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.
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).
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.
ADOBE ATMOSPHERE 257 User Guide filterOutput(textOutput) This method is used by your Remote Avatar, which is running on someone else’s 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 else’s computer, it is passed through this ‘chat.
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.
ADOBE ATMOSPHERE 259 User Guide Methods blend(b, fraction) Returns a rotation that is the interpolation between a and b according to the specified 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 specified axis(0, 1, 2 == x, y, z) rotated by this Rotation forward = orientation.mapAxis(2).
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.
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).
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 specified element (0 < index <= 2) changed.
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 fingers 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, .
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.
ADOBE ATMOSPHERE 265 User Guide glareEffect.brightness = 1.0; color An array of three floats 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.
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.
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 CollisionEventHandler’s can be created, each specifying results for a limited scope of events, set by the filtering methods shown below.
268 APPENDIX E boxEvents.setFilterNoPhysicalModel(); setFilterPhysicalModel(PhysicalModel) Specifies that the collision event handler should respond to all collisions for a single physical model. boxEvents.setFilterPhysicalModel(boxPhysicalModel); setFilterPhysicalModels(PhysicalModel, PhysicalModel) Specifies that the collision event handler should be limited to collisions between two physical models. boxEvents.
ADOBE ATMOSPHERE 269 User Guide Local Callbacks onEvent(keyEvent) A method which defines 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.
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 filtering method to specify the events to which the handler should respond. For example, “MyKeyEventHandler.
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.
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).
ADOBE ATMOSPHERE 273 User Guide myEventHandler.onEvent = function(mouseEvent, what) { chat.
274 APPENDIX E setFilterOnMouseOver(object) Causes the specified object (Primitive, Viewpoint Object, or SceneGroup) to return an ‘OnMouseOver’ mouse event. chair = theStage.getPrimitive(“chair”); myEventHandler.setFilterOnMouseOver(chair); setFilterOnMouseMove(object) Causes the specified object (Primitive, Viewpoint Object, or SceneGroup) to return an ‘OnMouseMove’ mouse event. chair = theStage.getPrimitive(“chair”); myEventHandler.
ADOBE ATMOSPHERE 275 User Guide Local Callbacks onEvent(mouseEvent, what) A method which defines 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.
276 APPENDIX E buildingOverlap = OverlapEventHandler(); Local Callbacks onEnter(PhysicalModelA, PhysicalModelB) A method which defines 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().
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 user’s 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.
278 APPENDIX E chat.print(“Current avatar = “ + theActor.avatarURL); showAvatar A flag 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.
ADOBE ATMOSPHERE 279 User Guide pitchAngle = theActor.headPitch; velocity the Actor’s 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 Actor’s velocity Vector in the World coordinate frame. theActor.
280 APPENDIX E verticalSpeed the Actor’s vertical velocity, facing the Actor’s 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 actor’s vertical velocity. theActor.
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.
282 APPENDIX E keyUpDownTurnsEnabled A flag 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 flag 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.
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.
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 specified position, giving no consideration to collisions with other objects. // Place the actor at the exact location specified. target = Vector(10.0, 0.0, 6.
ADOBE ATMOSPHERE 285 User Guide { theActor.getSolidObject(i).useDynamicLighting = true; } getSolidObject(index) Returns the SolidObject at the given index that is contained by the actor’s SceneGroup. //print actor height compared to the world currentHeight = ( theActor.getSolidObject(0).position[1] - stageModel.getSolidObject(0).position[1] ); chat.
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.
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 five of these properties: position, orientation, transform, lockToActor, and showAvatar.
288 APPENDIX E lockToActor When true the camera’s position and orientation are copied from the actor’s position and head orientation every time step. // Make the camera track the actor’s 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.
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.
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 light’s ability to cast shadows stageModel.getDistantLight(0).
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.
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 defined for the position of the SceneGroup from which the physical model may have been made. When first 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.
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).
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 flag 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.
ADOBE ATMOSPHERE 295 User Guide friction The coefficient 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 definition of friction is the ratio between the normal force and the largest allowed lateral friction force that may result.
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 specified 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.
ADOBE ATMOSPHERE 297 User Guide } removeAnimator(this); } } addAnimator(box); applyImpulseToCenterOfMass(Vector impulse) This function increments the linear momentum of the physical model by a specified 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.
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).
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.
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.
ADOBE ATMOSPHERE 301 User Guide if (myObject.name == ‘myCoolObject’) { ... } loaded Returns true once the object has finished 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).
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.
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.
304 APPENDIX E theStage The loaded world’s 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.
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.
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 SceneGroup’s Eye position and orientation, expressed as an array of two Vectors [min, max]. spider = SceneGroup(“./spider.
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 specified 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.
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.
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.
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 efficiently computed by the physics engine. Settings for mass and inertia should adhere to the same guidelines also described above.
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 = application.getView(0).getCamera(0); = application.getView(0).mouseX; = application.getView(0).mouseY rayOrigin rayDir = player.position; = camera.
312 APPENDIX E Callbacks suggestLocation(loc) A SceneGroup script’s 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.
ADOBE ATMOSPHERE 313 User Guide Within this top section, the script writer uses the “defineCustomPropertyValue” 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 modified by the user. Also during Application use, functions (called ‘actions’) can be linked to other objects or script properties.
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.
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.
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 find 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.
ADOBE ATMOSPHERE 317 User Guide theStage.getSolidObject(0).rootPrimitive.onClick = function() { chat.print(“You clicked the first 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 player’s orientation // (see the “Rotation” module documentation for more): mySceneGroup.orientation = mySceneGroup.orientation.blend(player.orientation, 0.
318 APPENDIX E // Make the spider’s feet just touch the floor spider.y = floorHeight-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.
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 object’s light map. Default is 0.25. sphere = SceneGroup (“./sphere.aer”); solidObject = spheres[i].getSolidObject(0); solidObject.
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.
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 first Primitive with the given name from the SolidObject’s array of primitives. Functionally equivalent to “solidObject.rootPrimitive.find(‘name’)”. myLongBox = mySolidObject.
322 APPENDIX E loaded Returns true once the object has finished loading. if (myObject.loaded) { ... } parent A reference to the SceneGroup containing the SurfaceObject objectParent = SurfaceObject.parent; attachedToParent A flag that is set to true when a SurfaceObject is attached to a SceneGroup using the addTo() method. A SurfaceObject that is attached to it’s parent will be transformed with the parent.
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).
324 APPENDIX E receiveShadows A boolean value that specifies 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 flag that sets if the SurfaceObject is visible or not. Default is true. spider.
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.
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.
ADOBE ATMOSPHERE 327 User Guide attachedToParent Specified whether the Viewpoint object is attached to the parent SceneGroup. If the parent SceneGroup also contains a physical model, setting this flag 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].
328 APPENDIX E useDynamicLighting A flag specifying whether dynamic lighting should be enabled for this Viewpoint object. viewpointObject.useDynamicLighting = true; visible A flag 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.
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 efficiently computed by the physics engine.
330 APPENDIX E { chat.print(“You clicked on the box’s lid!”); } else { chat.print(“You clicked on the box!”); } } onMouseOver() This function is called when the cursor first hovers over the Viewpoint object. viewpointObject.onMouseOver = function() { // get the object’s border theBorder = viewpointObject.scene.getMaterial(“border”) // set the border’s color to white theBorder.diffuseColor = [ 1.0, 1.0, 1.
ADOBE ATMOSPHERE 331 User Guide objectFaceNo The face number of the primitive. This value is read-only. lightMapOrigin The origin of the face’s light map as a Vector. This value is read-only. lightMapUTangent The tangent to the light map’s U-axis as a Vector. This value is read-only. lightMapVTangent The tangent to the light map’s V-axis as a Vector. This value is read-only. textureOrigin The origin of the face’s texture as a Vector. This value is read-only.
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 file for that solid object. (Currently there is only one solid object per SceneGroup.) This root primitive may be searched by name to find other primitives using the “find” function.
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.
334 APPENDIX E volume = (max.x - min.x) * (max.y - min.y) * (max.z - min.z); chat.print(“Primitive’s 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 undefined the Primitive has no children. if (foo.children == ‘undefined’) { chat.print(“Primitive has no children”); } else { chat.print(“First child’s name is “ + foo.children[0].name); } parent The Primitive’s parent.
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.
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.
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 = box.solidObject.rootPrimitive; = thePrimitive.getFace(0); theSurfaceTexture = theFace.getSurfaceTexture(); if (theSurfaceTexture.hasTexture) { chat.
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 flag that determines if the image file loaded by a Texture object should be cached by the Player application. By default this is set to true. tex = Texture(); tex.
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 object’s 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.
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.
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...
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 specified time element. The argument can either be a string or a numeric index. walkTimeElem = scene.
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.
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.
ADOBE ATMOSPHERE 345 User Guide instance.preliteColor = [ 1, 0, 0, ]; //set to red usePreliteColor switches between the default value or the newly defined color. instance.usePreliteColor = true; //use newly defined 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 specified by the name or index. childInstance = instance.
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 Specifies the texture scale in the horizontal direction. textureObj.scaleX = 3; scaleX Specifies the texture scale in the vertical direction. textureObj.scaleY = 5; translateX Change the origin of the texture in the horizontal direction where 1.
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.
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.
ADOBE ATMOSPHERE 349 User Guide dstPin For text which is fixed in the window space(immovable), this property specifies the distance from the window corner in pixels as an array of two numbers [ X, Y ]. The distance may also be specified as a percentage of the window size using “dstPinRelative = true” (shown below).
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”. It’s also important to note that this attribute must be present in the MTX description file, and set to “1” in order for the text to be visible in Atmosphere. bIsVisible = textObj.
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.
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.
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 flag, 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 specified by the name or index. child = timeElem.
354 APPENDIX E time Moves the SWF movie to the specified 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.
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.
356 APPENDIX E • Any physical model involved in a constraint or action should have all of it’s 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.
ADOBE ATMOSPHERE 357 User Guide createWheelConstraint(PhysicalModel, PhysicalModel) Creates and returns a new WheelConstraint between the two PhysicalModels. The first 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.
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”.
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.
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 first PhysicalModel’s 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.
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.
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 specified 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 modified following the creation of the Magnetic Action; “active”, “falloff ”, “strength”.
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) Specifies a PhysicalModel which will experience the Magnetic Action. Many SceneGroups may be added. magneticAction.addPhysicalModel(box.physicalModel); Code Sample box box.
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.
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 specified 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.
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”.
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.
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.fixed = hingeLeft.createConvexPhysicalModel(0); = true; constraint = this.solver.createHingeConstraint(doorLeft.physicalModel, hingeLeft.physicalModel); constraint.
ADOBE ATMOSPHERE 369 User Guide Methods setWorldSpacePivotAndAxis(Vector pivot, Vector axis) A point defining 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.
370 APPENDIX E tau The time constant for the constraint, similar to damping. Methods setWorldSpacePivotPoint(Vector pivot) The point in world space that defines 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.
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 first PhysicalModel. relativeTranslation The translation of the axis of constraint relative to the first PhysicalModel. slideDirection The Vector representing the direction of motion to which the PhysicalModels will be constrained. Code Sample ring = SceneGroup(“.
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.
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.
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.
ADOBE ATMOSPHERE 375 User Guide
Adobe Atmosphere ® Adobe Systems Incoporated 345 Park Avenue, San Jose, CA 95110-2704 USA www.adobe.