S3DR_CreateMesh_SetTriangeTextureCoords()

Syntax

S3DR_CreateMesh_SetTriangleTextureCoords(tu1.f,tv1.f,tu2.f,tv2.f,tu3.f,tv3.f)

Description

Changes the texture coordinates for the triangle which you can add with S3DR_CreateMesh_AddTriangle().

The value of a texture coordinate is from 0.0 To 1.0.
You can calculate the texture coordinate with that formula:
tu.f=X.l/SpriteWidth.l
tv.f=Y.l/SpriteHeight.l

The default is S3DR_CreateMesh_SetTriangleTextureCoords(0,0,1,0,0,1).


This command must be inside of a S3DR_StartCreateMesh()...S3DR_StopCreateMesh() block.
If the function fails, it returns nonzero.

Supported OS

Windows

Sprite3DReal - Index