[ Back to Geeks3D.com ]
 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
Mesh library
Number of functions: 61
HYP_Mesh.CreateBox
Creates a mesh box.
: Lua - Python
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).
id [INTEGER]: Mesh numeric identifier
: id = HYP_Mesh.CreateBox(width, height, depth, w_segs, h_segs, d_segs)
HYP_Mesh.CreatePlane
Creates a mesh plane.
: Lua - Python
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).
id [INTEGER]: Mesh numeric identifier
: id = HYP_Mesh.CreatePlane(width, height, w_segs, h_segs, 0)
HYP_Mesh.CreateSphere
Creates a mesh sphere.
: Lua - Python
radius [REAL]: Radius of sphere.
stacks [INTEGER]: Number of segments in height.
slices [INTEGER]: Number of segments in the sphere circumference.
id [INTEGER]: Mesh numeric identifier
: id = HYP_Mesh.CreateSphere(radius, stacks, slices)
HYP_Mesh.CreateTorus
Creates a mesh torus.
: Lua - Python
radius [REAL]: Radius of torus.
slices [INTEGER]: Number of segments in the torus circumference.
section_radius [REAL]: Section radius of torus.
id [INTEGER]: Mesh numeric identifier
: id = HYP_Mesh.CreateTorus(radius, slices, section_radius )
HYP_Mesh.Destroy
Destroys a mesh.
: Lua - Python
name [STRING]: Mesh name.
mesh_id [INTEGER]: Mesh numeric identifier
: HYP_Mesh.Destroy(id)
HYP_Mesh.Create
Creates a mesh from the number of vertices and faces and returns the mesh id.
: Lua - Python
nvertices [INTEGER]: Number of vertices.
nfaces [INTEGER]: Number of faces.
id [INTEGER]: Mesh numeric identifier
: id = HYP_Mesh.Create(nvertices, nfaces)
HYP_Mesh.SetFaceIndices
Sets the indices a, b and c of a face specified by its face_index.
: Lua - Python
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
: HYP_Mesh.SetFaceIndices(mesh_id, face_index, a, b, c)
HYP_Mesh.GetFaceIndices
Returns the vertices indices for a specific mesh face.
: Lua - Python
mesh_id [INTEGER]: Mesh numeric identifier
face_index [INTEGER]: Index of face.Ranges between 0 and HYP_Mesh.GetNumFaces()-1 .
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.
: a, b, c = HYP_Mesh.GetFaceIndices( mesh_id, face_index )
HYP_Mesh.GetFaceNormal
Returns the normal vector for a specific face.
: Lua - Python
mesh_id [INTEGER]: Mesh numeric identifier
face_index [INTEGER]: Index of face.Ranges between 0 and HYP_Mesh.GetNumFaces()-1 .
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.
: x, y, z = HYP_Mesh.GetFaceNormal( mesh_id, face_index ) x, y, z = HYP_Mesh.GetFaceNormal_Fast( mesh_id, face_index )
HYP_Mesh.GetNumPlaneSegments
Returns the number of segments of a mesh plane.
: Lua - Python
mesh_id [INTEGER]: Mesh numeric identifier
nXSegs [INTEGER]: Number of segments in X (width)
nYSegs [INTEGER]: Number of segments in Y (height)
: nXSegs, nYSegs = HYP_Mesh.GetNumPlaneSegments( mesh_id )
HYP_Mesh.GetNumVertices
Returns the number of vertices of a mesh.
: Lua - Python
mesh_id [INTEGER]: Mesh numeric identifier
n [INTEGER]: Number of vertices.
: n = HYP_Mesh.GetNumVertices(mesh_id)
HYP_Mesh.FlipNormals
Allows to invert the direction of vertices normals.
: Lua - Python
mesh_id [INTEGER]: Mesh numeric identifier
: HYP_Mesh.FlipNormals( mesh_id )
HYP_Mesh.GetVertexColor
Gets the color associated with a particular vertex.The fast version doesn't validity checking of parameters.
: Lua - Python
mesh_id [INTEGER]: Mesh numeric identifier
vertex_index [INTEGER]: Index of vertex (from 0 to n-1 vertices).
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.
: 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
Gets the normal vector associated with a particular vertex.
: Lua - Python
mesh_id [INTEGER]: Mesh numeric identifier
vertex_index [INTEGER]: Index of vertex (from 0 to n-1 vertices).
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.
: nx, ny, nz = HYP_Mesh.GetVertexNormal(mesh_id, vertex_index ) nx, ny, nz = HYP_Mesh.GetVertexNormal_Fast( mesh_id, vertex_index )
HYP_Mesh.GetVertexPosition
Gets the position of a vertex.
: Lua - Python
mesh_id [INTEGER]: Mesh numeric identifier
vertex_index [INTEGER]: Index of vertex (from 0 to n-1 vertices).
x [REAL]: Position in X of vertex.
y [REAL]: Position in Y of vertex.
z [REAL]: Psition in Z of vertex.
: x, y, z = HYP_Mesh.GetVertexPosition(mesh_id, vertex_index )
HYP_Mesh.GetVertexUVCoords
Gets the uv texture coordinate (u, v) of a vertex. A vertex can have up to 4 UV sets (one per texture unit).
: Lua - Python
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]
u [REAL]: value in U of the texture coordinate.
v [REAL]: value in V of the texture coordinate.
: u, v = HYP_Mesh.GetVertexUVCoords(mesh_id, vertex_index, texture_unit)
HYP_Mesh.PopVerticesList
Restores the mesh vertices previously saved with PushVerticesList().
: Lua - Python
mesh_id [INTEGER]: Mesh numeric identifier
: HYP_Mesh.PopVerticesList( mesh_id )
HYP_Mesh.PushVerticesList
Allows to save the vertices list of a mesh prior to a modification.
A call toPopVerticesList() will restore this list.
: Lua - Python
mesh_id [INTEGER]: Mesh numeric identifier
: HYP_Mesh.PushVerticesList( mesh_id )
HYP_Mesh.ScaleVertices
Applies a scale factor to the mesh vertices.
: Lua - Python
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.
: HYP_Mesh.ScaleVertices( mesh_id, scale_factor_x, scale_factor_y, scale_factor_z )
HYP_Mesh.SetTexCoordsOffset
Sets the uv coordinates offset value for a given texture unit. Default value is 0.0.
: Lua - Python
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.
: HYP_Mesh.SetTexCoordsOffset( mesh_id, tu, offset_u, offset_v )
HYP_Mesh.SetTexCoordsTiling
Sets the tiling factor for all vertices of a mesh.
: Lua - Python
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.
: HYP_Mesh.SetTexCoordsTiling(mesh_id, tu, tile_u, tile_v )
HYP_Mesh.SetVertexColor
Sets the color of a particular vertex.
: Lua - Python
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.
: HYP_Mesh.SetVertexColor(mesh_id, vertex_index, new_r, new_g, new_b, new_a )
HYP_Mesh.SetVerticesColor
Sets the color of all vertices of a mesh.
: Lua - Python
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.
: HYP_Mesh.SetVerticesColor(mesh_id, new_r, new_g, new_b, new_a )
HYP_Mesh.SetVertexNormal
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.
: Lua - Python
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.
: HYP_Mesh.SetVertexNormal(mesh_id, vertex_index, nx, ny, nz )
HYP_Mesh.SetVertexPosition
: Lua - Python
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.
: HYP_Mesh.SetVertexPosition( mesh_id, vertex_index, new_x, new_y, new_z )
HYP_Mesh.SetVertexUVCoords
Allows to change the uv texture coordinates
for a particular vertex of mesh and a particulat texture unit.
: Lua - Python
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.
: HYP_Mesh.SetVertexUVCoords(mesh_id, vertex_index, texture_unit, new_u, new_v )
HYP_Mesh.UseVertexAttribTangent
Allows to use the tangent vertex attrib during the rendering. Useful with normal mapping.
: Lua - Python
mesh_id [INTEGER]: Mesh numeric identifier
state [INTEGER]: 1 (enabled) or 0 (disabled)
: HYP_Mesh.UseVertexAttribTangent(mesh_id, state)
HYP_Mesh.UseVertexAttribColor
Allows to use the color vertex attrib during the rendering.
: Lua - Python
mesh_id [INTEGER]: Mesh numeric identifier
state [INTEGER]: 1 (enabled) or 0 (disabled)
: HYP_Mesh.UseVertexAttribColor(mesh_id, state)
HYP_Mesh.RenderSubset
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.
: Lua - Python
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
: HYP_Mesh.InitInstancing(mesh_id, 100)
HYP_Mesh.CleanUpInstancing
Frees mesh instancing.
: Lua - Python
mesh_id [INTEGER]: Mesh numeric identifier
: HYP_Mesh.CleanUpInstancing(mesh_id)
HYP_Mesh.SetInstancingFrustumCullingTest
Enables or disables camera frustum culling for all instances.
: Lua - Python
mesh_id [INTEGER]: Mesh numeric identifier
state [INTEGER]: 1 (enabled) or 0 (disabled)
: HYP_Mesh.SetInstancingFrustumCullingTest(mesh_id, 0)
HYP_Mesh.SetInstanceRenderState
Specifies the render state (0 or 1) of an instance.
: Lua - Python
mesh_id [INTEGER]: Mesh numeric identifier
instanceIndex [INTEGER]: instance index
state [INTEGER]: render state (0 or 1)
: HYP_Mesh.SetInstanceRenderState(mesh_id, instanceIndex, 0)
HYP_Mesh.GetInstanceRenderState
Returns the render state (0 or 1) of an instance.
: Lua - Python
mesh_id [INTEGER]: Mesh numeric identifier
instanceIndex [INTEGER]: instance index
state [INTEGER]: render state (0 or 1)
: state = HYP_Mesh.GetInstanceRenderState(mesh_id, instanceIndex)
HYP_Mesh.SetInstancePosition
Specifies the position XYZ of an instance.
: Lua - Python
mesh_id [INTEGER]: Mesh numeric identifier
instanceIndex [INTEGER]: instance index
x, y, z [REAL]: instance XYZ position
: HYP_Mesh.SetInstancePosition(mesh_id, instanceIndex, x, y, z)
HYP_Mesh.SetInstanceOrientation
Specifies orientation of an instance.
: Lua - Python
mesh_id [INTEGER]: Mesh numeric identifier
instanceIndex [INTEGER]: instance index
angle [REAL]: angle of rotation in degrees
x, y, z [REAL]: axis of rotation
: HYP_Mesh.SetInstanceOrientation(mesh_id, instanceIndex, angle, x, y, z)
HYP_Mesh.SetInstanceColor
Specifies the RGBA color value for an instance.
: Lua - Python
mesh_id [INTEGER]: Mesh numeric identifier
instanceIndex [INTEGER]: instance index
r, g, b, a [REAL]: RGBA color
: HYP_Mesh.SetInstanceColor(mesh_id, instanceIndex, 1.0, 1.0, 0.0, 1.0)
HYP_Mesh.SetInstanceTripodParent
Sets a parent tripod to the mesh instance tripod. Allows to create a hierarchy with instancing.
: Lua - Python
mesh_id [INTEGER]: Mesh numeric identifier
instanceIndex [INTEGER]: instance index
parent_id [INTEGER]: instance index
: HYP_Mesh.SetInstanceTripodParent(mesh_id, instanceIndex, parent_id)
HYP_Mesh.InstancingTouchTripod
Allows to update the instance tripod according to its parent.
: Lua - Python
mesh_id [INTEGER]: Mesh numeric identifier
instanceIndex [INTEGER]: instance index
: HYP_Mesh.InstancingTouchTripod(mesh_id, instanceIndex)
HYP_Mesh.InstancingTouchAllTripods
Allows to update all instance tripods according to their respective parents.
: Lua - Python
mesh_id [INTEGER]: Mesh numeric identifier
: HYP_Mesh.InstancingTouchAllTripods(mesh_id)
HYP_Mesh.CastRay
Cast a ray and get the collision point with a mesh face.
: Lua - Python
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.
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.
: 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
Allows to copy th eentire list of vertices from one mesh to an other.
: Lua
src_mesh_id, [INTEGER]: Source mesh numeric identifier.
dst_mesh_id [INTEGER]: Destination mesh numeric identifier.
: HYP_Mesh.CopyVerticesList( src_mesh_id, dst_mesh_id )
HYP_Mesh.DoTweening
Morph a tween from a start mesh to an end mesh.
: Lua
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).
: HYP_Mesh.DoTweening( tween_mesh_id, start_mesh_id, end_mesh_id, time )
HYP_Mesh.GetElevation
Gets the height and index number of a triangle located just below the camera.
: Lua
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.
face_index [INTEGER]: height (in Y) of the triangle detected under the camera.
y_out [REAL]:
: y_out, face_index = HYP_Mesh.GetElevation( mesh_id, cam_x, cam_y, cam_z );
HYP_Mesh.GetVertexAttrib
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)
: Lua
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).
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.
: x, y, z, w = HYP_Mesh.GetVertexAttrib(mesh_id, vertex_index, vertex_attrib )
HYP_Mesh.SetPivotPosition
Sets pivot (local system) position without changing the vertices position.
: Lua
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.
: HYP_Mesh.SetPivotPosition( mesh_id, new_x, new_y, new_z )
HYP_Mesh.SetPivotOrientation
Sets pivot (local system) orientation without changing the vertices position.
Both 'angle plus rotation axis' syntax and 'Euler angles syntax' are accepted.
: Lua
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.
: HYP_Mesh.SetPivotOrientation( mesh_id, angle, axis_x, axis_y, axis_z ) or HYP_Mesh.SetPivotOrientation( mesh_id, pitch, yaw, roll )
HYP_Mesh.SetVertexAttrib
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.
: Lua
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.
: HYP_Mesh.SetVertexAttrib( mesh_id, vertex_index, vertex_attrib, x, y, z, w )
HYP_Mesh.UpdateAllNormals
Update all vertices normals. Useful for correct lighting after a geometric deformation for example.
: Lua - Python
mesh_id [INTEGER]: Mesh numeric identifier
: HYP_Mesh.UpdateAllNormals(mesh_id)
HYP_Mesh.UpdateFaceNormalField
Performs a new computation for the normal vectors field of faces.
: Lua
mesh_id [INTEGER]: Mesh numeric identifier
: HYP_Mesh.UpdateFaceNormalField(mesh_id)
HYP_Mesh.UpdateVertexNormalField
Performs a new computation for the normal vectors field of vertices.
: Lua
mesh_id [INTEGER]: Mesh numeric identifier
HYP_Mesh.VBQuad_Create
Creates a VB Quad.
: Lua
num_quads [INTEGER]: Number of quads handled by the VB Quad.
: HYP_Mesh.VBQuad_Create( num_quads )
HYP_Mesh.VBQuad_Destroy
Destroy a VB quad.
: Lua
mesh_id [INTEGER]: Mesh numeric identifier
: HYP_Mesh.VBQuad_Destroy( mesh_id )
HYP_Mesh.VBQuad_SetQuadVertexUV
Allows to change the UV texture coordinates
for a particular vertex in a particular quad of a VB Quad.
: Lua
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.
: HYP_Mesh.VBQuad_SetQuadVertexUV( mesh_id, quad_index, vertex_index, tu, u, v )
HYP_Mesh.VBQuad_GetQuadVertexUV
: Lua
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 texture coordinate.
v [REAL]: V texture coordinate.
: u, v = HYP_Mesh.VBQuad_GetQuadVertexColor( mesh_id, quad_index, vertex_index,tu )
HYP_Mesh.VBQuad_AddQuad
Adds a quad to a mesh of type BV Quad.
: Lua
mesh_id [INTEGER]: Mesh numeric identifier
quad_id [INTEGER]: Quad primitive numeric identifier
: 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
Sets a new position for one of the 4 vertices of a particular quad in a VB Quad.
: Lua
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.
: HYP_Mesh.VBQuad_SetQuadVertexPosition( mesh_id, quad_index, vertex_index, x, y, z )
HYP_Mesh.VBQuad_GetQuadVertexPosition
Gets the position of one of the 4 vertices of a particular quad in a VB Quad.
: Lua
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).
x [REAL]: Position of vertex in X.
y [REAL]: Position of vertex in Y.
z [REAL]: Position of vertex in Z.
: x, y, z = HYP_Mesh.VBQuad_GetQuadVertexPosition( mesh_id, quad_index, vertex_index )
HYP_Mesh.VBQuad_SetQuadVertexColor
: Lua
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.
: HYP_Mesh.VBQuad_SetQuadVertexColor( mesh_id, quad_index, vertex_index, r, g, b, a )
HYP_Mesh.VBQuad_GetQuadVertexColor
: Lua
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.
: r, g, b, a = HYP_Mesh.VBQuad_GetQuadVertexColor( mesh_id, quad_index, vertex_index )
HYP_Mesh.VBQuad_SortFacesInCameraSpace
: Lua
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
: HYP_Mesh.VBQuad_SortFacesInCameraSpace( vbquad_id, camera_id, order )
HYP_Mesh.GetFaceCenterPosition
Returns the center position of a particular face of the mesh.
: Lua - Python
mesh_id [INTEGER]: Mesh numeric identifier
face_index [INTEGER]: Index of the face (between 0 and HYP_Mesh.GetNumFaces()-1.
x [REAL]: Position of vertex in X.
y [REAL]: Position of vertex in Y.
z [REAL]: Position of vertex in Z.
: x, y, z = HYP_Mesh.GetFaceCenterPosition( mesh_id, face_index )
|