Quick Links
- Homepage
- Downloads
- Code Sample Pack
- Gallery
- Forum

Documentation
- Overview
- GLSL Programs
- Live Coding
- Hack your first
  GLSL program

- Reference guide

Follow GLSL Hacker

GLSL Hacker @ Twitter

GLSL Hacker

Reference Guide
Host-API Lua / Python



» Back to Homepage
» Back to Developer's Guide Index

gh_model Library


Description
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

Description
Loads a 3d object filename and creates a model.

Languages: Lua - Python

Parameters
  • filename [STRING]: 3d object filename.
  • is_absolute_path [INTEGER]: Specifies if the path to the filename is relative (0) or absolute (1).

    Return Values
  • model [INTEGER]: model identifier

    Code sample :

    is_absolute_path = 0 -- relative path
    model = gh_model.create_from_file("data/model3d/torus_knot.3ds", is_absolute_path)


    gh_model.load_textures

    Description
    Loads all textures associated with the model. Once the model is loaded, you can load all textures using this function.

    Languages: Lua - Python

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

    Code sample :

    abs_path = 0 -- relative path
    gh_model.load_textures(model "data/model3d/", abs_path)






  • (C)2012 Geeks3D