Vizard 7 » Reference » 3D models » Node plugins » InfiniteTerrain
7.6

Infinite Terrain

This plug-in dynamically generates 3D terrain as far as the viewer can see.

Procedure

import viz
import vizcam
viz.go()

#Add keyboard/mouse camera
cam = vizcam.FlyNavigate()
cam.sensitivity(100.0, 1.0)

#Add a texture and set it to repeat mode.
grass = viz.addTexture('images/tile_grass.jpg', wrap=viz.REPEAT)

#Add the terrain using the infinte terrain plug-in.
terrain = viz.add('InfiniteTerrain.dlc',1,'456',7,6,15000,0.0005)

#Texture the terrain.
terrain.texture(grass)

Parameters

The following parameters are available for the infinite terrain plug-in.

Parameter

Specifies

Default

Random number

Initializes the random number generator.

none

Tesselation level

Sets tesselation. Smaller values produce less detail and faster rendering.

6

Texture repeat level

Set how frequently the texture is repeated.

4

Viewing distance

Sets how far into the distance the surface is rendered.

4096

LOD factor

Sets the level of detail. Smaller numbers set the LOD further away and reduces 'popping'.

.001

Advanced options

All plug-in objects provide a mechanism for setting advanced options.  These are controlled through the "command" method and by passing one or more parameters.

 

Available commands:

Command number

Description

1

Sets the height scales of the terrain.

Example:

#Set heightscale1 to 150 and heightscale2 to 5.
#Height scales are used for generating terrain height where
#formula = heightscale1 * random() + heightscale2 * random().
terrain.command(1,'',150,5)