User Guide
ADOBE ATMOSPHERE 289
User Guide
camera = application.getView(0).getCamera(0);
// Find ray direction for pixel 20, 40
direction = camera.getRayDirectionFromPixelCoords(20, 40);
setOffsetsFromRayDirectionAndPixelCoords(Vector rayDirection, x, y)
Changes the xOffset and yOffset so that the given ray direction and pixel coordinates correspond in the image
plane.
camera = application.getView(0).getCamera(0);
direction = Vector(1, 0, 0);
camera.setOffsetsFromRayDirectionAndPixelCoords(direction, 50, 60);DistantLight
DistantLight is a module that controls a distant light source for solid objects that have dynamic lighting enabled.
Dynamic lighting is added to lightmaps that were computed for radiosity. Distant lights shine parallel light from
infi nity and have a brightness and colour. The central direction for where the light comes from is determined
by the direction property, whereas the cone angle determines the spread of rays around that direction. (In
real life, the sun and moon, for instance, have a cone angle of approximately half a degree. Area lights may be
approximated using larger cone angles.) Large cone angles illuminate more than half of a sphere, leading to
softer-looking illumination.
Properties
type
Returns a string value of ‘DistantLight’
light = stageModel.getDistantLight(0);
chat.print(light.type);
worldSpaceDirection
The directional vector pointing towards the distant light
// Set the worldSpaceDirection of the light to point
stageModel.getDistantLight(0).worldSpaceDirection = Vector(0, 1, 0);
coneAngle
The angle subtended by the distant light, valid values range from 0 to 360 degrees.
// Set the cone angle to 45 degrees
stageModel.getDistantLight(0).coneAngle = 45;
brightness
The scale value of the distant light. Reasonable values range between 1-100, and appropriate initial settings are
dependant upon the light map brightness of the objects to be illuminated. Experimentation with the initial value
is necessary for obtaining desired results.
// Set the light’s brightness to 10
stageModel.getDistantLight(0).brightness = 10;










