Please help guys! How can I change the color of a first (second, third... etc) vertex?
Code: Select all
Length = 4
Height = -1
CreateMesh(2, #PB_Mesh_TriangleList, #PB_Mesh_Dynamic)
col = 255
For z = 0 To Length - 1
For x = 0 To Length - 1
MeshVertexPosition(x + 1, Height, z) ; *** 0 * 1, 0 ---
MeshVertexTextureCoordinate(0, 1)
MeshVertexColor(RGBA(col,col,col,128))
MeshVertexPosition(x + 1, Height, z + 1) ; *** 1 * 1, 1 ---
MeshVertexTextureCoordinate(1, 1)
MeshVertexColor(RGBA(col,col,col,128))
MeshVertexPosition(x, Height, z + 1) ; *** 2 * 0, 1 ---
MeshVertexTextureCoordinate(1, 0)
MeshVertexColor(RGBA(col,col,col,128))
MeshVertexPosition(x, Height, z) ; *** 3 * 0, 0 ---
MeshVertexTextureCoordinate(0, 0)
MeshVertexColor(RGBA(col,col,col,128))
a = (z * Length * 4) + x * 4
MeshFace(a+0, a+1, a+2)
MeshFace(a+2, a+3, a+0)
Next
Next
MeshIndex(5) ; ???
MeshVertexColor(RGBA(255,0,0,0))
FinishMesh(#True)
NormalizeMesh(2)
I can not use PB Terrain because sometimes some polygons's edges do not coincide. I have a plane (instead a terrain) with 3 textures. I want to change textures on some vertices like terrain.Comtois wrote:Well i don't understand what you are trying to do, may be this can help ?
http://www.ogre3d.org/tikiwiki/Material ... transition
