Class VertexData
Hierarchy
- VertexData
Index
Properties
Methods
- apply
ToGeometry - apply
ToMesh - merge
- serialize
- set
- transform
- update
Geometry - update
Mesh - Compute
Normals - Create
Box - Create
Capsule - Create
Cylinder - Create
Dashed Lines - Create
Disc - Create
Ground - Create
Ground From Height Map - Create
Ico Sphere - Create
Line System - Create
Plane - Create
Polygon - Create
Polyhedron - Create
Ribbon - Create
Sphere - Create
Tiled Box - Create
Tiled Ground - Create
Tiled Plane - Create
Torus - Create
Torus Knot - Extract
From Geometry - Extract
From Mesh - Import
Vertex Data
Properties
colorsSearch playground for colors
An array of the r, g, b, a, color of each vertex [...., r, g, b, a, .....]
indicesSearch playground for indices
An array of i, j, k the three vertex indices required for each triangular facet [...., i, j, k .....]
matrices IndicesSearch playground for matricesIndices
An array containing the list of indices to the array of matrices produced by bones, each vertex have up to 4 indices (8 if the matricesIndicesExtra is set).
matrices Indices ExtraSearch playground for matricesIndicesExtra
An array extending the number of possible indices
matrices WeightsSearch playground for matricesWeights
An array containing the list of weights defining the weight of each indexed matrix in the final computation
matrices Weights ExtraSearch playground for matricesWeightsExtra
An array extending the number of possible weights when the number of indices is extended
normalsSearch playground for normals
An array of the x, y, z normal vector of each vertex [...., x, y, z, .....]
positionsSearch playground for positions
An array of the x, y, z position of each vertex [...., x, y, z, .....]
tangentsSearch playground for tangents
An array of the x, y, z tangent vector of each vertex [...., x, y, z, .....]
uvsSearch playground for uvs
An array of u,v which maps a texture image onto each vertex [...., u, v, .....]
uvs2Search playground for uvs2
A second array of u,v which maps a texture image onto each vertex [...., u, v, .....]
uvs3Search playground for uvs3
A third array of u,v which maps a texture image onto each vertex [...., u, v, .....]
uvs4Search playground for uvs4
A fourth array of u,v which maps a texture image onto each vertex [...., u, v, .....]
uvs5Search playground for uvs5
A fifth array of u,v which maps a texture image onto each vertex [...., u, v, .....]
uvs6Search playground for uvs6
A sixth array of u,v which maps a texture image onto each vertex [...., u, v, .....]
Static Readonly BACKSIDESearch playground for BACKSIDE
Mesh side orientation : usually the internal or back surface
Static Readonly DEFAULTSIDESearch playground for DEFAULTSIDE
Mesh side orientation : by default, FRONTSIDE
Static Readonly DOUBLESIDESearch playground for DOUBLESIDE
Mesh side orientation : both internal and external or front and back surfaces
Static Readonly FRONTSIDESearch playground for FRONTSIDE
Mesh side orientation : usually the external or front surface
Methods
apply ToGeometrySearch playground for applyToGeometry
-
Associates the vertexData to the passed Geometry. Sets it as updatable or not (default
false
)Parameters
-
geometry: Geometry
the geometry the vertexData is applied to
-
Optional updatable: boolean
when used and having the value true allows new data to update the vertexData
Returns VertexData
VertexData
-
apply ToMeshSearch playground for applyToMesh
-
Associates the vertexData to the passed Mesh. Sets it as updatable or not (default
false
)Parameters
-
mesh: Mesh
the mesh the vertexData is applied to
-
Optional updatable: boolean
when used and having the value true allows new data to update the vertexData
Returns VertexData
the VertexData
-
mergeSearch playground for merge
-
Merges the passed VertexData into the current one
Parameters
-
other: VertexData
the VertexData to be merged into the current one
-
Optional use32BitsIndices: boolean
defines a boolean indicating if indices must be store in a 32 bits array
Returns VertexData
the modified VertexData
-
serializeSearch playground for serialize
-
Serializes the VertexData
Returns any
a serialized object
setSearch playground for set
-
Uses the passed data array to set the set the values for the specified kind of data
Parameters
-
data: FloatArray
a linear array of floating numbers
-
kind: string
the type of data that is being set, eg positions, colors etc
Returns void
-
transformSearch playground for transform
-
Transforms each position and each normal of the vertexData according to the passed Matrix
Parameters
-
matrix: Matrix
the transforming matrix
Returns VertexData
the VertexData
-
update GeometrySearch playground for updateGeometry
-
Updates the associated geometry
Parameters
-
geometry: Geometry
the geometry to be updated
Returns VertexData
VertexData.
-
update MeshSearch playground for updateMesh
-
Updates the associated mesh
Parameters
-
mesh: Mesh
the mesh to be updated
Returns VertexData
VertexData
-
Static Compute NormalsSearch playground for ComputeNormals
-
Compute normals for given positions and indices
Parameters
-
positions: any
an array of vertex positions, [...., x, y, z, ......]
-
indices: any
an array of indices in groups of three for each triangular facet, [...., i, j, k, ......]
-
normals: any
an array of vertex normals, [...., x, y, z, ......]
-
Optional options: { bInfo?: any; bbSize?: Vector3; depthSort?: boolean; depthSortedFacets?: any; distanceTo?: Vector3; facetNormals?: any; facetPartitioning?: any; facetPositions?: any; ratio?: number; subDiv?: any; useRightHandedSystem?: boolean }
an object used to set the following optional parameters for the TorusKnot, optional
- facetNormals : optional array of facet normals (vector3)
- facetPositions : optional array of facet positions (vector3)
- facetPartitioning : optional partitioning array. facetPositions is required for facetPartitioning computation
- ratio : optional partitioning ratio / bounding box, required for facetPartitioning computation
- bInfo : optional bounding info, required for facetPartitioning computation
- bbSize : optional bounding box size data, required for facetPartitioning computation
- subDiv : optional partitioning data about subdivsions on each axis (int), required for facetPartitioning computation
- useRightHandedSystem: optional boolean to for right handed system computation
- depthSort : optional boolean to enable the facet depth sort computation
- distanceTo : optional Vector3 to compute the facet depth from this location
- depthSortedFacets : optional array of depthSortedFacets to store the facet distances from the reference location
-
Optional b
Info?: any -
Optional bb
Size?: Vector3 -
Optional depth
Sort?: boolean -
Optional depth
Sorted Facets?: any -
Optional distance
To?: Vector3 -
Optional facet
Normals?: any -
Optional facet
Partitioning?: any -
Optional facet
Positions?: any -
Optional ratio?: number
-
Optional sub
Div?: any -
Optional use
Right Handed System?: boolean
Returns void
-
Static Create BoxSearch playground for CreateBox
-
Creates the VertexData for a box
Parameters
-
options: { backUVs?: Vector4; depth?: number; faceColors?: Color4[]; faceUV?: Vector4[]; frontUVs?: Vector4; height?: number; sideOrientation?: number; size?: number; width?: number }
an object used to set the following optional parameters for the box, required but can be empty
- size sets the width, height and depth of the box to the value of size, optional default 1
- width sets the width (x direction) of the box, overwrites the width set by size, optional, default size
- height sets the height (y direction) of the box, overwrites the height set by size, optional, default size
- depth sets the depth (z direction) of the box, overwrites the depth set by size, optional, default size
- faceUV an array of 6 Vector4 elements used to set different images to each box side
- faceColors an array of 6 Color3 elements used to set different colors to each box side
- sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
- frontUvs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)
- backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1)
Returns VertexData
the VertexData of the box
-
Static Create CapsuleSearch playground for CreateCapsule
-
Creates the VertexData for a Capsule, inspired from https://github.com/maximeq/three-js-capsule-geometry/blob/master/src/CapsuleBufferGeometry.js
Parameters
-
Optional options: ICreateCapsuleOptions
an object used to set the following optional parameters for the capsule, required but can be empty
Returns VertexData
the VertexData of the Capsule
-
Static Create CylinderSearch playground for CreateCylinder
-
Creates the VertexData for a cylinder, cone or prism
Parameters
-
options: { arc?: number; backUVs?: Vector4; diameter?: number; diameterBottom?: number; diameterTop?: number; enclose?: boolean; faceColors?: Color4[]; faceUV?: Vector4[]; frontUVs?: Vector4; hasRings?: boolean; height?: number; sideOrientation?: number; subdivisions?: number; tessellation?: number }
an object used to set the following optional parameters for the box, required but can be empty
- height sets the height (y direction) of the cylinder, optional, default 2
- diameterTop sets the diameter of the top of the cone, overwrites diameter, optional, default diameter
- diameterBottom sets the diameter of the bottom of the cone, overwrites diameter, optional, default diameter
- diameter sets the diameter of the top and bottom of the cone, optional default 1
- tessellation the number of prism sides, 3 for a triangular prism, optional, default 24
- subdivisions` the number of rings along the cylinder height, optional, default 1
- arc a number from 0 to 1, to create an unclosed cylinder based on the fraction of the circumference given by the arc value, optional, default 1
- faceColors an array of Color3 elements used to set different colors to the top, rings and bottom respectively
- faceUV an array of Vector4 elements used to set different images to the top, rings and bottom respectively
- hasRings when true makes each subdivision independantly treated as a face for faceUV and faceColors, optional, default false
- enclose when true closes an open cylinder by adding extra flat faces between the height axis and vertical edges, think cut cake
- sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
- frontUvs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)
- backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1)
-
Optional arc?: number
-
Optional backUVs?: Vector4
-
Optional diameter?: number
-
Optional diameter
Bottom?: number -
Optional diameter
Top?: number -
Optional enclose?: boolean
-
Optional face
Colors?: Color4[] -
Optional faceUV?: Vector4[]
-
Optional frontUVs?: Vector4
-
Optional has
Rings?: boolean -
Optional height?: number
-
Optional side
Orientation?: number -
Optional subdivisions?: number
-
Optional tessellation?: number
Returns VertexData
the VertexData of the cylinder, cone or prism
-
Static Create Dashed LinesSearch playground for CreateDashedLines
-
Create the VertexData for a DashedLines
Parameters
-
options: { dashNb?: number; dashSize?: number; gapSize?: number; points: Vector3[] }
an object used to set the following optional parameters for the DashedLines, required but can be empty
- points an array successive Vector3
- dashSize the size of the dashes relative to the dash number, optional, default 3
- gapSize the size of the gap between two successive dashes relative to the dash number, optional, default 1
- dashNb the intended total number of dashes, optional, default 200
-
Optional dash
Nb?: number -
Optional dash
Size?: number -
Optional gap
Size?: number -
points: Vector3[]
Returns VertexData
the VertexData for the DashedLines
-
Static Create DiscSearch playground for CreateDisc
-
Creates the VertexData of the Disc or regular Polygon
Parameters
-
options: { arc?: number; backUVs?: Vector4; frontUVs?: Vector4; radius?: number; sideOrientation?: number; tessellation?: number }
an object used to set the following optional parameters for the disc, required but can be empty
- radius the radius of the disc, optional default 0.5
- tessellation the number of polygon sides, optional, default 64
- arc a number from 0 to 1, to create an unclosed polygon based on the fraction of the circumference given by the arc value, optional, default 1
- sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
- frontUvs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)
- backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1)
Returns VertexData
the VertexData of the box
-
Static Create GroundSearch playground for CreateGround
-
Creates the VertexData for a Ground
Parameters
-
options: { height?: number; subdivisions?: number; subdivisionsX?: number; subdivisionsY?: number; width?: number }
an object used to set the following optional parameters for the Ground, required but can be empty
- width the width (x direction) of the ground, optional, default 1
- height the height (z direction) of the ground, optional, default 1
- subdivisions the number of subdivisions per side, optional, default 1
-
Optional height?: number
-
Optional subdivisions?: number
-
Optional subdivisionsX?: number
-
Optional subdivisionsY?: number
-
Optional width?: number
Returns VertexData
the VertexData of the Ground
-
Static Create Ground From Height MapSearch playground for CreateGroundFromHeightMap
-
Creates the VertexData of the Ground designed from a heightmap
Parameters
-
options: { alphaFilter: number; buffer: Uint8Array; bufferHeight: number; bufferWidth: number; colorFilter: Color3; height: number; maxHeight: number; minHeight: number; subdivisions: number; width: number }
an object used to set the following parameters for the Ground, required and provided by MeshBuilder.CreateGroundFromHeightMap
- width the width (x direction) of the ground
- height the height (z direction) of the ground
- subdivisions the number of subdivisions per side
- minHeight the minimum altitude on the ground, optional, default 0
- maxHeight the maximum altitude on the ground, optional default 1
- colorFilter the filter to apply to the image pixel colors to compute the height, optional Color3, default (0.3, 0.59, 0.11)
- buffer the array holding the image color data
- bufferWidth the width of image
- bufferHeight the height of image
- alphaFilter Remove any data where the alpha channel is below this value, defaults 0 (all data visible)
-
alpha
Filter: number -
buffer: Uint8Array
-
buffer
Height: number -
buffer
Width: number -
color
Filter: Color3 -
height: number
-
max
Height: number -
min
Height: number -
subdivisions: number
-
width: number
Returns VertexData
the VertexData of the Ground designed from a heightmap
-
Static Create Ico SphereSearch playground for CreateIcoSphere
-
Creates the VertexData of the IcoSphere
Parameters
-
options: { backUVs?: Vector4; flat?: boolean; frontUVs?: Vector4; radius?: number; radiusX?: number; radiusY?: number; radiusZ?: number; sideOrientation?: number; subdivisions?: number }
an object used to set the following optional parameters for the IcoSphere, required but can be empty
- radius the radius of the IcoSphere, optional default 1
- radiusX allows stretching in the x direction, optional, default radius
- radiusY allows stretching in the y direction, optional, default radius
- radiusZ allows stretching in the z direction, optional, default radius
- flat when true creates a flat shaded mesh, optional, default true
- subdivisions increasing the subdivisions increases the number of faces, optional, default 4
- sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
- frontUvs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)
- backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1)
Returns VertexData
the VertexData of the IcoSphere
-
Static Create Line SystemSearch playground for CreateLineSystem
-
Creates the VertexData of the LineSystem
Parameters
-
options: { colors?: Nullable<Color4[][]>; lines: Vector3[][] }
an object used to set the following optional parameters for the LineSystem, required but can be empty
- lines an array of lines, each line being an array of successive Vector3
- colors an array of line colors, each of the line colors being an array of successive Color4, one per line point
Returns VertexData
the VertexData of the LineSystem
-
Static Create PlaneSearch playground for CreatePlane
-
Creates the VertexData for a Plane
Parameters
-
options: { backUVs?: Vector4; frontUVs?: Vector4; height?: number; sideOrientation?: number; size?: number; width?: number }
an object used to set the following optional parameters for the plane, required but can be empty
- size sets the width and height of the plane to the value of size, optional default 1
- width sets the width (x direction) of the plane, overwrites the width set by size, optional, default size
- height sets the height (y direction) of the plane, overwrites the height set by size, optional, default size
- sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
- frontUvs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)
- backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1)
Returns VertexData
the VertexData of the box
-
Static Create PolygonSearch playground for CreatePolygon
-
Creates the VertexData for an irregular Polygon in the XoZ plane using a mesh built by polygonTriangulation.build() All parameters are provided by MeshBuilder.CreatePolygon as needed
Parameters
-
polygon: Mesh
a mesh built from polygonTriangulation.build()
-
sideOrientation: number
takes the values Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
-
Optional fUV: Vector4[]
an array of Vector4 elements used to set different images to the top, rings and bottom respectively
-
Optional fColors: Color4[]
an array of Color3 elements used to set different colors to the top, rings and bottom respectively
-
Optional frontUVs: Vector4
only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)
-
Optional backUVs: Vector4
only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1)
-
Optional wrap: boolean
a boolean, default false, when true and fUVs used texture is wrapped around all sides, when false texture is applied side
Returns VertexData
the VertexData of the Polygon
-
Static Create PolyhedronSearch playground for CreatePolyhedron
-
Creates the VertexData for a Polyhedron
Parameters
-
options: { backUVs?: Vector4; custom?: any; faceColors?: Color4[]; faceUV?: Vector4[]; flat?: boolean; frontUVs?: Vector4; sideOrientation?: number; size?: number; sizeX?: number; sizeY?: number; sizeZ?: number; type?: number }
an object used to set the following optional parameters for the polyhedron, required but can be empty
- type provided types are:
- 0 : Tetrahedron, 1 : Octahedron, 2 : Dodecahedron, 3 : Icosahedron, 4 : Rhombicuboctahedron, 5 : Triangular Prism, 6 : Pentagonal Prism, 7 : Hexagonal Prism, 8 : Square Pyramid (J1)
- 9 : Pentagonal Pyramid (J2), 10 : Triangular Dipyramid (J12), 11 : Pentagonal Dipyramid (J13), 12 : Elongated Square Dipyramid (J15), 13 : Elongated Pentagonal Dipyramid (J16), 14 : Elongated Pentagonal Cupola (J20)
- size the size of the IcoSphere, optional default 1
- sizeX allows stretching in the x direction, optional, default size
- sizeY allows stretching in the y direction, optional, default size
- sizeZ allows stretching in the z direction, optional, default size
- custom a number that overwrites the type to create from an extended set of polyhedron from https://www.babylonjs-playground.com/#21QRSK#15 with minimised editor
- faceUV an array of Vector4 elements used to set different images to the top, rings and bottom respectively
- faceColors an array of Color3 elements used to set different colors to the top, rings and bottom respectively
- flat when true creates a flat shaded mesh, optional, default true
- subdivisions increasing the subdivisions increases the number of faces, optional, default 4
- sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
- frontUvs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)
- backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1)
-
Optional backUVs?: Vector4
-
Optional custom?: any
-
Optional face
Colors?: Color4[] -
Optional faceUV?: Vector4[]
-
Optional flat?: boolean
-
Optional frontUVs?: Vector4
-
Optional side
Orientation?: number -
Optional size?: number
-
Optional sizeX?: number
-
Optional sizeY?: number
-
Optional sizeZ?: number
-
Optional type?: number
Returns VertexData
the VertexData of the Polyhedron
-
Static Create RibbonSearch playground for CreateRibbon
-
Creates the VertexData for a Ribbon
Parameters
-
options: { backUVs?: Vector4; closeArray?: boolean; closePath?: boolean; colors?: Color4[]; frontUVs?: Vector4; invertUV?: boolean; offset?: number; pathArray: Vector3[][]; sideOrientation?: number; uvs?: Vector2[] }
an object used to set the following optional parameters for the ribbon, required but can be empty
- pathArray array of paths, each of which an array of successive Vector3
- closeArray creates a seam between the first and the last paths of the pathArray, optional, default false
- closePath creates a seam between the first and the last points of each path of the path array, optional, default false
- offset a positive integer, only used when pathArray contains a single path (offset = 10 means the point 1 is joined to the point 11), default rounded half size of the pathArray length
- sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
- frontUvs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)
- backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1)
- invertUV swaps in the U and V coordinates when applying a texture, optional, default false
- uvs a linear array, of length 2 * number of vertices, of custom UV values, optional
- colors a linear array, of length 4 * number of vertices, of custom color values, optional
Returns VertexData
the VertexData of the ribbon
-
Static Create SphereSearch playground for CreateSphere
-
Creates the VertexData for an ellipsoid, defaults to a sphere
Parameters
-
options: { arc?: number; backUVs?: Vector4; diameter?: number; diameterX?: number; diameterY?: number; diameterZ?: number; frontUVs?: Vector4; segments?: number; sideOrientation?: number; slice?: number }
an object used to set the following optional parameters for the box, required but can be empty
- segments sets the number of horizontal strips optional, default 32
- diameter sets the axes dimensions, diameterX, diameterY and diameterZ to the value of diameter, optional default 1
- diameterX sets the diameterX (x direction) of the ellipsoid, overwrites the diameterX set by diameter, optional, default diameter
- diameterY sets the diameterY (y direction) of the ellipsoid, overwrites the diameterY set by diameter, optional, default diameter
- diameterZ sets the diameterZ (z direction) of the ellipsoid, overwrites the diameterZ set by diameter, optional, default diameter
- arc a number from 0 to 1, to create an unclosed ellipsoid based on the fraction of the circumference (latitude) given by the arc value, optional, default 1
- slice a number from 0 to 1, to create an unclosed ellipsoid based on the fraction of the height (latitude) given by the arc value, optional, default 1
- sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
- frontUvs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)
- backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1)
Returns VertexData
the VertexData of the ellipsoid
-
Static Create Tiled BoxSearch playground for CreateTiledBox
-
Creates the VertexData for a tiled box
Parameters
-
options: { alignHorizontal?: number; alignVertical?: number; depth?: number; faceColors?: Color4[]; faceUV?: Vector4[]; height?: number; pattern?: number; sideOrientation?: number; tileHeight?: number; tileSize?: number; tileWidth?: number; width?: number }
an object used to set the following optional parameters for the box, required but can be empty
- faceTiles sets the pattern, tile size and number of tiles for a face
- faceUV an array of 6 Vector4 elements used to set different images to each box side
- faceColors an array of 6 Color3 elements used to set different colors to each box side
- sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
-
Optional align
Horizontal?: number -
Optional align
Vertical?: number -
Optional depth?: number
-
Optional face
Colors?: Color4[] -
Optional faceUV?: Vector4[]
-
Optional height?: number
-
Optional pattern?: number
-
Optional side
Orientation?: number -
Optional tile
Height?: number -
Optional tile
Size?: number -
Optional tile
Width?: number -
Optional width?: number
Returns VertexData
the VertexData of the box
-
Static Create Tiled GroundSearch playground for CreateTiledGround
-
Creates the VertexData for a TiledGround by subdividing the ground into tiles
Parameters
-
options: { precision?: { h: number; w: number }; subdivisions?: { h: number; w: number }; xmax: number; xmin: number; zmax: number; zmin: number }
an object used to set the following optional parameters for the Ground, required but can be empty
- xmin the ground minimum X coordinate, optional, default -1
- zmin the ground minimum Z coordinate, optional, default -1
- xmax the ground maximum X coordinate, optional, default 1
- zmax the ground maximum Z coordinate, optional, default 1
- subdivisions a javascript object {w: positive integer, h: positive integer},
w
andh
are the numbers of subdivisions on the ground width and height creating 'tiles', default {w: 6, h: 6} - precision a javascript object {w: positive integer, h: positive integer},
w
andh
are the numbers of subdivisions on the tile width and height, default {w: 2, h: 2}
-
Optional precision?: { h: number; w: number }
-
h: number
-
w: number
-
-
Optional subdivisions?: { h: number; w: number }
-
h: number
-
w: number
-
-
xmax: number
-
xmin: number
-
zmax: number
-
zmin: number
Returns VertexData
the VertexData of the TiledGround
-
Static Create Tiled PlaneSearch playground for CreateTiledPlane
-
Creates the VertexData for a tiled plane
Parameters
-
options: { alignHorizontal?: number; alignVertical?: number; backUVs?: Vector4; frontUVs?: Vector4; height?: number; pattern?: number; sideOrientation?: number; size?: number; tileHeight?: number; tileSize?: number; tileWidth?: number; width?: number }
an object used to set the following optional parameters for the box, required but can be empty
- pattern a limited pattern arrangement depending on the number
- tileSize sets the width, height and depth of the tile to the value of size, optional default 1
- tileWidth sets the width (x direction) of the tile, overwrites the width set by size, optional, default size
- tileHeight sets the height (y direction) of the tile, overwrites the height set by size, optional, default size
- sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
- frontUvs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)
- backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1)
-
Optional align
Horizontal?: number -
Optional align
Vertical?: number -
Optional backUVs?: Vector4
-
Optional frontUVs?: Vector4
-
Optional height?: number
-
Optional pattern?: number
-
Optional side
Orientation?: number -
Optional size?: number
-
Optional tile
Height?: number -
Optional tile
Size?: number -
Optional tile
Width?: number -
Optional width?: number
Returns VertexData
the VertexData of the tiled plane
-
Static Create TorusSearch playground for CreateTorus
-
Creates the VertexData for a torus
Parameters
-
options: { backUVs?: Vector4; diameter?: number; frontUVs?: Vector4; sideOrientation?: number; tessellation?: number; thickness?: number }
an object used to set the following optional parameters for the box, required but can be empty
- diameter the diameter of the torus, optional default 1
- thickness the diameter of the tube forming the torus, optional default 0.5
- tessellation the number of prism sides, 3 for a triangular prism, optional, default 24
- sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
- frontUvs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)
- backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1)
Returns VertexData
the VertexData of the torus
-
Static Create Torus KnotSearch playground for CreateTorusKnot
-
Creates the VertexData for a TorusKnot
Parameters
-
options: { backUVs?: Vector4; frontUVs?: Vector4; p?: number; q?: number; radialSegments?: number; radius?: number; sideOrientation?: number; tube?: number; tubularSegments?: number }
an object used to set the following optional parameters for the TorusKnot, required but can be empty
- radius the radius of the torus knot, optional, default 2
- tube the thickness of the tube, optional, default 0.5
- radialSegments the number of sides on each tube segments, optional, default 32
- tubularSegments the number of tubes to decompose the knot into, optional, default 32
- p the number of windings around the z axis, optional, default 2
- q the number of windings around the x axis, optional, default 3
- sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
- frontUvs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)
- backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1)
Returns VertexData
the VertexData of the Torus Knot
-
Static Extract From GeometrySearch playground for ExtractFromGeometry
-
Extracts the vertexData from the geometry
Parameters
-
geometry: Geometry
the geometry from which to extract the VertexData
-
Optional copyWhenShared: boolean
defines if the VertexData must be cloned when the geometrty is shared between multiple meshes, optional, default false
-
Optional forceCopy: boolean
indicating that the VertexData must be cloned, optional, default false
Returns VertexData
the object VertexData associated to the passed mesh
-
Static Extract From MeshSearch playground for ExtractFromMesh
-
Extracts the vertexData from a mesh
Parameters
-
mesh: Mesh
the mesh from which to extract the VertexData
-
Optional copyWhenShared: boolean
defines if the VertexData must be cloned when shared between multiple meshes, optional, default false
-
Optional forceCopy: boolean
indicating that the VertexData must be cloned, optional, default false
Returns VertexData
the object VertexData associated to the passed mesh
-
Static Import Vertex DataSearch playground for ImportVertexData
-
Applies VertexData created from the imported parameters to the geometry
Parameters
-
parsedVertexData: any
the parsed data from an imported file
-
geometry: Geometry
the geometry to apply the VertexData to
Returns void
-
This class contains the various kinds of data on every vertex of a mesh used in determining its shape and appearance