[ Back to Geeks3D.com ]
 GeeXLab
Laboratory for Real Time 3D Programming (prototyping and demos) OpenGL, Lua, Python, GLSL, PhysX and more...Reference Guide Host-API Lua / Python
» Back to Homepage
» Back to Developer's Guide Index
HYP_Model Library
Model library
Number of functions: 8
HYP_Model.GetFirstSubMesh
GetFirstSubMesh allows to get the identifier of the first submesh of a model.
: Lua - Python
model_id [INTEGER]: Model numeric identifier.
mesh_id [INTEGER]: submesh numeric identifier.
: mesh_id = HYP_Model.GetFirstSubMesh(model_id)
HYP_Model.GetSubMeshByName
GetSubMeshByName allows to get the model submesh identifier.
This function is useful to access a submesh which is not declared in the main XML script.
: Lua
model_id [INTEGER]: Model numeric identifier.
sub_mesh_name [STRING]: name of the submesh you want to know the identifier.
mesh_id [INTEGER]: submesh numeric identifier.
: mesh_id = HYP_Model.GetSubMeshByName( model_id, sub_mesh_name)
HYP_Model.Load
Load allows to load a 3d model (*.3DS, *.ASE, *.FBX, *.OBJ, *.O3MDL, etc...)
and to automatically add it to the scene tree.
: Lua - Python
filename [STRING]: Path to the model file name.
isAbsolutePath [INTEGER]: Specifies whether the path is absolute (1) or relative (0).
loading_options [INTEGER]: combination of the following options:
MODEL_LOADING_OPTION_LOAD_TEXTURE = 1
MODEL_LOADING_OPTION_TEX_RGB_BYTE = 2
MODEL_LOADING_OPTION_COMPUTE_VERTEX_NORMALS = 4
MODEL_LOADING_OPTION_DEFAULT = 7 (MODEL_LOADING_OPTION_LOAD_TEXTURE + MODEL_LOADING_OPTION_TEX_RGB_BYTE + MODEL_LOADING_OPTION_COMPUTE_VERTEX_NORMALS)
MODEL_LOADING_OPTION_TEX_RGBA_FLOAT = 8
MODEL_LOADING_OPTION_TEX_COMPRESSION = 16
MODEL_LOADING_OPTION_LOAD_BUMP_MAP_DOT3 = 32
MODEL_LOADING_OPTION_COMPUTE_TANGENT_SPACE_VECTORS = 64
MODEL_LOADING_OPTION_GEN_MIPMAP = 128
MODEL_LOADING_OPTION_DESTROY_PIXMAP_BUFFERS_AFTER_UPLOAD = 256 - Values =
MODEL_LOADING_OPTION_LOAD_TEXTURE = 1,
MODEL_LOADING_OPTION_TEX_RGB_BYTE = 2,
MODEL_LOADING_OPTION_COMPUTE_VERTEX_NORMALS = 4,
MODEL_LOADING_OPTION_DEFAULT = 7 (MODEL_LOADING_OPTION_LOAD_TEXTURE + MODEL_LOADING_OPTION_TEX_RGB_BYTE + MODEL_LOADING_OPTION_COMPUTE_VERTEX_NORMALS),
MODEL_LOADING_OPTION_TEX_RGBA_FLOAT = 8,
MODEL_LOADING_OPTION_TEX_COMPRESSION = 16,
MODEL_LOADING_OPTION_LOAD_BUMP_MAP_DOT3 = 32,
MODEL_LOADING_OPTION_COMPUTE_TANGENT_SPACE_VECTORS = 64,
MODEL_LOADING_OPTION_GEN_MIPMAP = 128,
MODEL_LOADING_OPTION_DESTROY_PIXMAP_BUFFERS_AFTER_UPLOAD = 256
model_id [INTEGER]: Model numeric identifier.
: MODEL_LOADING_OPTION_LOAD_TEXTURE = 1 MODEL_LOADING_OPTION_TEX_RGBA_FLOAT = 8 isAbsolutePath = 0 teapot_id = HYP_Model.Load("data/teapot.3ds", isAbsolutePath, MODEL_LOADING_OPTION_LOAD_TEXTURE + MODEL_LOADING_OPTION_TEX_RGBA_FLOAT) HYP_Object.SetPosition(teapot_id, 0.0, 50.0, -20.0)
HYP_Model.Unload
Unloads a 3D model and frees allocated resources.
: Lua - Python
model_id [INTEGER]: Model numeric identifier.
: HYP_Model.Unload(model_id)
HYP_Model.ScaleVertices
ScaleVertices allows to apply a scale factor to the vertices of each one of submeshes model.
: Lua - Python
model_id [INTEGER]: Model numeric identifier.
scale_factor_x [REAL]: X scaling factor of the vertex - Values = 1.0
scale_factor_y [REAL]: Y scaling factor of the vertex - Values = 1.0
scale_factor_z [REAL]: Z scaling factor of the vertex - Values = 1.0
: HYP_Model.ScaleVertices( model_id, scale_factor_x, scale_factor_y, scale_factor_z )
HYP_Model.SetVerticesColor
SetVerticesColor allows to change the vertices color of all the submeshes of a model.
: Lua - Python
model_id [INTEGER]: Model numeric identifier.
new_r [REAL]: red component of the vertices color
new_g [REAL]: green component of the vertices color
new_b [REAL]: blue component of the vertices color
new_a [REAL]: alpha component of the vertices color
x [REAL]: Position in X of collision point.
: HYP_Model.SetVerticesColor( model_id, r, g, b, a )
HYP_Model.GetNumFaces
GetNumFaces allows to get the number of triangular faces of all sub meshes.
: Lua - Python
model_id [INTEGER]: Model numeric identifier.
nfaces [INTEGER]: number of faces.
: nfaces = HYP_Model.GetNumFaces( model_id )
HYP_Model.GetNumVertices
GetNumVertices allows to get the number of vertices of all sub meshes.
: Lua - Python
model_id [INTEGER]: Model numeric identifier.
nverts [INTEGER]: number of vertices.
: nverts = HYP_Model.GetNumVertices( model_id )
|