Page 15/36
GLScene. Time Interval in milliseconds triggers onTimer event. This event is independent of
cadencer progress event. Async timer is not recommended to replace the cadencer. It is used to
execute actions in fixed longer time intervals rather than take care about rendering the scene.
GLStaticImposterBuilder
Imposters are clever way how to improve performance dramatically. The basic idea
behind imposters is that before rendering a set of images looking at an object from all sides is
rendered and stored in memory. If the object is to be rendered a sprite (2D image) is drawn instead
of the mesh. The most appropriate image has to be selected according to the objects orientation to
the camera. This technique is great for many same objects with high polygon count scattered around
the scene. On the other hand it consumes a lot of memory.
The task of imposter builder is to generate all the images. You can set the size of the image
and number of angles images are to be rendered from. This is done by adding coronas. Each corona
has minimum and maximum angles as well as number of images in this range. For example if you
make corona ranging from 0º to 15º with 24 images the imposter will cover spherical segments 15º
wide and 15º high around equator of the object. You must call RequestImposterFor function to
generate the coronas.
Following section describes five HDS components. Height Data Source components provide
data for TGLTerrainRenderer. Terrain is used for rendering large outdoor sceneries. HDS
components load terrain data from different formats and supply suitable data for terrain renderer.
GLBitmapHDS
This is the easiest format. Bitmap HDS loads grayscale image and converts the data into
height field. The grayscale image must be 16 bit. Most paint programs use 8 bit grayscale palette.
Make sure you convert the image to 16 bit otherwise the terrain will look terraced. White parts of
the image represent the highest altitude and black parts represent zero altitude.
TGLCustomHDS
[TODO]
GLHeightTileFileHDS
The source for height field HDS is .htf file. These files are created in [TODO]. This
format is most suitable for really large terrains. Ground texture coordinates together with TileSize
property are included in .htf file. TileSize of terrain renderer must be the same as TileSize in .htf file.
GLBumpmapHDS
[TODO]
GLPerlinHDS
[TODO]
CollisionManager
[TODO]
GLAnimationControler
Animation controller is used together with TGLActor object. Animation controller stores
animations that are used by actor. Animations can be loaded from Quake md2 format or from
Halflife smd format. Animations are accessed by index or name. They can loop, play once or
GLScene beginner's guide, Jan Zizka, 2005