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) → integer2
LoadObject(fileName string, height float) → integer3
LoadObject(objectID integer, fileName string)4
LoadObject(objectID integer, fileName string, height float)Parameters
| Name | Type | In forms |
|---|---|---|
| fileName | string | all |
| height | float | 2, 4 |
| objectID | integer | 3, 4 |
What each form returns
| 1 | object = LoadObject("assets/model.obj") | integer |
| 2 | object = LoadObject("assets/model.obj", 64.0) | integer |
| 3 | LoadObject(1, "assets/model.obj") | nothing |
| 4 | LoadObject(1, "assets/model.obj", 64.0) | nothing |
Example · generated
Form 1, the command hands back the id
object = LoadObject("assets/model.obj")DO Sync()LOOPForm 3, you choose the id yourself
LoadObject(1, "assets/model.obj")DO Sync()LOOPLoadObject 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.