A Surface object is a JavaScript object that represents one of the surfaces of a Geometry. It defines part or all of the the geometry to draw and provides the indexing information required to draw it. The data is stored using either indexBuffer and numIndices or first and numVertices.:
if (surface.indexBuffer)
{
drawParameters.indexBuffer = surface.indexBuffer;
drawParameters.count = surface.numIndices;
}
else
{
drawParameters.firstIndex = surface.first;
drawParameters.count = surface.numVertices;
}
Summary
The primitive type the surface.
Syntax
var primitive = surface.primitive;
Summary
The IndexBuffer for the surface.
This may be undefined.
If it is defined then numIndices is also defined.
Syntax
var indexBuffer = surface.indexBuffer;
Summary
When indexBuffer is defined this is the number of indicies in the buffer to use.
This may be undefined.
Syntax
var numIndices = surface.numIndices;
Summary
When indexBuffer is not defined this is the first index of the first vertex in the Geometry’s vertexBuffer to start from.
This may be undefined.
If it is defined then numVertices is also defined.
Syntax
var first = surface.first;
Summary
When indexBuffer is not defined this is the number of vertices to process.
This may be undefined.
Syntax
var numVertices = surface.numVertices;
Summary
A native array of vertexData that can be use to create or update a VertexBuffer.
See Scene.load.
This may be undefined.
Syntax
var vertexData = surface.vertexData;
Summary
A native array of indexData that can be use to create or update a IndexBuffer.
See Scene.load.
This may be undefined.
Syntax
var indexData = surface.indexData;