I have this short code, which creates a single plain, makes a mesh of it, so i can change the UV coordinates on the second blend layer for my fog of war function which is essential to make it working. (would be)
But there are some strange things, and what seems to be a bug.
First i don't get it why the vertex order is this messed up. It took hours doing nothing but guessing the vertices which triangle they belong to. (the one poly plain is made up of two triangles... just to let you know if haven't already)
The other thing is that although i recover the standard vertex positions using GET VERTEXDATA U() / V() commands, the second triangle gives messed up texture! WHY?! How can it be?
(also spent hours trying to figure out the right values manually, no luck... yeah i know UV coords. go from 0 to 1.0!)
Here is the code, please try out and give me some advice.
make object plain 1,10,10
make mesh from object 1,1
lock vertexdata for mesh 1
`First triangle
set vertexdata uv 3,1, get vertexdata u(3),get vertexdata v(3)
set vertexdata uv 4,1, get vertexdata u(4),get vertexdata v(4)
set vertexdata uv 5,1, get vertexdata u(5),get vertexdata v(5)
`Second triangle
set vertexdata uv 1,1, get vertexdata u(1),get vertexdata v(1)
set vertexdata uv 2,1, get vertexdata u(2),get vertexdata v(2)
set vertexdata uv 6,1, get vertexdata u(6),get vertexdata v(6)
unlock vertexdata
delete object 1