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


Description
gh_polyline is the module that manages polylines (a set of non connected lines).

Number of functions: 6

gh_polyline.create

Description
Creates a polyline.

Languages: Lua - Python

Return Values
  • pl_id [INTEGER]: polyline identifier

    Code sample :

    pl = gh_polyline.create()


    gh_polyline.add_line

    Description
    Adds a line to a polyline.

    Languages: Lua - Python

    Parameters
  • vp [INTEGER]: polyline identifier.
  • index [INTEGER]: index of the vertex from 0 to num_vertices-1.
  • p0_x, p0_y, p0_z [REAL]: 3D position of the start point.
  • p1_x, p1_y, p1_z [REAL]: 3D position of the end point.

    Code sample :

    gh_polyline.add_line(vp, x0, y0, z0, x1, y1, z1)


    gh_polyline.build

    Description
    Build a polyline.

    Languages: Lua - Python

    Parameters
  • vp [INTEGER]: polyline identifier.

    Code sample :

    gh_polyline.add_line(vp, x0, y0, z0, x1, y1, z1)
    gh_polyline.build(vp)


    gh_polyline.set_vertex_position

    Description
    Sets the position of a particular vertex in the polyline.

    Languages: Lua - Python

    Parameters
  • vp [INTEGER]: polyline identifier.
  • vertex_index [INTEGER]: index of the vertex.
  • x, y, z [REAL]: 3D position of the vertex.

    Code sample :

    gh_polyline.set_vertex_position(vp, vertex_index, x0, y0, z0)


    gh_polyline.set_vertex_color

    Description
    Sets the color of a particular vertex in the polyline.

    Languages: Lua - Python

    Parameters
  • vp [INTEGER]: polyline identifier.
  • vertex_index [INTEGER]: index of the vertex.
  • r, g, b, a [REAL]: RGBA color of the vertex.

    Code sample :

    gh_polyline.set_vertex_position(vp, vertex_index, x0, y0, z0)


    gh_polyline.set_line_offsets

    Description
    Sets the start and end line offsets for rendering. Offsets represent lines and not vertices.

    Languages: Lua - Python

    Parameters
  • vp [INTEGER]: polyline identifier.
  • start_offset [INTEGER]: start offset. Default value is 0
  • end_offset [INTEGER]: end offset. Default value is -1 meaning last line.

    Code sample :

    gh_polyline.set_line_offsets(vp, 2, -1)





  • (C)2012-2013 Geeks3D