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_node Library


Description
gh_node is the module that manages all kind of nodes in the scene. Every object, gpu program, texture, material in the scene is derived from the node. A scene can be seen as a tree of nodes.

Number of functions: 8

gh_node.getid

Description
Gets the identifier (id) of a node from its name.

Languages: Lua - Python

Parameters
  • name [STRING]: name of node.

    Return Values
  • node_id [INTEGER]: node identifier

    Code sample :

    gpu_program_id = gh_node.getid("PhongShader")


    gh_node.set_name

    Description
    Sets the name of a node.

    Languages: Lua - Python

    Alias: setname

    Parameters
  • node [INTEGER]: Node identifier.
  • name [STRING]: Name of the node.

    Code sample :

    gh_node.setname(node, "myKoolNodeName")


    gh_node.get_name

    Description
    Sets the name of a node.

    Languages: Lua - Python

    Alias: getname

    Parameters
  • node [INTEGER]: Node identifier.

    Return Values
  • name [STRING]: Node name.

    Code sample :

    name = gh_node.getname(node)


    gh_node.kill

    Description
    Kills (cleanup and free resources) a node.

    Languages: Lua - Python

    Parameters
  • node [INTEGER]: Node identifier.

    Code sample :

    gh_node.kill(node)


    gh_node.get_num_children

    Description
    Gets the number of children of a particular node.

    Languages: Lua - Python

    Parameters
  • node [INTEGER]: Node identifier.

    Return Values
  • num_children [INTEGER]: Number of children.

    Code sample :

    num_children = gh_node.get_num_children(node)


    gh_node.get_child_by_index

    Description
    Returns the node identifier of a child.

    Languages: Lua - Python

    Parameters
  • node [INTEGER]: Node identifier.
  • index [INTEGER]: Index of a children from 0 to gh_node.get_num_children()-1.

    Return Values
  • child [INTEGER]: Child identifier

    Code sample :

    -- Gets the first child.
    child = gh_node.get_child_by_index(node, 0)


    gh_node.add_child

    Description
    Adds a child to a parent.

    Languages: Lua - Python

    Parameters
  • parent [INTEGER]: Parent node identifier.
  • child [INTEGER]: Child node identifier.

    Code sample :

    gh_node.add_child(parent, child)


    gh_node.remove_child

    Description
    Removes a child from a parent.

    Languages: Lua - Python

    Parameters
  • parent [INTEGER]: Parent node identifier.
  • child [INTEGER]: Child node identifier.

    Code sample :

    gh_node.remove_child(parent, child)





  • (C)2012-2013 Geeks3D