Flat Square / Texture Strech Across

Blitz3D Forums/Blitz3D Programming/Flat Square / Texture Strech Across

WillKoh(Posted 2004) [#1]
If, as the topic implies, I want to create a flat square with U/Vs that make the texture strech across it, is the following right:

mesh=CreateMesh()
s=CreateSurface(mesh)

LU = AddVertex(s, 0, 0,  0,  0, 0): RU = AddVertex(s, +1, 0,  0,  0,+1)
LD = AddVertex(s, 0,-1,  0, +1, 0): RD = AddVertex(s, +1,-1,  0, +1,+1)

AddTriangle s, LU, RU, RD
AddTriangle s, LU, RD, LD




Genexi2(Posted 2004) [#2]
From the AddVertex() description within blitz :
The top left of an image has the uv coordinates 0,0. 
The top right has coordinates 1,0 
The bottom right is 1,1. 
The bottom left 0,1. 


The U\V co-ords should be this I presume :

LU = AddVertex(s, 0, 0,  0,  0, 0): RU = AddVertex(s, +1, 0,  0,  1, 0)
LD = AddVertex(s, 0,-1,  0,  0, 1): RD = AddVertex(s, +1,-1,  0,  1, 1)



You know, it must be hell to write a UV mapper with the math involved to make this stuff accurate when mapping the vertices for a texture.......not to mention having it make correction of precision-float errors....