LoadObject

Family: 3D · 4 forms

What it does

LoadObject writes to a 3D object: it loads rather than reads. It takes fileName (a string), and answers an integer. That is the first of 4 forms.

Syntax

1
LoadObject(fileName string) → integer
2
LoadObject(fileName string, height float) → integer
3
LoadObject(objectID integer, fileName string)
4
LoadObject(objectID integer, fileName string, height float)

Parameters

NameTypeIn forms
fileNamestringall
heightfloat2, 4
objectIDinteger3, 4

What each form returns

1object = LoadObject("assets/model.obj")integer
2object = LoadObject("assets/model.obj", 64.0)integer
3LoadObject(1, "assets/model.obj")nothing
4LoadObject(1, "assets/model.obj", 64.0)nothing

Example · generated

Form 1, the command hands back the id

object = LoadObject("assets/model.obj")DO  Sync()LOOP

Form 3, you choose the id yourself

LoadObject(1, "assets/model.obj")DO  Sync()LOOP

LoadObject 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