CreateObjectFromHeightMap

Family: 3D · 2 forms

What it does

CreateObjectFromHeightMap brings a 3D object into being: it is how the rest of the program comes to have one. It takes szImageFile (a string), width (a float), height (a float), length (a float), smoothing (an integer) and split (an integer), and answers an integer. That is the first of 2 forms.

Syntax

1
CreateObjectFromHeightMap(szImageFile string, width float, height float, length float, smoothing integer, split integer) → integer
2
CreateObjectFromHeightMap(objID integer, szImageFile string, width float, height float, length float, smoothing integer, split integer)

Parameters

NameTypeIn forms
szImageFilestringall
widthfloatall
heightfloatall
lengthfloatall
smoothingintegerall
splitintegerall
objIDinteger2

What each form returns

1objectFromHeightMap = CreateObjectFromHeightMap("assets/model.obj", 64.0, 64.0, 1.0, 1, 1)integer
2CreateObjectFromHeightMap(1, "assets/model.obj", 64.0, 64.0, 1.0, 1, 1)nothing

Example · generated

Form 1, the command hands back the id

objectFromHeightMap = CreateObjectFromHeightMap("assets/model.obj", 64.0, 64.0, 1.0, 1, 1)DO  Sync()LOOP

Form 2, you choose the id yourself

CreateObjectFromHeightMap(1, "assets/model.obj", 64.0, 64.0, 1.0, 1, 1)DO  Sync()LOOP

CreateObjectFromHeightMap is called and its answer is printed every frame. The DO … LOOP is not decoration: a classic BASIC program ends the moment it runs out of lines, and Sync() is what draws the frame.

286 commands in 3D