S3DR_CreateMesh_SetQuadTextureCoords()

Syntax

S3DR_CreateMesh_SetQuadTextureCoords(tu1.f,tv1.f,tu2.f,tv2.f,tu3.f,tv3.f,tu4.f,tv4.f)

Description

Changes the texture coordinates for the quad which you can add with S3DR_CreateMesh_AddQuad().

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

 tu1,tv1         tu2,tv2
   +--------------+
    |               |
    |               |
    |               |
    |               |
   +--------------+
 tu3,tv3         tu4,tv4

The default is S3DR_CreateMesh_SetQuadTextureCoords(0,0,1,0,0,1,1,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