Quick Links
> Homepage
|-- Overview
|-- Download
|-- Screenshots
|-- Community

> Code Sample Pack

> Reference Guide

> Changelog

> Overview of GLSL Hacker
> Live Coding
> Hack your first GLSL Code
> Moon3D


GLSL Hacker Articles

> Compute shaders on Radeon
> Distance functions in GLSL
> GLSL Interpolation Qualifiers
> Tessellation Spacing Modes
> Normal Visualizer with GS
> 3D Surface Plots
> Normal Mapping
> Circle and Disc in GLSL
> PhysX 3 Flag Demo
> GLSL Hacker on Raspberry Pi
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: 5

gh_model.create_from_file

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

Languages: Lua - Python

Parameters
  • model_filename [STRING]: 3d object filename.
  • model_directory [STRING]: directory of the model filename.
  • resource_directory [STRING]: directory of the resources used by the model (usually textures).

    Return Values
  • model [INTEGER]: model identifier

    Code sample :

    model_filename = "wheel.3ds"
    model_directory = "data/"
    resource_directory = "data/"
    model = gh_model.create_from_file(model_filename, model_directory, resource_directory)


    gh_model.create_from_file_loader_3ds

    Description
    Loads a *.3ds object filename and creates a model.

    Languages: Lua - Python

    Parameters
  • model_filename [STRING]: 3d object filename.
  • model_directory [STRING]: directory of the model filename.
  • resource_directory [STRING]: directory of the resources used by the model (usually textures).

    Return Values
  • model [INTEGER]: model identifier

    Code sample :

    model_filename = "wheel.3ds"
    model_directory = "data/"
    resource_directory = "data/"
    model = gh_model.create_from_file_loader_3ds(model_filename, model_directory, resource_directory)


    gh_model.create_from_file_loader_obj

    Description
    Loads a *.obj object filename and creates a model.

    Languages: Lua - Python

    Parameters
  • model_filename [STRING]: 3d object filename.
  • model_directory [STRING]: directory of the model filename.
  • resource_directory [STRING]: directory of the resources used by the model (usually textures).

    Return Values
  • model [INTEGER]: model identifier

    Code sample :

    model_filename = "wheel.obj"
    model_directory = "data/"
    resource_directory = "data/"
    model = gh_model.create_from_file_loader_obj(model_filename, model_directory, resource_directory)


    gh_model.create_from_file_loader_fbx

    Description
    Loads a *.fbx, *.3ds or *.obj object filename and creates a model.

    Languages: Lua - Python

    Parameters
  • model_filename [STRING]: 3d object filename.
  • model_directory [STRING]: directory of the model filename.
  • resource_directory [STRING]: directory of the resources used by the model (usually textures).

    Return Values
  • model [INTEGER]: model identifier

    Code sample :

    model_filename = "wheel.fbx"
    model_directory = "data/"
    resource_directory = "data/"
    model = gh_model.create_from_file_loader_fbx(model_filename, model_directory, resource_directory)


    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.

    Code sample :

    gh_model.load_textures(model "data/")





  • (C)2012-2013 Geeks3D