Function CreateRibbon
-
CreateRibbon(
name: string,
options: {
backUVs?: Vector4;
closeArray?: boolean;
closePath?: boolean;
colors?: Color4[];
frontUVs?: Vector4;
instance?: Mesh;
invertUV?: boolean;
offset?: number;
pathArray: Vector3[][];
sideOrientation?: number;
updatable?: boolean;
uvs?: Vector2[];
},
scene?: Nullable<Scene>,
): MeshParameters
- name: string
defines the name of the mesh
- options: {
backUVs?: Vector4;
closeArray?: boolean;
closePath?: boolean;
colors?: Color4[];
frontUVs?: Vector4;
instance?: Mesh;
invertUV?: boolean;
offset?: number;
pathArray: Vector3[][];
sideOrientation?: number;
updatable?: boolean;
uvs?: Vector2[];
}defines the options used to create the mesh
- scene: Nullable<Scene> = null
defines the hosting scene
Returns Mesh
the ribbon mesh
- name: string
Creates a ribbon mesh. The ribbon is a parametric shape. It has no predefined shape. Its final shape will depend on the input parameters
pathArrayis a required array of paths, what are each an array of successive Vector3. The pathArray parameter depicts the ribbon geometrycloseArray(boolean, default false) creates a seam between the first and the last paths of the path arrayclosePath(boolean, default false) creates a seam between the first and the last points of each path of the path arrayoffset(positive integer, default : rounded half size of the pathArray length), is taken in account only if thepathArrayis containing a single pathinstanceis an instance of an existing Ribbon object to be updated with the passedpathArrayparameter : https://doc.babylonjs.com/features/featuresDeepDive/mesh/dynamicMeshMorph#ribbonfrontUVsandbackUVs(Vector4). Detail here : https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientationinvertUV(boolean, default false) swaps in the geometry the U and V coordinates to apply a textureuvsis an optional flat array ofVector2to update/set each ribbon vertex with its own custom UV values instead of the computed onescolorsis an optional flat array ofColor4to set/update each ribbon vertex with its own custom color valuesuvsorcolors, the passed arrays must be populated with the right number of elements, it is to say the number of ribbon vertices. Remember that if you setclosePathtotrue, there's one extra vertex per path in the geometrycolorwithinstance(to update the ribbon), only if you previously used it at creation timeupdatable(default false) if its internal geometry is supposed to change once created