What it does
CreateMemblockFromObjectMesh creates FromObjectMesh on a Memblock object. It takes memID (an integer), objID (an integer) and meshIndex (an integer), and returns nothing. That is the first of 2 forms. memID is the id you are giving a memblock: every later call names it by that number.
Syntax
1
CreateMemblockFromObjectMesh(memID integer, objID integer, meshIndex integer)2
CreateMemblockFromObjectMesh(objID integer, meshIndex integer) → integerParameters
| Name | Type | In forms |
|---|---|---|
| memID | integer | 1 |
| objID | integer | all |
| meshIndex | integer | all |
What each form returns
| 1 | CreateMemblockFromObjectMesh(1, object, mesh) | nothing |
| 2 | memblockFromObjectMesh = CreateMemblockFromObjectMesh(1, mesh) | integer |
Example · generated
Form 1, you choose the id yourself
object = CreateObjectFromHeightMap("assets/media.obj", 64.0, 64.0, 1.0, 1, 1)mesh = CreateObjectFromObjectMesh(1, 1)CreateMemblockFromObjectMesh(1, object, mesh)DO Sync()LOOPForm 2, the command hands back the id
mesh = CreateObjectFromObjectMesh(1, 1)memblockFromObjectMesh = CreateMemblockFromObjectMesh(1, mesh)DO Sync()LOOPCreateObjectFromHeightMap and CreateObjectFromObjectMesh are there to give the call something to act on; CreateMemblockFromObjectMesh is the line that matters. 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.