Original Post
Alright, here is what I have so far:
int Tracker = 0;
for( int x = 0; x < terrain.GetSize(); x++ )
{
for( int y = 0; y < terrain.GetSize(); y++ )
{
float z = terrain.GetCell( x, y );
pVertices[Tracker].x = (float)x;
pVertices[Tracker].y = z;
pVertices[Tracker].z = (float)y;
pVertices[Tracker].color= 0xffffffff;
Tracker+=1;
}
}
First, it will take care of all the z''s in the x=0 row (variable y in the terrain generator), then it will shift x over one and take care of all the z''s in that row...etc. It works completely fine, I am just having a problem rendering it. If I do
DeviceD3D->DrawPrimitive( D3DPT_POINTLIST,...);
It will come out just fine, as points (it actually looks pretty cool
I wan''t to draw the primitive with triangles, but it comes out really screwy. I need to switch the order in which pVertices gets filled, but I have no idea how. If anyone could help me out, that would be great.
-Dev578