i am new to all of this, so this might be a dumb question, but i found no answer so far.
I want a map out of squares, each contain two triangles, so that every corner can have its own height.
I did something like this:
Code: Select all
while (device->run() && driver)
{
[..]
for (double x = 0; x < 100; x++)
{
for (double y = 0; y < 100; y++)
{
int a = 10;
video::S3DVertex v[16];
u16 i[6] = { 0, 1, 2, 1, 2, 3 };
v[0].Pos.set(x + 20, 0, y + 20);
v[1].Pos.set(x + 20, 0, y);
v[2].Pos.set(x, 0, y + 20);
v[3].Pos.set(x, 0, y);
driver->drawVertexPrimitiveList(v, 4, i, 2, video::EVT_STANDARD, scene::EPT_TRIANGLES, video::EIT_16BIT);
}
}
[..]
}
How do i implement this right? I found something with a scene::ISceneManager, but I dont know what makes the difference.
In the end, the map should be a simple map to put big cubes fur buildings on, or small for worker etc, for a simple rts-demo.
Can anyone help me with this? Thanks