"No one can be told what GeeXLab is, you have to see it for yourself!"

"Stop Playing Games and Start Making Them! With GeeXLab, your are on your way!"


Quick Links
What is GeeXLab
Download GeeXLab
GeeXLab Requirements
Online Help
Articles and Tutorials
Samples Screenshots
Videos

GeeXLab Changelog

XML Ref. Guide
Scripting Ref. Guide
Code Samples

Purchase GeeXLab
GeeXLab SDK

Shader Library

Follow GeeXLab's News
GeeXLab news, articles, tutorials and demos @ Geeks3D.com
GeeXLab @ Twitter GeeXLab RSS Feed

Subscribe to GeeXLab news by email

[ Back to Geeks3D.com ]

GeeXLab

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


Description
Model library

Number of functions: 8

HYP_Model.GetFirstSubMesh

Description
GetFirstSubMesh allows to get the identifier of the first submesh of a model.

Languages: Lua - Python

Parameters
  • model_id [INTEGER]: Model numeric identifier.

    Return Values
  • mesh_id [INTEGER]: submesh numeric identifier.

    Code sample :

    mesh_id = HYP_Model.GetFirstSubMesh(model_id)


    HYP_Model.GetSubMeshByName

    Description
    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.

    Languages: Lua

    Parameters
  • model_id [INTEGER]: Model numeric identifier.
  • sub_mesh_name [STRING]: name of the submesh you want to know the identifier.

    Return Values
  • mesh_id [INTEGER]: submesh numeric identifier.

    Code sample :

    mesh_id = HYP_Model.GetSubMeshByName( model_id, sub_mesh_name)


    HYP_Model.Load

    Description
    Load allows to load a 3d model (*.3DS, *.ASE, *.FBX, *.OBJ, *.O3MDL, etc...) and to automatically add it to the scene tree.

    Languages: Lua - Python

    Parameters
  • 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

    Return Values
  • model_id [INTEGER]: Model numeric identifier.

    Code sample :

    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

    Description
    Unloads a 3D model and frees allocated resources.

    Languages: Lua - Python

    Parameters
  • model_id [INTEGER]: Model numeric identifier.

    Code sample :

    HYP_Model.Unload(model_id)


    HYP_Model.ScaleVertices

    Description
    ScaleVertices allows to apply a scale factor to the vertices of each one of submeshes model.

    Languages: Lua - Python

    Parameters
  • 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

    Code sample :

    HYP_Model.ScaleVertices( model_id, scale_factor_x, scale_factor_y, scale_factor_z )


    HYP_Model.SetVerticesColor

    Description
    SetVerticesColor allows to change the vertices color of all the submeshes of a model.

    Languages: Lua - Python

    Parameters
  • 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

    Return Values
  • x [REAL]: Position in X of collision point.

    Code sample :

    HYP_Model.SetVerticesColor( model_id, r, g, b, a )


    HYP_Model.GetNumFaces

    Description
    GetNumFaces allows to get the number of triangular faces of all sub meshes.

    Languages: Lua - Python

    Parameters
  • model_id [INTEGER]: Model numeric identifier.

    Return Values
  • nfaces [INTEGER]: number of faces.

    Code sample :

    nfaces = HYP_Model.GetNumFaces( model_id )


    HYP_Model.GetNumVertices

    Description
    GetNumVertices allows to get the number of vertices of all sub meshes.

    Languages: Lua - Python

    Parameters
  • model_id [INTEGER]: Model numeric identifier.

    Return Values
  • nverts [INTEGER]: number of vertices.

    Code sample :

    nverts = HYP_Model.GetNumVertices( model_id )




  • Random Projects

    Phong Lighting Multiple Lights
    Phong Lighting Multiple Lights

    Blender Object Viewer
    Blender Object Viewer

    Depth Buffer Visualization
    Depth Buffer Visualization


    Random Code Samples

    Built-in Meshes
    Built-in Meshes

    Revolute joints
    Revolute joints

    Render to texture
    Render to texture



    (C)2009-2010 Geeks3D.com