"No one can be told what GeeXLab is, you have to see it for yourself!"

"Stop Playing Games and Start Making Them! With GeeXLab, your are on your way!"


Quick Links
What is GeeXLab
Download GeeXLab
GeeXLab Requirements
Online Help
Articles and Tutorials
Samples Screenshots
Videos

GeeXLab Changelog

XML Ref. Guide
Scripting Ref. Guide
Code Samples

Purchase GeeXLab
GeeXLab SDK

Shader Library

Follow GeeXLab's News
GeeXLab news, articles, tutorials and demos @ Geeks3D.com
GeeXLab @ Twitter GeeXLab RSS Feed

Subscribe to GeeXLab news by email

[ Back to Geeks3D.com ]

GeeXLab

GeeXLab

Laboratory for Real Time 3D Programming (prototyping and demos)
OpenGL, Lua, Python, GLSL,
PhysX and more...

Reference Guide
Host-API Lua / Python



Back to Homepage
Back to Developer's Guide Index

HYP_Mesh Library


Description
Mesh library

Number of functions: 61

HYP_Mesh.CreateBox

Description
Creates a mesh box.

Languages: Lua - Python

Parameters
  • width [REAL]: Width (X)of the box.
  • height [REAL]: Height (Y) of box;
  • depth [REAL]: Depth (Z) of box
  • w_segs [INTEGER]: Number of segments in width (X).
  • h_seg [INTEGER]: Number of segments in height (Y).
  • d_seg [INTEGER]: Number of segments in depth (Z).

    Return Values
  • id [INTEGER]: Mesh numeric identifier

    Code sample :

    id = HYP_Mesh.CreateBox(width, height, depth, w_segs, h_segs, d_segs)


    HYP_Mesh.CreatePlane

    Description
    Creates a mesh plane.

    Languages: Lua - Python

    Parameters
  • width [REAL]: Width (X)of the box.
  • height [REAL]: Height (Y) of box;
  • w_segs [INTEGER]: Number of segments in width (X).
  • h_seg [INTEGER]: Number of segments in height (Y).
  • plane_type [INTEGER]: Plane of creation: 0 (XZ), 1 (XY) or 2 (YZ).

    Return Values
  • id [INTEGER]: Mesh numeric identifier

    Code sample :

    id = HYP_Mesh.CreatePlane(width, height, w_segs, h_segs, 0)


    HYP_Mesh.CreateSphere

    Description
    Creates a mesh sphere.

    Languages: Lua - Python

    Parameters
  • radius [REAL]: Radius of sphere.
  • stacks [INTEGER]: Number of segments in height.
  • slices [INTEGER]: Number of segments in the sphere circumference.

    Return Values
  • id [INTEGER]: Mesh numeric identifier

    Code sample :

    id = HYP_Mesh.CreateSphere(radius, stacks, slices)


    HYP_Mesh.CreateTorus

    Description
    Creates a mesh torus.

    Languages: Lua - Python

    Parameters
  • radius [REAL]: Radius of torus.
  • slices [INTEGER]: Number of segments in the torus circumference.
  • section_radius [REAL]: Section radius of torus.

    Return Values
  • id [INTEGER]: Mesh numeric identifier

    Code sample :

    id = HYP_Mesh.CreateTorus(radius, slices, section_radius )


    HYP_Mesh.Destroy

    Description
    Destroys a mesh.

    Languages: Lua - Python

    Parameters
  • name [STRING]: Mesh name.
  • mesh_id [INTEGER]: Mesh numeric identifier

    Code sample :

    HYP_Mesh.Destroy(id)


    HYP_Mesh.Create

    Description
    Creates a mesh from the number of vertices and faces and returns the mesh id.

    Languages: Lua - Python

    Parameters
  • nvertices [INTEGER]: Number of vertices.
  • nfaces [INTEGER]: Number of faces.

    Return Values
  • id [INTEGER]: Mesh numeric identifier

    Code sample :

    id = HYP_Mesh.Create(nvertices, nfaces)


    HYP_Mesh.SetFaceIndices

    Description
    Sets the indices a, b and c of a face specified by its face_index.

    Languages: Lua - Python

    Parameters
  • mesh_id [INTEGER]: Mesh numeric identifier
  • face_index [INTEGER]: Index of face.Ranges between 0 and HYP_Mesh.GetNumFaces()-1 .
  • a, b, c [INTEGER]: Face indices

    Code sample :

    HYP_Mesh.SetFaceIndices(mesh_id, face_index, a, b, c)


    HYP_Mesh.GetFaceIndices

    Description
    Returns the vertices indices for a specific mesh face.

    Languages: Lua - Python

    Parameters
  • mesh_id [INTEGER]: Mesh numeric identifier
  • face_index [INTEGER]: Index of face.Ranges between 0 and HYP_Mesh.GetNumFaces()-1 .

    Return Values
  • a [INTEGER]: Index of the a vertex of face.
  • b [INTEGER]: Index of the b vertex of face.
  • c [INTEGER]: Index of the c vertex of face.

    Code sample :

    a, b, c = HYP_Mesh.GetFaceIndices( mesh_id, face_index )


    HYP_Mesh.GetFaceNormal

    Description
    Returns the normal vector for a specific face.

    Languages: Lua - Python

    Parameters
  • mesh_id [INTEGER]: Mesh numeric identifier
  • face_index [INTEGER]: Index of face.Ranges between 0 and HYP_Mesh.GetNumFaces()-1 .

    Return Values
  • x [REAL]: coordinate in X of the normal vector.
  • y [REAL]: coordinate in Y of the normal vector.
  • z [REAL]: coordinate in Z of the normal vector.

    Code sample :

    x, y, z = HYP_Mesh.GetFaceNormal( mesh_id, face_index )
    x, y, z = HYP_Mesh.GetFaceNormal_Fast( mesh_id, face_index )


    HYP_Mesh.GetNumPlaneSegments

    Description
    Returns the number of segments of a mesh plane.

    Languages: Lua - Python

    Parameters
  • mesh_id [INTEGER]: Mesh numeric identifier

    Return Values
  • nXSegs [INTEGER]: Number of segments in X (width)
  • nYSegs [INTEGER]: Number of segments in Y (height)

    Code sample :

    nXSegs, nYSegs = HYP_Mesh.GetNumPlaneSegments( mesh_id )


    HYP_Mesh.GetNumVertices

    Description
    Returns the number of vertices of a mesh.

    Languages: Lua - Python

    Parameters
  • mesh_id [INTEGER]: Mesh numeric identifier

    Return Values
  • n [INTEGER]: Number of vertices.

    Code sample :

    n = HYP_Mesh.GetNumVertices(mesh_id)


    HYP_Mesh.FlipNormals

    Description
    Allows to invert the direction of vertices normals.

    Languages: Lua - Python

    Parameters
  • mesh_id [INTEGER]: Mesh numeric identifier

    Code sample :

    HYP_Mesh.FlipNormals( mesh_id )


    HYP_Mesh.GetVertexColor

    Description
    Gets the color associated with a particular vertex.The fast version doesn't validity checking of parameters.

    Languages: Lua - Python

    Parameters
  • mesh_id [INTEGER]: Mesh numeric identifier
  • vertex_index [INTEGER]: Index of vertex (from 0 to n-1 vertices).

    Return Values
  • r [REAL]: Red component of the vertex color.
  • g [REAL]: Green component of the vertex color.
  • b [REAL]: Blue component of the vertex color.
  • a [REAL]: Alpha component of the vertex color.

    Code sample :

    r, g, b, a = HYP_Mesh.GetVertexColor( mesh_id, vertex_index )
    r, g, b, a = HYP_Mesh.GetVertexColor_Fast( mesh_id, vertex_index )


    HYP_Mesh.GetVertexNormal

    Description
    Gets the normal vector associated with a particular vertex.

    Languages: Lua - Python

    Parameters
  • mesh_id [INTEGER]: Mesh numeric identifier
  • vertex_index [INTEGER]: Index of vertex (from 0 to n-1 vertices).

    Return Values
  • nx [REAL]: Component in X of the normal vector.
  • ny [REAL]: Component in Y of the normal vector.
  • nz [REAL]: Component in Z of the normal vector.

    Code sample :

    nx, ny, nz = HYP_Mesh.GetVertexNormal(mesh_id, vertex_index )
    nx, ny, nz = HYP_Mesh.GetVertexNormal_Fast( mesh_id, vertex_index )


    HYP_Mesh.GetVertexPosition

    Description
    Gets the position of a vertex.

    Languages: Lua - Python

    Parameters
  • mesh_id [INTEGER]: Mesh numeric identifier
  • vertex_index [INTEGER]: Index of vertex (from 0 to n-1 vertices).

    Return Values
  • x [REAL]: Position in X of vertex.
  • y [REAL]: Position in Y of vertex.
  • z [REAL]: Psition in Z of vertex.

    Code sample :

    x, y, z = HYP_Mesh.GetVertexPosition(mesh_id, vertex_index )


    HYP_Mesh.GetVertexUVCoords

    Description
    Gets the uv texture coordinate (u, v) of a vertex. A vertex can have up to 4 UV sets (one per texture unit).

    Languages: Lua - Python

    Parameters
  • mesh_id [INTEGER]: Mesh numeric identifier
  • vertex_index [INTEGER]: Index of vertex (from 0 to n-1 vertices).
  • texture_unit [INTEGER]: Number of texture unit. - Values = [0;7]

    Return Values
  • u [REAL]: value in U of the texture coordinate.
  • v [REAL]: value in V of the texture coordinate.

    Code sample :

    u, v = HYP_Mesh.GetVertexUVCoords(mesh_id, vertex_index, texture_unit)


    HYP_Mesh.PopVerticesList

    Description
    Restores the mesh vertices previously saved with PushVerticesList().

    Languages: Lua - Python

    Parameters
  • mesh_id [INTEGER]: Mesh numeric identifier

    Code sample :

    HYP_Mesh.PopVerticesList( mesh_id )


    HYP_Mesh.PushVerticesList

    Description
    Allows to save the vertices list of a mesh prior to a modification. A call toPopVerticesList() will restore this list.

    Languages: Lua - Python

    Parameters
  • mesh_id [INTEGER]: Mesh numeric identifier

    Code sample :

    HYP_Mesh.PushVerticesList( mesh_id )


    HYP_Mesh.ScaleVertices

    Description
    Applies a scale factor to the mesh vertices.

    Languages: Lua - Python

    Parameters
  • mesh_id [INTEGER]: Mesh numeric identifier
  • scale_factor_x [REAL]: Scale factor in X for mesh vertices.
  • scale_factor_y [REAL]: Scale factor in Y for mesh vertices.
  • scale_factor_z [REAL]: Scale factor in Z for mesh vertices.

    Code sample :

    HYP_Mesh.ScaleVertices( mesh_id, scale_factor_x, scale_factor_y, scale_factor_z )


    HYP_Mesh.SetTexCoordsOffset

    Description
    Sets the uv coordinates offset value for a given texture unit. Default value is 0.0.

    Languages: Lua - Python

    Parameters
  • mesh_id [INTEGER]: Mesh numeric identifier
  • tu [INTEGER]: Texture unit number. - Values = [0;7]
  • offset_u [REAL]: Offset value for u texture coordinate.
  • offset_u [REAL]: Offset value for v texture coordinate.

    Code sample :

    HYP_Mesh.SetTexCoordsOffset( mesh_id, tu, offset_u, offset_v )


    HYP_Mesh.SetTexCoordsTiling

    Description
    Sets the tiling factor for all vertices of a mesh.

    Languages: Lua - Python

    Parameters
  • mesh_id [INTEGER]: Mesh numeric identifier
  • tu [INTEGER]: Texture unit number. - Values = [0;7]
  • offset_u [REAL]: Tiling value for u texture coordinate.
  • offset_v [REAL]: Tiling value for v texture coordinate.

    Code sample :

    HYP_Mesh.SetTexCoordsTiling(mesh_id, tu, tile_u, tile_v )


    HYP_Mesh.SetVertexColor

    Description
    Sets the color of a particular vertex.

    Languages: Lua - Python

    Parameters
  • mesh_id [INTEGER]: Mesh numeric identifier
  • vertex_index [INTEGER]: Index of vertex (from 0 to n-1 vertices).
  • r [REAL]: New value for red component of vertex color.
  • g [REAL]: New value for green component of vertex color.
  • b [REAL]: New value for blue component of vertex color.
  • a [REAL]: New value for alpha component of vertex color.

    Code sample :

    HYP_Mesh.SetVertexColor(mesh_id, vertex_index, new_r, new_g, new_b, new_a )


    HYP_Mesh.SetVerticesColor

    Description
    Sets the color of all vertices of a mesh.

    Languages: Lua - Python

    Parameters
  • mesh_id [INTEGER]: Mesh numeric identifier
  • vertex_index [INTEGER]: Index of vertex (from 0 to n-1 vertices).
  • new_r [REAL]: New value for red component of vertices color.
  • new_g [REAL]: New value for green component of vertices color.
  • new_b [REAL]: New value for blue component of vertices color.
  • new_a [REAL]: New value for alpha component of vertices color.

    Code sample :

    HYP_Mesh.SetVerticesColor(mesh_id, new_r, new_g, new_b, new_a )


    HYP_Mesh.SetVertexNormal

    Description
    Sets the normal vector value for a particular vertex. To get correct lighting computations don't forget to normalize the normal vector.HYP_Mesh. SetVertexNormal_Fast() is a faster version with no validity checking of parameters.

    Languages: Lua - Python

    Parameters
  • mesh_id [INTEGER]: Mesh numeric identifier
  • vertex_index [INTEGER]: Index of vertex (from 0 to n-1 vertices).
  • new_x [REAL]: New value for X component of normal.
  • new_y [REAL]: New value for Y component of normal.
  • new_z [REAL]: New value for Z component of normal.

    Code sample :

    HYP_Mesh.SetVertexNormal(mesh_id, vertex_index, nx, ny, nz )


    HYP_Mesh.SetVertexPosition

    Description


    Languages: Lua - Python

    Parameters
  • mesh_id [INTEGER]: Mesh numeric identifier
  • vertex_index [INTEGER]: Index of vertex (from 0 to n-1 vertices).
  • new_x [REAL]: New value in X for vertex position.
  • new_y [REAL]: New value in Y for vertex position.
  • new_z [REAL]: New value in Z for vertex position.

    Code sample :

    HYP_Mesh.SetVertexPosition( mesh_id, vertex_index, new_x, new_y, new_z )


    HYP_Mesh.SetVertexUVCoords

    Description
    Allows to change the uv texture coordinates for a particular vertex of mesh and a particulat texture unit.

    Languages: Lua - Python

    Parameters
  • mesh_id [INTEGER]: Mesh numeric identifier
  • vertex_index [INTEGER]: Index of vertex (from 0 to n-1 vertices).
  • tu [INTEGER]: Texture unit number. - Values = [0;7]
  • new_u [REAL]: New u value for u texture coordinate.
  • new_v [REAL]: New v value for v texture coordinate.

    Code sample :

    HYP_Mesh.SetVertexUVCoords(mesh_id, vertex_index, texture_unit, new_u, new_v )


    HYP_Mesh.UseVertexAttribTangent

    Description
    Allows to use the tangent vertex attrib during the rendering. Useful with normal mapping.

    Languages: Lua - Python

    Parameters
  • mesh_id [INTEGER]: Mesh numeric identifier
  • state [INTEGER]: 1 (enabled) or 0 (disabled)

    Code sample :

    HYP_Mesh.UseVertexAttribTangent(mesh_id, state)


    HYP_Mesh.UseVertexAttribColor

    Description
    Allows to use the color vertex attrib during the rendering.

    Languages: Lua - Python

    Parameters
  • mesh_id [INTEGER]: Mesh numeric identifier
  • state [INTEGER]: 1 (enabled) or 0 (disabled)

    Code sample :

    HYP_Mesh.UseVertexAttribColor(mesh_id, state)


    HYP_Mesh.RenderSubset

    Description
    Renders a mesh subset. A subset is a set of faces with the same material. Usually, a mesh has one material so it has one subset.

    Languages: Lua - Python

    Parameters
  • mesh_id [INTEGER]: Mesh numeric identifier
  • subset [INTEGER]: subset index - Values = RenderSubsetPrepare
  • mesh_id [INTEGER]: Mesh numeric identifier
  • subset [INTEGER]: subset index - Values = RenderSubsetFinish
  • mesh_id [INTEGER]: Mesh numeric identifier
  • subset [INTEGER]: subset index - Values = RenderSubsetGeometry
  • mesh_id [INTEGER]: Mesh numeric identifier
  • subset [INTEGER]: subset index - Values = InitInstancing
  • mesh_id [INTEGER]: Mesh numeric identifier
  • numInstances [INTEGER]: number of instances

    Code sample :

    HYP_Mesh.InitInstancing(mesh_id, 100)


    HYP_Mesh.CleanUpInstancing

    Description
    Frees mesh instancing.

    Languages: Lua - Python

    Parameters
  • mesh_id [INTEGER]: Mesh numeric identifier

    Code sample :

    HYP_Mesh.CleanUpInstancing(mesh_id)


    HYP_Mesh.SetInstancingFrustumCullingTest

    Description
    Enables or disables camera frustum culling for all instances.

    Languages: Lua - Python

    Parameters
  • mesh_id [INTEGER]: Mesh numeric identifier
  • state [INTEGER]: 1 (enabled) or 0 (disabled)

    Code sample :

    HYP_Mesh.SetInstancingFrustumCullingTest(mesh_id, 0)


    HYP_Mesh.SetInstanceRenderState

    Description
    Specifies the render state (0 or 1) of an instance.

    Languages: Lua - Python

    Parameters
  • mesh_id [INTEGER]: Mesh numeric identifier
  • instanceIndex [INTEGER]: instance index
  • state [INTEGER]: render state (0 or 1)

    Code sample :

    HYP_Mesh.SetInstanceRenderState(mesh_id, instanceIndex, 0)


    HYP_Mesh.GetInstanceRenderState

    Description
    Returns the render state (0 or 1) of an instance.

    Languages: Lua - Python

    Parameters
  • mesh_id [INTEGER]: Mesh numeric identifier
  • instanceIndex [INTEGER]: instance index

    Return Values
  • state [INTEGER]: render state (0 or 1)

    Code sample :

    state = HYP_Mesh.GetInstanceRenderState(mesh_id, instanceIndex)


    HYP_Mesh.SetInstancePosition

    Description
    Specifies the position XYZ of an instance.

    Languages: Lua - Python

    Parameters
  • mesh_id [INTEGER]: Mesh numeric identifier
  • instanceIndex [INTEGER]: instance index
  • x, y, z [REAL]: instance XYZ position

    Code sample :

    HYP_Mesh.SetInstancePosition(mesh_id, instanceIndex, x, y, z)


    HYP_Mesh.SetInstanceOrientation

    Description
    Specifies orientation of an instance.

    Languages: Lua - Python

    Parameters
  • mesh_id [INTEGER]: Mesh numeric identifier
  • instanceIndex [INTEGER]: instance index
  • angle [REAL]: angle of rotation in degrees
  • x, y, z [REAL]: axis of rotation

    Code sample :

    HYP_Mesh.SetInstanceOrientation(mesh_id, instanceIndex, angle, x, y, z)


    HYP_Mesh.SetInstanceColor

    Description
    Specifies the RGBA color value for an instance.

    Languages: Lua - Python

    Parameters
  • mesh_id [INTEGER]: Mesh numeric identifier
  • instanceIndex [INTEGER]: instance index
  • r, g, b, a [REAL]: RGBA color

    Code sample :

    HYP_Mesh.SetInstanceColor(mesh_id, instanceIndex, 1.0, 1.0, 0.0, 1.0)


    HYP_Mesh.SetInstanceTripodParent

    Description
    Sets a parent tripod to the mesh instance tripod. Allows to create a hierarchy with instancing.

    Languages: Lua - Python

    Parameters
  • mesh_id [INTEGER]: Mesh numeric identifier
  • instanceIndex [INTEGER]: instance index
  • parent_id [INTEGER]: instance index

    Code sample :

    HYP_Mesh.SetInstanceTripodParent(mesh_id, instanceIndex, parent_id)


    HYP_Mesh.InstancingTouchTripod

    Description
    Allows to update the instance tripod according to its parent.

    Languages: Lua - Python

    Parameters
  • mesh_id [INTEGER]: Mesh numeric identifier
  • instanceIndex [INTEGER]: instance index

    Code sample :

    HYP_Mesh.InstancingTouchTripod(mesh_id, instanceIndex)


    HYP_Mesh.InstancingTouchAllTripods

    Description
    Allows to update all instance tripods according to their respective parents.

    Languages: Lua - Python

    Parameters
  • mesh_id [INTEGER]: Mesh numeric identifier

    Code sample :

    HYP_Mesh.InstancingTouchAllTripods(mesh_id)


    HYP_Mesh.CastRay

    Description
    Cast a ray and get the collision point with a mesh face.

    Languages: Lua - Python

    Parameters
  • mesh_id [INTEGER]: Mesh numeric identifier.
  • orig_x [REAL]: Coordinate in X of the ray origin position.
  • orig_y [REAL]: Coordinate in Y of the ray origin position.
  • orig_z [REAL]: Coordinate in Z of the ray origin position.
  • dir_x [REAL]: Coordinate in X of the ray's direction vector.
  • dir_y [REAL]: Coordinate in Y of the ray's direction vector.
  • dir_z [REAL]: Coordinate in Z of the ray's direction vector.

    Return Values
  • x [REAL]: Position in X of collision point.
  • y [REAL]: Position in Y of collision point.
  • z [REAL]: Position in Z of collision point.
  • face [INTEGER]: Index of face touched by the ray. -1 if no collision.
  • time [REAL]: Time of collision.

    Code sample :

    x, y, z, face, time = HYP_Mesh.CastRay(mesh_id, orig_x, orig_y, orig_z, dir_x, dir_y, dir_z);


    HYP_Mesh.CopyVerticesList

    Description
    Allows to copy th eentire list of vertices from one mesh to an other.

    Languages: Lua

    Parameters
  • src_mesh_id, [INTEGER]: Source mesh numeric identifier.
  • dst_mesh_id [INTEGER]: Destination mesh numeric identifier.

    Code sample :

    HYP_Mesh.CopyVerticesList( src_mesh_id, dst_mesh_id )


    HYP_Mesh.DoTweening

    Description
    Morph a tween from a start mesh to an end mesh.

    Languages: Lua

    Parameters
  • tween_mesh_id [INTEGER]: Source mesh numeric identifier.
  • start_mesh_id [INTEGER]: Source mesh numeric identifier.
  • end_mesh_id [INTEGER]: Source mesh numeric identifier.
  • time [REAL]: Morphing parameter that indicates a precise state between the start and end mesh. Must be between 0.0 (start mesh) and 1.0 (end mesh).

    Code sample :

    HYP_Mesh.DoTweening( tween_mesh_id, start_mesh_id, end_mesh_id, time )


    HYP_Mesh.GetElevation

    Description
    Gets the height and index number of a triangle located just below the camera.

    Languages: Lua

    Parameters
  • cam_x [REAL]: Position in X of current camera.
  • cam_y [REAL]: Position in Y of current camera.
  • cam_z [REAL]: Position in Z of current camera.

    Return Values
  • face_index [INTEGER]: height (in Y) of the triangle detected under the camera.
  • y_out [REAL]:

    Code sample :

    y_out, face_index = HYP_Mesh.GetElevation( mesh_id, cam_x, cam_y, cam_z );


    HYP_Mesh.GetVertexAttrib

    Description
    Returns the 4D vector associated with one of the 5 vertex attributes. The 2 first attributes a used by Ozone3D Demoniak to build the tangent space of each vertex.(1: tangent; 2:binormal)

    Languages: Lua

    Parameters
  • mesh_id [INTEGER]: Mesh numeric identifier
  • vertex_index [INTEGER]: Index of vertex (from 0 to n-1 vertices).
  • vertex_attrib [INTEGER]: Attribute number (from 1 to 5).

    Return Values
  • x [REAL]: Component in X of the attribute 4d vector.
  • y [REAL]: Component in Y of the attribute 4d vector.
  • z [REAL]: Component in Z of the attribute 4d vector.
  • w [REAL]: Component in W of the attribute 4d vector.

    Code sample :

    x, y, z, w = HYP_Mesh.GetVertexAttrib(mesh_id, vertex_index, vertex_attrib )


    HYP_Mesh.SetPivotPosition

    Description
    Sets pivot (local system) position without changing the vertices position.

    Languages: Lua

    Parameters
  • mesh_id [INTEGER]: Mesh numeric identifier
  • new_x [REAL]: New value for X pivot coordinate.
  • new_y [REAL]: New value for Y pivot coordinate.
  • new_z [REAL]: New value for Z pivot coordinate.

    Code sample :

    HYP_Mesh.SetPivotPosition( mesh_id, new_x, new_y, new_z )


    HYP_Mesh.SetPivotOrientation

    Description
    Sets pivot (local system) orientation without changing the vertices position. Both 'angle plus rotation axis' syntax and 'Euler angles syntax' are accepted.

    Languages: Lua

    Parameters
  • mesh_id [INTEGER]: Mesh numeric identifier
  • angle [REAL]: Angle in degrees.
  • axis_x [REAL]: Component in X of the rotation axis.
  • axis_y [REAL]: Component in Y of the rotation axis.
  • axis_z [REAL]: Component in Z of the rotation axis.
  • pitch [REAL]: Rotation angle in degrees on X axis.
  • yaw [REAL]: Rotation angle in degrees on Y axis.
  • roll [REAL]: Rotation angle in degrees on Z axis.

    Code sample :

    HYP_Mesh.SetPivotOrientation( mesh_id, angle, axis_x, axis_y, axis_z )
    or
    HYP_Mesh.SetPivotOrientation( mesh_id, pitch, yaw, roll )


    HYP_Mesh.SetVertexAttrib

    Description
    Allows to change the 4D vector associated with each one of the 5 vertex attributes. The 2 first attributes a used by Ozone3D Demoniak to build the tangent space of each vertex.(1: tangent; 2:binormal). SetVertexAttrib_Fast() is a faster version with validity checking of parameters.

    Languages: Lua

    Parameters
  • mesh_id [INTEGER]: Mesh numeric identifier
  • vertex_index [INTEGER]: Index of vertex (from 0 to n-1 vertices).
  • vertex_attrib [INTEGER]: Vertex attribute number (from 1 to 5).
  • x [REAL]: Component in X for the 4D vector of vertex attribute.
  • y [REAL]: Component in Y for the 4D vector of vertex attribute.
  • z [REAL]: Component in Z for the 4D vector of vertex attribute.
  • w [REAL]: Component in W for the 4D vector of vertex attribute.

    Code sample :

    HYP_Mesh.SetVertexAttrib( mesh_id, vertex_index, vertex_attrib, x, y, z, w )


    HYP_Mesh.UpdateAllNormals

    Description
    Update all vertices normals. Useful for correct lighting after a geometric deformation for example.

    Languages: Lua - Python

    Parameters
  • mesh_id [INTEGER]: Mesh numeric identifier

    Code sample :

    HYP_Mesh.UpdateAllNormals(mesh_id)


    HYP_Mesh.UpdateFaceNormalField

    Description
    Performs a new computation for the normal vectors field of faces.

    Languages: Lua

    Parameters
  • mesh_id [INTEGER]: Mesh numeric identifier

    Code sample :

    HYP_Mesh.UpdateFaceNormalField(mesh_id)


    HYP_Mesh.UpdateVertexNormalField

    Description
    Performs a new computation for the normal vectors field of vertices.

    Languages: Lua

    Parameters
  • mesh_id [INTEGER]: Mesh numeric identifier

    HYP_Mesh.VBQuad_Create

    Description
    Creates a VB Quad.

    Languages: Lua

    Parameters
  • num_quads [INTEGER]: Number of quads handled by the VB Quad.

    Code sample :

    HYP_Mesh.VBQuad_Create( num_quads )


    HYP_Mesh.VBQuad_Destroy

    Description
    Destroy a VB quad.

    Languages: Lua

    Parameters
  • mesh_id [INTEGER]: Mesh numeric identifier

    Code sample :

    HYP_Mesh.VBQuad_Destroy( mesh_id )


    HYP_Mesh.VBQuad_SetQuadVertexUV

    Description
    Allows to change the UV texture coordinates for a particular vertex in a particular quad of a VB Quad.

    Languages: Lua

    Parameters
  • mesh_id [INTEGER]: Mesh numeric identifier
  • quad_index [INTEGER]: Index of quad in the VB Quad (first index is 0).
  • vertex_index [INTEGER]: Index of vertex (indices from 0 to 3).
  • tu [INTEGER]: Texture unit number. - Values = [0;7]
  • u [REAL]: U value for u texture coordinate.
  • v [REAL]: V value for v texture coordinate.

    Code sample :

    HYP_Mesh.VBQuad_SetQuadVertexUV( mesh_id, quad_index, vertex_index, tu, u, v )


    HYP_Mesh.VBQuad_GetQuadVertexUV

    Description


    Languages: Lua

    Parameters
  • mesh_id [INTEGER]: Mesh numeric identifier
  • quad_index [INTEGER]: Index of quad in the VB Quad (first index is 0).
  • vertex_index [INTEGER]: Index of vertex (indices from 0 to 3).
  • tu [INTEGER]: Texture unit number. - Values = [0;7]

    Return Values
  • u [REAL]: U texture coordinate.
  • v [REAL]: V texture coordinate.

    Code sample :

    u, v = HYP_Mesh.VBQuad_GetQuadVertexColor( mesh_id, quad_index, vertex_index,tu )


    HYP_Mesh.VBQuad_AddQuad

    Description
    Adds a quad to a mesh of type BV Quad.

    Languages: Lua

    Parameters
  • mesh_id [INTEGER]: Mesh numeric identifier
  • quad_id [INTEGER]: Quad primitive numeric identifier

    Code sample :

    HYP_Mesh.VBQuad_AddQuad(mesh_id, quad_id)
    i = 0
    while(i<1000) do
    id_quad = HYP_Primitive.CloneQuad("masterQuad")
    HYP_Mesh.VBQuad_AddQuad( "grassVertexBufferMesh", id_quad )
    i = i + 1
    end


    HYP_Mesh.VBQuad_SetQuadVertexPosition

    Description
    Sets a new position for one of the 4 vertices of a particular quad in a VB Quad.

    Languages: Lua

    Parameters
  • mesh_id [INTEGER]: Mesh numeric identifier
  • quad_index [INTEGER]: Index of quad in the VB Quad (first index is 0).
  • vertex_index [INTEGER]: Index of vertex (indices from 0 to 3).
  • new_x [REAL]: New position of vertex in X.
  • new_y [REAL]: New position of vertex in Y.
  • new_z [REAL]: New position of vertex in Z.

    Code sample :

    HYP_Mesh.VBQuad_SetQuadVertexPosition( mesh_id, quad_index, vertex_index, x, y, z )


    HYP_Mesh.VBQuad_GetQuadVertexPosition

    Description
    Gets the position of one of the 4 vertices of a particular quad in a VB Quad.

    Languages: Lua

    Parameters
  • mesh_id [INTEGER]: Mesh numeric identifier
  • quad_index [INTEGER]: Index of quad in the VB Quad (first index is 0).
  • vertex_index [INTEGER]: Index of vertex (indices from 0 to 3).

    Return Values
  • x [REAL]: Position of vertex in X.
  • y [REAL]: Position of vertex in Y.
  • z [REAL]: Position of vertex in Z.

    Code sample :

    x, y, z = HYP_Mesh.VBQuad_GetQuadVertexPosition( mesh_id, quad_index, vertex_index )


    HYP_Mesh.VBQuad_SetQuadVertexColor

    Description


    Languages: Lua

    Parameters
  • mesh_id [INTEGER]: Mesh numeric identifier
  • quad_index [INTEGER]: Index of quad in the VB Quad (first index is 0).
  • vertex_index [INTEGER]: Index of vertex (indices from 0 to 3).
  • r [REAL]: Red Component of vertex color.
  • g [REAL]: Green Component of vertex color.
  • b [REAL]: Blue Component of vertex color.
  • a [REAL]: Alpha Component of vertex color.

    Code sample :

    HYP_Mesh.VBQuad_SetQuadVertexColor( mesh_id, quad_index, vertex_index, r, g, b, a )


    HYP_Mesh.VBQuad_GetQuadVertexColor

    Description


    Languages: Lua

    Parameters
  • mesh_id [INTEGER]: Mesh numeric identifier
  • quad_index [INTEGER]: Index of quad in the VB Quad (first index is 0).
  • vertex_index [INTEGER]: Index of vertex (indices from 0 to 3).

    Return Values
  • r [REAL]: Red component of vertex color.
  • g [REAL]: Green component of vertex color.
  • b [REAL]: Blue component of vertex color.
  • a [REAL]: Alpha component of vertex color.

    Code sample :

    r, g, b, a = HYP_Mesh.VBQuad_GetQuadVertexColor( mesh_id, quad_index, vertex_index )


    HYP_Mesh.VBQuad_SortFacesInCameraSpace

    Description


    Languages: Lua

    Parameters
  • vbquad_id [INTEGER]: VB Quad numeric identifier.
  • camera_id [INTEGER]: Camera numeric identifier.
  • order [INTEGER]: FRONT_TO_BACK = 0 ; BACK_TO_FRONT = 1 - Values = 0|1

    Code sample :

    HYP_Mesh.VBQuad_SortFacesInCameraSpace( vbquad_id, camera_id, order )


    HYP_Mesh.GetFaceCenterPosition

    Description
    Returns the center position of a particular face of the mesh.

    Languages: Lua - Python

    Parameters
  • mesh_id [INTEGER]: Mesh numeric identifier
  • face_index [INTEGER]: Index of the face (between 0 and HYP_Mesh.GetNumFaces()-1.

    Return Values
  • x [REAL]: Position of vertex in X.
  • y [REAL]: Position of vertex in Y.
  • z [REAL]: Position of vertex in Z.

    Code sample :

    x, y, z = HYP_Mesh.GetFaceCenterPosition( mesh_id, face_index )




  • Random Projects

    Dream Vision Effect
    Dream Vision Effect

    Chromatic Aberration
    Chromatic Aberration

    PyOpenGL_LAB
    PyOpenGL_LAB


    Random Code Samples

    Shadow Mapping
    Shadow Mapping

    Texture viewer
    Texture viewer

    Bloom PostFX
    Bloom PostFX



    (C)2009-2010 Geeks3D.com