Referencia › Terrain — 25 comandos


clearallterrain

terrain

Entrada: none
Salida: none

Clears all terrain in all spaces.

clearallterrain

clearterrain

terrain

Entrada: none
Salida: none

Clears all terrain defined in the current space. Terrain created by system turtles will only be cleared if clearterrain is called by a system turtle. See setterrain

clearterrain

elevation

terrain

Entrada: [x y] (list)
Salida: elevation (number)

Returns the elevation of the terrain at the provided co-ordinates. See setelevation, setterrain

show elevation [10 20]

elevationsnap

terrain

Entrada: none
Salida: none

Causes the calling turtle to 'snap' to the center of the current elevation 'sector' determined by the terrainresolution. See noelevationsnap, setterrainresolution, elevationsnapp

elevationsnap

hideterrain

terrain

Entrada: none
Salida: none

Hides the terrain in the current space. See showterrain.

hideterrain

lockelevation

terrain

Entrada: none
Salida: none

Locks the calling turtle to the elevation of the terrain at the turtle's current xy position. See nolockelevation, elevationsnap

lockelevation

lockelevationmode

terrain

Entrada: none
Salida: list

Returns the current value(s) used by setlockelevationmode, which determins its behavior. See setlockelevationmode

show lockelevationmode

noelevationsnap

terrain

Entrada: none
Salida: none

Causes the calling turtle to NOT 'snap' to the center of the current elevation 'sector' determined by the terrainresolution. See elevationsnap, setterrainresolution

noelevationsnap

nolockelevation

terrain

Entrada: none
Salida: none

Unlocks the calling turtle from the elevation of the terrain at the turtle's current xy position. See lockelevation, elevationsnap

nolockelevation

setelevation

terrain

Entrada: [x y elevation] list OR [[x y elevation][x2 y2 elevation2]…]]
Salida: none

Sets the elevation height of the terrain at the specified x and y co-ordinates. If a floor value is set in the terrain impacted by setelevation, the elevation will be set to the floor value if it is greater than the elevation specified, unless the new elevation is provided as a list of a single value. setelevation can also take list of lists. See elevation, setterrain

setelevation [10 20 10]

setterrain

terrain

Entrada: [x1 y1 x2 y2] (list) | [height floor ceiling] (list) | seed (number) | algorithm (word) OR [algorithm magnification (octaves)] | style (word)
Salida: none

Creates terrain on the z-plane between the specified x and y co-ordinates. These co-ordinates represent 10 turtle-units, and the output can be scaled using setterrainresolution. height specifies the maximum height in terms of single turtle-units, similarly scaled using setterrainresolution. The floor value specifies the lowest level rendered, and any values lower than that value are rendered at the floor level. Similarly, the ceiling value represents the highest value rendered, and anything higher is lowered to that value. The seed is provided to the algorithm that generates the terrain, the algorithm is the method used (currently only fbm and flat (no algorithm) are supported) and the style (voxel, line, triangle or combo (line and triangle) – note that combo uses the terraininterior color to render its lines). Providing a list containing the algorithm type and a multiplier allow you to 'zoom in' or out on the terrain, making it more dense and complex, or spacious and simple. Multiple blocks of terrain can be defined so long as they do not overlap. See terrain, setterrainresolution, setterraincolors, setterraininterior, setelevation, elevation, lockelevation, elevationsnap, unlockelevation

setterrain [-10 -10 10 10] [25] 25 "fbm "voxel

setterraincolors

terrain

Entrada: [[maxelev fillcolor fillshade][maxelev2 fillcolor fillshade]…] (list of lists)
Salida: none

Sets the terrain colors used in subsequent terrain creation. Lower elevations override higher ones. See setterrain, terraincolors

setterraincolors [[10 2 0] [14 4 0] [18 15 0]]

setterraininterior

terrain

Entrada: number
Salida: none

Sets the color of the interior of terrain subsequently generated using the setterrain primitive. See setterrain, setterraincolors

setterraininterior brown

setterrainresolution

terrain

Entrada: number
Salida: none

Sets the 'resolution' of the terrain, or the size of each 'sector' in turtle-units within the terrain 'grid' which expands out from [0 0]. For example, the higher the terrainresolution is the larger each voxel is in the terrain in the voxel mode, and the more area the terrain covers. See setterrain, terrainresolution

setterrainreolution 5

showterrain

terrain

Entrada: none
Salida: none

Shows the terrain. See hideterrain, setterrain

showterrain

terrain

terrain

Entrada: none
Salida: list

Returns the parameters provided to the last invocation of the setterrain primitive. See setterrain

show terrain

terraincolors

terrain

Entrada: none
Salida: list

Returns the current terrain colors. New terrain generated will use these values. See setterraincolors

show terraincolors

terraininterior

terrain

Entrada: none
Salida: number

Returns the current terraininterior value. New terrain generated will use this value. See setterraininterior

show terraininterior

terrainresolution

terrain

Entrada: none
Salida: number

Returns the value of the terrainresolution. See terrainresolution, setterrain

show terrainresolution

terrainxy

terrain

Entrada: [x y] [height floor ceiling] seed algorithm OR [algorithm magnification]
Salida: number

Returns elevation for given parameters, fixed to global grid (as if the center of the terrain is 0,0). This can be used to generate algorithmic 'noise'. The only current algorithm is fbm. See setterrain

show terrainxy [0 0] [50 0 50] 128 "fbm

terraform

terrain

Entrada: none
Salida: none

Enables terraform mode: shapes drawn afterwards have their vertices displaced along their normals by fractal noise, turning smooth shapes into terrain — an icosphere becomes a planet, with vertices at or below sea level clamped flat and taking the pen colour as water. Applies per turtle to any built shape, and is distinct from the terrain family, which sculpts the world's terrain grid rather than individual shapes. Configure with setterraformsettings; noterraform turns the mode off. See noterraform, setterraformsettings, terraformsettings, terraformp

terraform
setterraformsettings [5 42 3 20 0.5 1 0]
icosphere 50

noterraform

terrain

Entrada: none
Salida: none

Disables terraform mode: shapes drawn afterwards render normally again. Shapes already drawn while the mode was on keep their terraformed form. See terraform

noterraform

terraformp

terrain

Entrada: none
Salida: boolean

Returns true if terraform mode is enabled for the current turtle. See terraform, noterraform

show terraformp
true

setterraformsettings

terrain

Entrada: [pointmultiplier seed frequency scale minlevel maxlevel wireframe]
Salida: none

Configures terraform mode with a positional list; a shorter list leaves later values on their current setting. pointmultiplier (1 to 7) sets the point resolution of the built shape — higher gives the noise more vertices to displace; seed seeds the noise so a given landscape is reproducible; frequency sets how many noise cycles fit across the shape; scale sets the elevation as a percentage of the shape's radius; minlevel (0 to 1) is sea level — vertices at or below it clamp flat and take the pen colour as water; maxlevel (0 to 1) plateaus land above it; wireframe (boolean) renders the terraformed shape as a wire mesh. See terraform, terraformsettings

terraform
setterraformsettings [5 42 3 20 0.5 1 0]
icosphere 50

terraformsettings

terrain

Entrada: none
Salida: list

Returns the current terraform settings as a seven-value list in setterraformsettings order: pointmultiplier, seed, frequency, scale, minlevel, maxlevel and wireframe. The result can be passed back to setterraformsettings unchanged. See setterraformsettings, terraform

show terraformsettings
[5 42 3 20 0.5 1 0]