Function CreatePolygon
-
CreatePolygon(
name: string,
options: {
backUVs?: Vector4;
depth?: number;
faceColors?: Color4[];
faceUV?: Vector4[];
frontUVs?: Vector4;
holes?: Vector3[][];
shape: Vector3[];
sideOrientation?: number;
smoothingThreshold?: number;
updatable?: boolean;
wrap?: boolean;
},
scene?: Nullable<Scene>,
earcutInjection?: any,
): MeshParameters
- name: string
defines the name of the mesh
- options: {
backUVs?: Vector4;
depth?: number;
faceColors?: Color4[];
faceUV?: Vector4[];
frontUVs?: Vector4;
holes?: Vector3[][];
shape: Vector3[];
sideOrientation?: number;
smoothingThreshold?: number;
updatable?: boolean;
wrap?: boolean;
}defines the options used to create the mesh
- scene: Nullable<Scene> = null
defines the hosting scene
- earcutInjection: any = earcut
can be used to inject your own earcut reference
Returns Mesh
the polygon mesh
- name: string
Creates a polygon mesh The polygon's shape will depend on the input parameters and is constructed parallel to a ground mesh
shapeis a required array of successive Vector3 representing the corners of the polygon in th XoZ plane, that is y = 0 for all vectorsupdatable(default false) if its internal geometry is supposed to change once createdfrontUVsandbackUVs(Vector4)smoothingThresholdoption defines the dot product threshold for smoothing the normals of adjacent side faces. The default value of 2 disables smoothing