 Reference Guide Host-API Lua / Python
» Back to Homepage
» Back to Developer's Guide Index
gh_model Library
gh_model is the module that manages models.
A model node allows to define a 3d model. A model is a hierarchy of objects mainly made out of meshes.
Some objects like gizmos (a very simple object node) may belong to this hierarchy to act as a pivot point on which more
complex structures can be built. To keep it simple let's say a model is a kind of interface for easily modifying the properties
of a number of meshes (children). GLSL Hacker can load directly many 3D models formats such as *.3ds, *.obj, *.x, etc.
Number of functions: 2
gh_model.create_from_file
Loads a 3d object filename and creates a model.
: Lua - Python
filename [STRING]: 3d object filename.
is_absolute_path [INTEGER]: Specifies if the path to the filename is relative (0) or absolute (1).
model [INTEGER]: model identifier
:
is_absolute_path = 0 -- relative path
model = gh_model.create_from_file("data/model3d/torus_knot.3ds", is_absolute_path)
gh_model.load_textures
Loads all textures associated with the model. Once the model is loaded, you can load all textures using this function.
: Lua - Python
model [INTEGER]: model identifier.
texture_directory [STRING]: Specifies the textures directory.
absolute_path [INTEGER]: Specifies if the textures directory is relative (0) or absolute (1).
:
abs_path = 0 -- relative path
gh_model.load_textures(model "data/model3d/", abs_path)
|