The '_mesh.gbas' allows for texture maps using the 'QuadAddV4()' function.
You pass the texture coordinates using the uv1 and uv2 parameters when adding a new Quad to a mesh.
The TYPE 'TUv' expects two floats representing the x,y position in the texture, normalized from 0.0 to 1.0.
uv1 is the top, left corner, and uv2 is the bottom, right corner in the texture. (If I remember correctly, it may be bottom,left to top,right or something).
You would modify the 'Mesh_QuadAdd()' function from '_voxel.gbas' to detect the face type, and include that face's uv coordinates in the 'quad_offset' variable.
(You actually don't need to use the above 'QuadAddV4()' function in this case.)
Code (glbasic) Select
FUNCTION QuadAddV4%: v1 AS TVertice, v2 AS TVertice, v3 AS TVertice, v4 AS TVertice, uv1 AS TUv, uv2 AS TUv
You pass the texture coordinates using the uv1 and uv2 parameters when adding a new Quad to a mesh.
The TYPE 'TUv' expects two floats representing the x,y position in the texture, normalized from 0.0 to 1.0.
uv1 is the top, left corner, and uv2 is the bottom, right corner in the texture. (If I remember correctly, it may be bottom,left to top,right or something).
You would modify the 'Mesh_QuadAdd()' function from '_voxel.gbas' to detect the face type, and include that face's uv coordinates in the 'quad_offset' variable.
Code (glbasic) Select
quad_offset.SetUv(uv1, uv2)
(You actually don't need to use the above 'QuadAddV4()' function in this case.)