Functions | |
MODEL3D | model3d.load (STRING path) |
Loads a 3D model (OBJ and MTL formats are supported). More... | |
MODEL3D | model3d.load (STRING path, NUMBER css) |
Loads a 3D model (OBJ and MTL formats are supported). More... | |
NUMBER | model3d.countobj (MODEL3D model) |
Calculates the number of objects inside a 3D model. More... | |
NIL | model3d.shading (MODEL3D model, NUMBER cs) |
Enables/Disables Cel-Shading on a 3D model. More... | |
NIL | model3d.shading (MODEL3D model, NUMBER cs, COLOR linecolor) |
Enables/Disables Cel-Shading on a 3D model. More... | |
NIL | model3d.lighting (MODEL3D model, NUMBER object, NUMBER lt) |
Sets if a object inside a 3D model will be affected by the lights. More... | |
NIL | model3d.render (MODEL3D model, NUMBER draw_type) |
Renders a 3D model. More... | |
NIL | model3d.render (MODEL3D model, NUMBER draw_type, NUMBER object) |
Renders a 3D model or parts of it (if the model contains several sub-objetcs), with three render modes. More... | |
NIL | model3d.rotation (MODEL3D model, NUMBER object, TABLE rot) |
Rotates an object inside the 3D model. More... | |
TABLE | model3d.getrotation (MODEL3D model, NUMBER object) |
Gets the current rotation values of an object inside the 3D model. More... | |
NIL | model3d.position (MODEL3D model, NUMBER object, TABLE pos) |
Changes the position of an object inside the 3D model. More... | |
TABLE | model3d.getposition (MODEL3D model, NUMBER object) |
Gets the current position values of an object inside the 3D model. More... | |
NIL | model3d.scaling (MODEL3D model, NUMBER object, TABLE scal) |
Scales an object inside the 3D model. More... | |
TABLE | model3d.getscaling (MODEL3D model, NUMBER object) |
Gets the current scaling values of an object inside the 3D model. More... | |
NIL | model3d.startreflection (MODEL3D model, NUMBER object) |
Initializes the shadow and reflections engine, setting an object inside the 3D model as a floor. More... | |
NIL | model3d.mirror (MODEL3D model, NUMBER object, NUMBER eje) |
Renders the reflection of a 3D model on the floor. More... | |
NIL | model3d.shadow (MODEL3D model, NUMBER object, NUMBER light) |
Renders the shadow. More... | |
NIL | model3d.blitshadow (MODEL3D model, NUMBER object, NUMBER light, NUMBER alpha, NUMBER type) |
Starts drawing volumetric shadows, Draw the model that receives the shadows. More... | |
NIL | model3d.finishreflection () |
Finishes the shadow and reflections engine. More... | |
NIL | model3d.initphysics (NUMBER max_objects) |
Inicializes the physics engine. More... | |
NIL | model3d.initphysics (TABLE world_size1, TABLE world_size2, NUMBER max_objects) |
Inicializes the physics engine. More... | |
NIL | model3d.modelphysics (MODEL3D Model) |
Links a 3D model to simulate it. More... | |
NIL | model3d.deletephysics (MODEL3D Model) |
Unlinks a 3D model. More... | |
NIL | model3d.updatephysics () |
Updates the 3D physics. More... | |
NIL | model3d.setphysics (MODEL3D Model, NUMBER Object, TABLE Origin, TABLE Position, NUMBER Mass, NUMBER ShapeType) |
Sets the physics components af a 3D model. More... | |
NIL | model3d.finishphysics () |
Finishes the 3D physics engine. More... | |
NIL | model3d.setvelocity (MODEL3D Model, NUMBER object, TABLE vel) |
Sets the 3D object linear speed. More... | |
TABLE | model3d.getvelocity (MODEL3D Model, NUMBER object) |
Gets the linear speed of an object inside the 3D model. More... | |
BOOLEAN | model3d.collision (MODEL3D Model1, NUMBER object1, MODEL3D Model2, NUMBER object2) |
Checks if 2 objects of 2 3D models are colliding. More... | |
NIL | model3d.setdamping (MODEL3D Model, NUMBER object, NUMBER lineal, NUMBER angular) |
Sets the damping coefficient of an object inside a 3D model. More... | |
NUMBER | model3d.getdamping (MODEL3D Model, NUMBER object) |
Gets the damping coefficient of an object inside a 3D model. More... | |
MODEL3D | model3d.newmap (STRING path) |
Makes a heights map using a grayscale image. More... | |
3D model management.
MODEL3D model3d.load | ( | STRING | path | ) |
Loads a 3D model (OBJ and MTL formats are supported).
path | Path to the .OBJ file (supports directories). |
MODEL3D model3d.load | ( | STRING | path, |
NUMBER | css | ||
) |
Loads a 3D model (OBJ and MTL formats are supported).
path | Path to the .OBJ file (supports directories). |
css | Size of the Cel-Shading. |
NUMBER model3d.countobj | ( | MODEL3D | model | ) |
Calculates the number of objects inside a 3D model.
model | A 3D model. |
NIL model3d.shading | ( | MODEL3D | model, |
NUMBER | cs | ||
) |
Enables/Disables Cel-Shading on a 3D model.
model | A 3D model. |
cs | Pass 1 to enable, 0 to disable. |
NIL model3d.shading | ( | MODEL3D | model, |
NUMBER | cs, | ||
COLOR | linecolor | ||
) |
Enables/Disables Cel-Shading on a 3D model.
model | A 3D model. |
cs | Pass 1 to enable, 0 to disable. |
linecolor | Color for the Cel-Shading. |
NIL model3d.lighting | ( | MODEL3D | model, |
NUMBER | object, | ||
NUMBER | lt | ||
) |
Sets if a object inside a 3D model will be affected by the lights.
model | A 3D model. |
object | The object inside the 3D model to edit. |
lt | Pass 1 to enable and 0 to disable the object lightning. |
NIL model3d.render | ( | MODEL3D | model, |
NUMBER | draw_type | ||
) |
Renders a 3D model.
model | A 3D model. |
draw_type | Render mode, one of the following values:
|
NIL model3d.render | ( | MODEL3D | model, |
NUMBER | draw_type, | ||
NUMBER | object | ||
) |
Renders a 3D model or parts of it (if the model contains several sub-objetcs), with three render modes.
model | The 3D model. |
draw_type | Render mode, one of the following values:
|
object | Selects a sub-object from the model.
|
NIL model3d.rotation | ( | MODEL3D | model, |
NUMBER | object, | ||
TABLE | rot | ||
) |
Rotates an object inside the 3D model.
model | A 3D model. |
object | The object inside the 3D model to edit. |
rot | A table with the object rotation values for the 3 axes (x,y,z). |
TABLE model3d.getrotation | ( | MODEL3D | model, |
NUMBER | object | ||
) |
Gets the current rotation values of an object inside the 3D model.
model | A 3D model. |
object | The object inside the 3D model. |
NIL model3d.position | ( | MODEL3D | model, |
NUMBER | object, | ||
TABLE | pos | ||
) |
Changes the position of an object inside the 3D model.
model | A 3D model. |
object | The object inside the 3D model to edit. |
pos | A table with the object position values for the 3 axes (x,y,z). |
TABLE model3d.getposition | ( | MODEL3D | model, |
NUMBER | object | ||
) |
Gets the current position values of an object inside the 3D model.
model | A 3D model. |
object | The object inside the 3D model. |
NIL model3d.scaling | ( | MODEL3D | model, |
NUMBER | object, | ||
TABLE | scal | ||
) |
Scales an object inside the 3D model.
model | A 3D model. |
object | The object inside the 3D model to edit. |
scal | A table with the object scaling values for the 3 axes (x,y,z). |
TABLE model3d.getscaling | ( | MODEL3D | model, |
NUMBER | object | ||
) |
Gets the current scaling values of an object inside the 3D model.
model | A 3D model. |
object | The object inside the 3D model. |
NIL model3d.startreflection | ( | MODEL3D | model, |
NUMBER | object | ||
) |
Initializes the shadow and reflections engine, setting an object inside the 3D model as a floor.
model | A 3D model. |
object | The object to use as floor. |
NIL model3d.mirror | ( | MODEL3D | model, |
NUMBER | object, | ||
NUMBER | eje | ||
) |
Renders the reflection of a 3D model on the floor.
model | A 3D model. |
object | The "reflection" object. |
eje | Axis to render the reflection (X, Y or Z).
|
NIL model3d.shadow | ( | MODEL3D | model, |
NUMBER | object, | ||
NUMBER | light | ||
) |
Renders the shadow.
model | A 3D model. |
object | The "shadow" object. |
light | The light that casts the shadow (any value between 1 to 4). |
NIL model3d.blitshadow | ( | MODEL3D | model, |
NUMBER | object, | ||
NUMBER | light, | ||
NUMBER | alpha, | ||
NUMBER | type | ||
) |
Starts drawing volumetric shadows, Draw the model that receives the shadows.
model | The model that casts the shadow. |
object | Select an object inside the model. |
light | Light used to cast the shadow. |
alpha | Shadow transparency. |
type | Shadow parameter, static or dynamic: 1 to rotate the shadow and 0 static. |
NIL model3d.finishreflection | ( | ) |
Finishes the shadow and reflections engine.
NIL model3d.initphysics | ( | NUMBER | max_objects | ) |
Inicializes the physics engine.
max_objects | The maximum number of 3D objects. |
NIL model3d.initphysics | ( | TABLE | world_size1, |
TABLE | world_size2, | ||
NUMBER | max_objects | ||
) |
Inicializes the physics engine.
world_size1 | 3D world size (minimum coordinates). |
world_size2 | 3D world size (maximum coordinates). |
max_objects | The maximum number of 3D objects. |
NIL model3d.modelphysics | ( | MODEL3D | Model | ) |
Links a 3D model to simulate it.
Model | A 3D model. |
NIL model3d.deletephysics | ( | MODEL3D | Model | ) |
Unlinks a 3D model.
Model | A 3D model. |
NIL model3d.updatephysics | ( | ) |
Updates the 3D physics.
NIL model3d.setphysics | ( | MODEL3D | Model, |
NUMBER | Object, | ||
TABLE | Origin, | ||
TABLE | Position, | ||
NUMBER | Mass, | ||
NUMBER | ShapeType | ||
) |
Sets the physics components af a 3D model.
Model | A 3D model. |
Object | The object inside the 3D model to edit. |
Origin | A table with the coordinates of the 3D model origin (normally its center). |
Position | A table with the coordinates of the 3D model initial position. |
Mass | The object mass (pass 0 to use it as floor). |
ShapeType | The object shape, one of these constants:
|
NIL model3d.finishphysics | ( | ) |
Finishes the 3D physics engine.
NIL model3d.setvelocity | ( | MODEL3D | Model, |
NUMBER | object, | ||
TABLE | vel | ||
) |
Sets the 3D object linear speed.
Model | A 3D model. |
object | The object inside the 3D model to edit. |
vel | A table with the speed values for the 3 axes (x,y,z). |
TABLE model3d.getvelocity | ( | MODEL3D | Model, |
NUMBER | object | ||
) |
Gets the linear speed of an object inside the 3D model.
Model | A 3D model. |
object | The object inside the 3D model. |
BOOLEAN model3d.collision | ( | MODEL3D | Model1, |
NUMBER | object1, | ||
MODEL3D | Model2, | ||
NUMBER | object2 | ||
) |
Checks if 2 objects of 2 3D models are colliding.
Model1 | The first model. |
object1 | The first object. |
Model2 | The second model. |
object2 | the second object. |
NIL model3d.setdamping | ( | MODEL3D | Model, |
NUMBER | object, | ||
NUMBER | lineal, | ||
NUMBER | angular | ||
) |
Sets the damping coefficient of an object inside a 3D model.
Model | A 3D model. |
object | The object inside the 3D model to edit. |
lineal | The damping coefficient for linear movements (a higher value produces less rebound). |
angular | The damping coefficient for rotational movements (a higher value produces less rotation). |
NUMBER model3d.getdamping | ( | MODEL3D | Model, |
NUMBER | object | ||
) |
Gets the damping coefficient of an object inside a 3D model.
Model | A 3D model. |
object | The object inside the 3D model. |
MODEL3D model3d.newmap | ( | STRING | path | ) |
Makes a heights map using a grayscale image.
path | Path to the image (recommended 64x64pix or less). |