new Mesh(p)
Class that represents a Mesh.
Parameters:
Name | Type | Description | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
p |
Object | Object that represent a Mesh.
Properties
|
Extends
Members
orientation
Set the Object3D orientation.
- Overrides:
- Source:
position
Return the Object3D position.
- Overrides:
- Source:
rotation
Set the Object3D rotation.
- Overrides:
- Source:
Methods
(static) createCircle(p) → {AL3D.Mesh}
Create a Circle mesh.
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
p |
Object | Object that represent a circle.
Properties
|
Returns:
- A circle's mesh.
- Type
- AL3D.Mesh
(static) createCone(p) → {AL3D.Mesh}
Create a Cone mesh.
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
p |
Object | Object that represent a cone.
Properties
|
Returns:
- A cone's mesh.
- Type
- AL3D.Mesh
(static) createCube(p) → {AL3D.Mesh}
Create a Cube mesh.
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
p |
Object | Object that represent a cube.
Properties
|
Returns:
- A cube's mesh.
- Type
- AL3D.Mesh
(static) createCylinder(p) → {AL3D.Mesh}
Create a Cylinder mesh.
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
p |
Object | Object that represent a cylinder.
Properties
|
Returns:
- A cylinder's mesh.
- Type
- AL3D.Mesh
(static) createPlane(p) → {AL3D.Mesh}
Create a Plane mesh.
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
p |
Object | Object that represent a plane.
Properties
|
Returns:
- A plane's mesh.
- Type
- AL3D.Mesh
(static) createSphere(p) → {AL3D.Mesh}
Create a Sphere mesh.
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
p |
Object | Object that represent a sphere.
Properties
|
Returns:
- A sphere's mesh.
- Type
- AL3D.Mesh
addIndex(i)
Add a index.
Parameters:
Name | Type | Description |
---|---|---|
i |
number | Index to add. |
addVertex(v)
Add a vertex.
Parameters:
Name | Type | Description |
---|---|---|
v |
Object | Vertex to add. |
getIndexes() → {Array.<number>}
Get the mesh's indices.
Returns:
- The mesh's indices.
- Type
- Array.<number>
getNormals() → {Array.<number>}
Get the mesh's normals.
Returns:
- The mesh's normals.
- Type
- Array.<number>
getVertex() → {Array.<number>}
Get the mesh's vertices.
Returns:
- The mesh's vertices.
- Type
- Array.<number>
prepareToRender()
Prepare Object3D to render.
This method update the position, orientation and scale
- Inherited From:
- Source:
setIndexBuffer()
Set the index buffer for the mesh
setMaterial(material)
Set a material
Parameters:
Name | Type | Description |
---|---|---|
material |
AL3D.Material | Material to set, If material is not defined, the Basic Material will set. |
setNormalBuffer()
Set the normal buffer for the mesh
setNormalMap(urlTexture)
Set a normal map
Parameters:
Name | Type | Description |
---|---|---|
urlTexture |
string | Normal map's url to set. |
setShader(vs, fs)
Set a shader for the mesh
Parameters:
Name | Type | Description |
---|---|---|
vs |
string | Vertex shader to use. |
fs |
string | Fragment shader to use. |
setSpecularMap(urlTexture)
Set a specular map
Parameters:
Name | Type | Description |
---|---|---|
urlTexture |
string | Specular map's url to set. |
setTexture(urlTexture, uv)
Set a color map.
Parameters:
Name | Type | Description |
---|---|---|
urlTexture |
string | Color map's url to set. |
uv |
Array.<number> | Array with the uv coordinates. |
setUVBuffer()
Set the uv buffer for the mesh
setVertexBuffer()
Set the vertex buffer for the mesh