Class Index | File Index

## Classes

- _global_
- JSC3D
- JSC3D.AABB
- JSC3D.BinaryStream
- JSC3D.LoaderSelector
- JSC3D.Material
- JSC3D.Math3D
- JSC3D.Matrix3x4
- JSC3D.Mesh
- JSC3D.ObjLoader
- JSC3D.PickInfo
- JSC3D.Scene
- JSC3D.StlLoader
- JSC3D.Texture
- JSC3D.Viewer

# Class JSC3D.Mesh

Mesh This class implements mesh that is used as an expression of 3D object and the basic primitive for rendering.
A mesh basically consists of a sequence of faces, and optioanlly a material, a texture mapping and other attributes and metadata.
A face consists of 3 or more coplanary vertex that should be descript in counter-clockwise order.
A texture mapping includes a valid texture object with a sequence of texture coordinats specified per vertex.
Defined in: jsc3d.js.

Class Summary
Constructor Attributes | Constructor Name and Description
--- | ---
| JSC3D.Mesh(name, visible, material, texture, creaseAngle, isDoubleSided, isEnvironmentCast, coordBuffer, indexBuffer, texCoordBuffer, texCoordIndexBuffer)

Method Summary
Method Attributes | Method Name and Description
--- | ---
| hasTexture() See if the mesh has valid texture mapping.
| init() Initialize the mesh.
| isTrivial() See if the mesh is a trivial mesh.
| setMaterial(material) Set material for the mesh.
| setRenderMode(mode) Set render mode of the mesh.
| setTexture(texture) Set texture for the mesh.

Class Detail
JSC3D.Mesh(name, visible, material, texture, creaseAngle, isDoubleSided, isEnvironmentCast, coordBuffer, indexBuffer, texCoordBuffer, texCoordIndexBuffer)

Parameters:
name
visible
material
texture
creaseAngle
isDoubleSided
isEnvironmentCast
coordBuffer
indexBuffer
texCoordBuffer
texCoordIndexBuffer

Method Detail
{Boolean} hasTexture()
See if the mesh has valid texture mapping.

Returns:
  {Boolean} true if it has valid texture mapping; false if not.

init()
Initialize the mesh.

{Boolean} isTrivial()
See if the mesh is a trivial mesh. A trivial mesh should be omited in any calculations and rendering.

Returns:
  {Boolean} true if it is trivial; false if not.

setMaterial(material)
Set material for the mesh.

Parameters:
{JSC3D.Material} material
  the material object.

setRenderMode(mode)
Set render mode of the mesh.
Available render modes are:
'point': render meshes as point clouds;
'wireframe': render meshes as wireframe;
'flat': render meshes as solid objects using flat shading;
'smooth': render meshes as solid objects using smooth shading;
'texture': render meshes as solid textured objects, no lighting will be apllied;
'textureflat': render meshes as solid textured objects, lighting will be calculated per face;
'texturesmooth': render meshes as solid textured objects, lighting will be calculated per vertex and interpolated.

Parameters:
{String} mode
  new render mode.

setTexture(texture)
Set texture for the mesh.

Parameters:
{JSC3D.Texture} texture
  the texture object.

Documentation generated by JsDoc Toolkit 2.1.0 on Thu Nov 28 2013 14:35:14 GMT+0800 (CST)