GLSL Hacker
FEATURES DOWNLOAD GALLERY BLOG LEARN



» Back to Reference Guide Index

gh_polyline Library

Description

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

Number of functions: 4



gh_polyline.create_v2

Description

Creates a polyline.

Languages

Lua - Python

Parameters

  • num_vertices [INTEGER]: number of vertices.
  • line_mode [INTEGER]: line mode: DEFAULT (0), STRIP (1) or LOOP (2).

    Return Values

  • pl [INTEGER]: polyline identifier

    Code sample


    pl = gh_polyline.create_v2(num_vertices, line_mode)



    gh_polyline.set_vertex_position

    Description

    Sets the position of a particular vertex in the polyline.

    Languages

    Lua - Python

    Parameters

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

    Return Values

    This function has no return value(s).

    Code sample


    gh_polyline.set_vertex_position(pl, vertex_index, x0, y0, z0, 1.0)



    gh_polyline.set_vertex_color

    Description

    Sets the color of a particular vertex in the polyline.

    Languages

    Lua - Python

    Parameters

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

    Return Values

    This function has no return value(s).

    Code sample


    gh_polyline.set_vertex_color(pl, vertex_index, r, g, b, a)



    gh_polyline.set_vertex_draw_range

    Description

    Sets the start vertex index and the number of vertices to render.

    Languages

    Lua - Python

    Parameters

  • pl [INTEGER]: polyline identifier.
  • start_index [INTEGER]: start offset. Default value is 0
  • num_vertices [INTEGER]: number of vertices to render

    Return Values

    This function has no return value(s).

    Code sample


    gh_polyline.set_vertex_draw_range(pl, 0, 2)





    2013-2015 Geeks3D. All Rights Reserved.

    .:- G3D Network -:.