Terrain


Terrain is a complex new feature in Active Worlds 3.3 that allows worlds to have continuous ground objects generated on the fly by the browser. Using terrain, worlds can have mountains, valleys, and everything in between. This feature uses a "continuous level of detail" algorithm that can render large landscapes in realtime by concentrating more polygons up close to the viewer where more detail is needed, and fewer polygons farther away.

At the core of the terrain feature is the elevation grid. This is a grid of elevation values arranged at 10 meter intervals (i.e. the same size as an Active Worlds "cell") across the entire world. As you move through the world, the browser uses this elevation data as the basis for generating a continuous terrain surface. Each cell of terrain data has two properties: an elevation and a texture. Terrain elevation is stored in centimeters and can range from -327 to +327 meters. Terrain can use up to 63 unique textures, each of which can be rotated in one of four directions in each cell. Finally, a terrain cell can also be a 10 x 10 meter "hole". A hole is simply a gap in the terrain, and is useful where something like a staircase to an underground room might be desired.

The terrain feature is off by default and must be activated from the world features dialog. Once activated, the terrain itself can be edited by users or bots with world caretaker privileges only. Note that activating terrain does not automatically disable the old ground object. Usually you will not want to have both terrain and a ground object at the same time, but there are cases where this might be desireable so it is possible to do so.

Terrain for a world can be generated in one of two ways: it can be edited by hand in-world using the browser, or it can be uploaded to the world from some other source (e.g. a USGS DEM file) by writing a program that makes use of the Active Worlds SDK. SDK applications are really the only practical way of uploading large quantities of pre-generated terrain data to a world.

Terrain Textures

The textures used for the terrain come from the texture folder of the world's object path. The textures must be named terrain0.jpg, terrain1.jpg, terrain2.jpg, etc. up to terrain63.jpg. By default, every terrain cell starts out using terrain texture 0, so the default terrain ground texture is terrain0.jpg.

Editing terrain

World caretakers in a world with terrain enabled can edit the terrain at any time simply by right-clicking on any cell. The selected terrain cell will be highlighted in red. Each cell has an associated elevation point at its south eastern corner, and that point will be highlighted by a yellow box. When a terrain cell is selected, the Edit Terrain dialog will also appear:

This dialog allows you to change the elevation and/or texture of the current cell, make it a hole, or even to copy and paste from one terrain cell to the next. The selection of multiple terrain cells is not currently supported.

While a terrain cell is selected, there are also several keyboard shortcuts available to make terrain editing easier:

  • + and - on numeric keypad raises and lowers the terrain cell by one half meter. Holding SHIFT reduces the increment to 5 centimeters. Holding SHIFT and CTRL adjusts the terrain height by a barely visible 1 centimeter.

  • PgUp and PgDn rotate the terrain texture by 90 degrees to the left or right.

  • Home and End cycle up and down through terrain textures.

  • The arrow keys move the current selection one cell forward, back, left, or right.

  • 5 on the numeric keypad resets the currently selected terrain cell to the state it was in when you first selected it.

  • Ctrl-C makes a copy of the currently selected terrain cell's elevation and texture.

  • Ctrl-V pastes the texture of the last copied terrain cell to the current selection (but not the elevation.)

  • Ctrl-B pastes both the texture and elevation of the last copied terrain cell to the current selection.

While editing terrain, it is often useful to enable the cell grid (F10) in order to better visualize how the terrain is broken up into cells.

Note that if a terrain cell is a hole, it is not possible to click directly on that cell to select it. To select a hole, you must click on another non-hole terrain cell nearby and then move the selection over to the hole by using the arrow keys.