Fuze Arena Logo
  • Forum
  • Creations
    Catalogue Showcase
  • Help

updateTerrain()

Purpose

Update a 3D terrain

Description

Update a 3D terrain from arrays of heights and colours

Syntax

updateTerrain( terrain, heights, colours )

Arguments

terrain identifer of the terrain from createterrain

heights array containing height of each point on the grid

colour array containing colour of each point on the grid

Example

gsize = 8
landscape = createTerrain( gsize, 1 )
colours = []
heights = []
palette = []
palette[0] = black
palette[1] = white

j = 0
for i = 0 to 64 loop
    j = j + 1
    if i % 8 == 0 then
        j = j + 1
    endIf
    colours[i] = palette[ j % 2 ]
    heights[i] = float( j % 2 )
repeat

updateTerrain( landscape, heights, colours )
setCamera( { gsize / 2, 10, gsize / 2 }, { gsize / 2, 0, gsize / 2 - 1 } )
setAmbientLight( { 0.5, 0.5, 0.5 } )
island = placeObject( landscape, { gsize / 2, 0, gsize / 2 }, { 1, 1, 1 } )

loop
    c = controls( 0 ) // rotate using joysticks
    rotateObject( island, { 1, 0, 0 }, c.ly )
    rotateObject( island, { 0, 0, 1 }, c.lx )
    rotateObject( island, { 0, 1, 0 }, c.rx )
    drawObjects()
    update()
repeat

Associated Commands

createTerrain(), setTerrainPoint()

logo

©2019 FUZE Technologies Ltd. FUZE is a registered trademark of FUZE Technologies Ltd. All rights reserved.

Useful links

  • Fuze Main Site
  • Fuze Arena on Twitter
  • Fuze Arena on Youtube
  • Download Buyer

Contact Information

  • FUZE Technologies Ltd
    15 Clearfields Farm
    Wotton Underwood
    Aylesbury, Buckinghamshire
    ​England, HP18 0RS

  • +44 (0) 1844 239 432

  • contact@fuze.co.uk

© Copyright FUZE Technologies Ltd. All rights reserved.