|
MeshUtilsGeneratePlanarTextureCoordinates(PositionNormalTextureVertex, Int32, Vector3, Vector3, NullableVector2, NullableVector2, Boolean, Boolean, Boolean) Method |
Generate texture coordinates for the given vertices and triangleIndices.
Texture coordinates are computed using planar projection.
The plane is defined by the normal vector (perpendicular to the plane surface) and direction vector along
the plane surface (i.e., the Y direction of the 2D plane shape).
Namespace: Ab4d.SharpEngine.UtilitiesAssembly: Ab4d.SharpEngine (in Ab4d.SharpEngine.dll) Version: 2.0.8956+4c7684e186ca1be74e7a284fbe739d9a1b843d3c
Syntax public static Vector2[] GeneratePlanarTextureCoordinates(
PositionNormalTextureVertex[] vertices,
int[] triangleIndices,
Vector3 planeNormalVector,
Vector3 planeHeightVector,
Vector2? customBoundsMin,
Vector2? customBoundsMax,
bool flipXCoordinate = false,
bool flipYCoordinate = false,
bool flipBackwardFacingXCoordinate = false
)
Parameters
- vertices PositionNormalTextureVertex
- Array of vertex data that defines the mesh.
- triangleIndices Int32
- Array of triangle indices that define the mesh.
- planeNormalVector Vector3
- Vector that defines the plane normal (i.e., perpendicular to the plane's surface).
- planeHeightVector Vector3
- Vector that defines the direction along the plane surface (i.e., along the Y direction of the 2D plane shape).
- customBoundsMin NullableVector2
- Optional minimum point of the 2D bounding box that limits the projection of the 3D positions onto the 2D plane.
- customBoundsMax NullableVector2
- Optional maximum point of the 2D bounding box that limits the projection of the 3D positions onto the 2D plane.
- flipXCoordinate Boolean (Optional)
- Invert/flip the X texture coordinate.
- flipYCoordinate Boolean (Optional)
- Invert/flip the Y texture coordinate.
- flipBackwardFacingXCoordinate Boolean (Optional)
- Invert/flip the X texture coordinate on positions with backwards-facing normals. This for example allows creating texture coordinates for displaying text that can be read on both sides of the object.
Return Value
Vector2Array of generated texture coordinates.
See Also