Page 21/36
position of the light to the maximum distance the light slowly diminishes. This is called light
attenuation.
Lights do not cast shadows. If you have a sphere in front of the plane there will be no
shadow on the plane, the light rays will seem to pass through the sphere without any interference.
You have to use other techniques to obtain shadows. Lightmaps, Z-shadows or shadow volumes for
instance.
There are three types of lights:
1. Omni light this is a light located in one point radiating light rays equally to all
directions. You can thing of omni light as of an electric bulb hanging on a cable freely
in the air.
2. Spot light spot light shines a beam or a cone of light in one direction. You can change
the width or angle of the cone. A 360º cone would become an omni light. Example of
spot light is a torch light.
3. Parallel light uniform mass of parallel light rays with same direction shining from a
plane in infinite distance form a parallel light. You can change position of parallel light
but it has no effect whatsoever. Parallel light is usually used to simulate sunshine.
TGLDummyCube
GLScene also has helper objects. Helper object is an invisible object that is used for
organizing other objects in groups, to show distances, directions and positions in space. You should
learn how to use dummy cube as much as possible because it can simplify a lot of things. Dummy
cube can be used to store objects as its children. If you want to for example move all of the objects
just move the dummy cube. If you want to delete the objects just call DeleteChildren function of the
dummy cube. Dummy cube can simplify rotations. You can create joints with dummy cubes where
each dummy cube will have restricted rotation only in one axis.
You can make dummy cube visible run time with VisibleAtRuntime property. Dummy
cube is represented by cube outlined with dotted lines.
Basic geometry
Basic geometry objects are simple objects with hard coded geometry. The geometry can be
described with mathematical formulas. You can change individual parameters of the object but the
basic shape will always stay the same.
TGLSprite
Sprite is a 2D image mapped on a plane that always faces the camera. Unlike HUD sprite
TGLSprite is placed in 3D world and can be moved closer or further from the camera. If the sprite
gets too close to the camera it can create unwanted visual errors. A transparent texture is usually
used with sprites. The image can turn around its center by changing Rotation property.
TGLPoints
You can create array of points or just one point with this object. Points are dots in space.
They have Size parameter which determines how many pixels in diameter the point will have on
screen. If the point has size 3 it will be represented by 3 pixels on screen whether the point may be
close to the camera or far away from the camera. Perspective does not apply here. Points can be
rounded or squared and antialiased.
GLScene beginner's guide, Jan Zizka, 2005