Functions | |
NIL | amg.init () |
Initializes the 3D engine. More... | |
NIL | amg.quality (NUMBER quality) |
Sets the quality used to load textures. More... | |
NIL | amg.begin () |
Begins 3D rendering. More... | |
NIL | amg.mode2d (NUMBER state) |
Enables/Disables the 2D mode. More... | |
NIL | amg.update () |
Refreshes the screen and draws 3D content. More... | |
NIL | amg.renderstyle (NUMBER type) |
Change the 3D render mode. More... | |
NIL | amg.perspective (NUMBER value) |
Sets the FOV (Field of view). More... | |
NIL | amg.light (NUMBER light, NUMBER state) |
Enables/Disables 1 of the 4 available light sources. More... | |
NIL | amg.poslight (NUMBER light, TABLE pos) |
Changes a light position. More... | |
NIL | amg.typelight (NUMBER light, NUMBER type) |
Sets the light type. More... | |
NIL | amg.colorlight (NUMBER light, COLOR diffuse, COLOR ambient, COLOR specular) |
Sets the light color. More... | |
NIL | amg.spotlight (NUMBER light, TABLE pos, NUMBER spotexp, NUMBER spotcut) |
Configures a focal light (as a lighthouse): SPOTLIGHT. More... | |
NIL | amg.setlightmap (STRING path) |
Changes the light map for Cel-Shading. More... | |
NIL | amg.fog (NUMBER near, NUMBER far, COLOR color) |
Enables the fog. More... | |
NIL | amg.fog () |
Disables the fog. More... | |
BOOLEAN | amg.raytracing (TABLE pos, TABLE vector) |
Makes a Ray Tracing test (checks for colisions between a straight line and 3D objects) More... | |
NIL | amg.gravity (NUMBER x, NUMBER y, NUMBER z) |
Sets the 3D world gravity. More... | |
NIL | amg.screenshot (STRING path) |
Save an image to the specified path (it should include the filename and its extension, only png). More... | |
NIL | amg.finish () |
Finishes the 3D engine. More... | |
3D world properties.
NIL amg.init | ( | ) |
Initializes the 3D engine.
NIL amg.quality | ( | NUMBER | quality | ) |
Sets the quality used to load textures.
quality | The texture quality. Can one of these constants:
|
NIL amg.begin | ( | ) |
Begins 3D rendering.
NIL amg.mode2d | ( | NUMBER | state | ) |
Enables/Disables the 2D mode.
state | Pass 1 to enable, 0 to disable. |
NIL amg.update | ( | ) |
Refreshes the screen and draws 3D content.
NIL amg.renderstyle | ( | NUMBER | type | ) |
Change the 3D render mode.
type | One of the following constants:
|
NIL amg.perspective | ( | NUMBER | value | ) |
Sets the FOV (Field of view).
value | Perspective FOV in degrees (75.0 by default). Must be in degrees. |
NIL amg.light | ( | NUMBER | light, |
NUMBER | state | ||
) |
Enables/Disables 1 of the 4 available light sources.
light | The light to enable (any value between 1 to 4). |
state | Pass 1 to enable, 0 to disable. |
NIL amg.poslight | ( | NUMBER | light, |
TABLE | pos | ||
) |
Changes a light position.
light | The light to move (any value between 1 to 4). |
pos | A table with the position values for the 3 axes (x,y,z). |
NIL amg.typelight | ( | NUMBER | light, |
NUMBER | type | ||
) |
Sets the light type.
light | The light to edit (any value between 1 to 4). |
type | The light type, one of these constants:
|
NIL amg.colorlight | ( | NUMBER | light, |
COLOR | diffuse, | ||
COLOR | ambient, | ||
COLOR | specular | ||
) |
Sets the light color.
light | The light to edit (any value between 1 to 4). |
diffuse | The color for the diffuse component. |
ambient | The color for the ambiental component. |
specular | The color for the specular component. |
NIL amg.spotlight | ( | NUMBER | light, |
TABLE | pos, | ||
NUMBER | spotexp, | ||
NUMBER | spotcut | ||
) |
Configures a focal light (as a lighthouse): SPOTLIGHT.
light | The light to edit (any value between 1 to 4). |
pos | A table with the position values for the 3 axes (x,y,z). |
spotexp | Sets the light size. |
spotcut | Sets the angle of aperture of the light (in degrees). |
NIL amg.setlightmap | ( | STRING | path | ) |
Changes the light map for Cel-Shading.
path | Path to the light map (an image, the smaller the better). |
NIL amg.fog | ( | NUMBER | near, |
NUMBER | far, | ||
COLOR | color | ||
) |
Enables the fog.
near | Value where the fog starts (Z axis). |
far | Value where the fog ends (Z axis). |
color | Fog color. |
NIL amg.fog | ( | ) |
Disables the fog.
BOOLEAN amg.raytracing | ( | TABLE | pos, |
TABLE | vector | ||
) |
Makes a Ray Tracing test (checks for colisions between a straight line and 3D objects)
pos | A table with the ray position values for the 3 axes (x,y,z). |
vector | A table with the ray direction vector values for the 3 axes (x,y,z). |
NIL amg.gravity | ( | NUMBER | x, |
NUMBER | y, | ||
NUMBER | z | ||
) |
Sets the 3D world gravity.
x | X component if the gravity vector. |
y | Y component if the gravity vector. |
z | Z component if the gravity vector. |
NIL amg.screenshot | ( | STRING | path | ) |
Save an image to the specified path (it should include the filename and its extension, only png).
path | The path, filename and extension png of the image. |
NIL amg.finish | ( | ) |
Finishes the 3D engine.