Appendix D: Javascript Api Overview; Introduction; Scenegraph Overview - Adobe ATMOSPHERE User Manual

Table of Contents

Advertisement

ADOBE ATMOSPHERE
235
User Guide

Appendix D: JavaScript API Overview

Introduction

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

SceneGraph Overview

The objects available within the JavaScript API are organized in hierarchies. Two main hierarchies exist: the scene
hierarchy, which contains the scene geometry, and the user interface, with the application at its root.
The Scene Hierarchy
The currently viewed world is represented as a hierarchy of objects which is referred to as the "scene hierarchy".
The scene hierarchy is comprised of the objects shown in the Scene Hierarchy palette when using the Atmosphere
application. A typical palette with several objects is shown below:

Advertisement

Table of Contents
loading

Table of Contents