Page 2 of 2

Re: Multitexturing entity - PseudoTerrain

Posted: Tue Aug 13, 2013 2:55 pm
by Lexicon
Ups... Only last vertex. My head's bursting.

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)
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
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.

Re: Multitexturing entity - PseudoTerrain

Posted: Tue Aug 13, 2013 3:40 pm
by Lexicon
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
Yes! This is my target! :) But... I want to make it myself in my program without materials. Also (excuse me) I need not only 2 textures. I need more textures like 2 layers of asphalt, 2 layers of macadam etc.
I will be first who created serious game (like Stalker) on the PB, but more better.

http://www.youtube.com/watch?v=NUkddyIF95g