Hi everyone, I have a small problem;
I''m trying to make a grid with tri stips. I want the smallest vertex count I can have..
The vertices are at the right place but I can''t figure out the index to use.
Here''s what I''ve tried (taken straight out of my engine):
m_Surface.iNumVertex = (m_iWaterX+1) * m_iWaterY;
m_Surface.iNumIndices = m_iWaterX * m_iWaterY;
OwnNextAlloc;m_Surface.vVertexList = new Vertex[ m_Surface.iNumVertex + 1 ];
OwnNextAlloc;m_Surface.pIndices = new INDEX[ m_Surface.iNumIndices + 1 ];
m_Surface.rmRenderMode = RENDER_WIREFRAME;
m_Surface.rtRenderType = RENDER_STRIP;
m_Surface.pMaterial = &m_Material;
float MidX = m_iWaterX / 2.0f;
float MidY = m_iWaterY / 2.0f;
for ( int X = 0; X < m_iWaterX; X++ )
{
Vertex vGenA; // Vertex to put
for ( int Z = 0; Z < m_iWaterY; Z++ ) {
vGenA.v3Point.Set( float(X+1 - m_iWaterX) + MidX, 0.0f, float(Z - m_iWaterY) + MidY );
vGenA.tcTexture.Set( float(X+1) / float(m_iWaterX), float(Z) / float(m_iWaterY) );
vGenA.cVertexCol.Set( float(X+1) / float(m_iWaterX), float(Z) / float(m_iWaterY), 1, 1);
m_Surface.vVertexList[VertexNumber++] = vGenA;
}
} // END FOR
for ( int i = 0; i < m_iWaterX; i++ ) {
bool Switch = (i % 2) != 0;
int PartA = (Switch) ? -(m_iWaterY-1) : m_iWaterY;
for ( int j = 0; j < m_iWaterY; j++ ) {
INDEX CurrentIndice = (i * m_iWaterY) + j;
m_Surface.pIndices[ CurrentIndice ] = CurrentIndice + PartA;
}
}
I tried to make an algorithme on paper but I guess I''m not that good at it

Thanks in advance !
_____________________