|
@@ -22,9 +22,9 @@ void createDefaultCube(Bildschirm* zScreen)
|
|
|
float size = 1;
|
|
|
float left, right, top, bottom;
|
|
|
// Calculate the screen coordinates of the left side of the bitmap.
|
|
|
- left = (float)((-size / 2.0));
|
|
|
+ right = (float)((-size / 2.0));
|
|
|
// Calculate the screen coordinates of the right side of the bitmap.
|
|
|
- right = left + (float)size;
|
|
|
+ left = right + (float)size;
|
|
|
// Calculate the screen coordinates of the top of the bitmap.
|
|
|
top = (float)(size / 2.0);
|
|
|
// Calculate the screen coordinates of the bottom of the bitmap.
|
|
@@ -94,70 +94,70 @@ void createDefaultCube(Bildschirm* zScreen)
|
|
|
// the order of the polygons has to be NORTH (front), EAST (left), SOUTH
|
|
|
// (back), WEST (right), TOP, BOTTOM according to the Area definition front
|
|
|
// side
|
|
|
- Polygon3D* p = new Polygon3D();
|
|
|
+ Polygon3D* p = new Polygon3D(); // looking from (0,0,0) to (1,0,0) to see this side
|
|
|
p->indexAnz = 6;
|
|
|
p->indexList = new int[p->indexAnz];
|
|
|
p->indexList[0] = 0;
|
|
|
- p->indexList[1] = 2;
|
|
|
- p->indexList[2] = 1;
|
|
|
+ p->indexList[1] = 1;
|
|
|
+ p->indexList[2] = 2;
|
|
|
p->indexList[3] = 1;
|
|
|
- p->indexList[4] = 2;
|
|
|
- p->indexList[5] = 3;
|
|
|
+ p->indexList[4] = 3;
|
|
|
+ p->indexList[5] = 2;
|
|
|
data->addPolygon(p);
|
|
|
// left side
|
|
|
- p = new Polygon3D();
|
|
|
+ p = new Polygon3D(); // looking from (0,0,0) to (0,1,0) to see this side
|
|
|
p->indexAnz = 6;
|
|
|
p->indexList = new int[p->indexAnz];
|
|
|
p->indexList[0] = 0 + 8;
|
|
|
- p->indexList[1] = 2 + 8;
|
|
|
- p->indexList[2] = 1 + 8;
|
|
|
+ p->indexList[1] = 1 + 8;
|
|
|
+ p->indexList[2] = 2 + 8;
|
|
|
p->indexList[3] = 1 + 8;
|
|
|
- p->indexList[4] = 2 + 8;
|
|
|
- p->indexList[5] = 3 + 8;
|
|
|
+ p->indexList[4] = 3 + 8;
|
|
|
+ p->indexList[5] = 2 + 8;
|
|
|
data->addPolygon(p);
|
|
|
// back side
|
|
|
- p = new Polygon3D();
|
|
|
+ p = new Polygon3D(); // looking from (0,0,0) to (-1,0,0) to see this side
|
|
|
p->indexAnz = 6;
|
|
|
p->indexList = new int[p->indexAnz];
|
|
|
p->indexList[0] = 0 + 4;
|
|
|
- p->indexList[1] = 2 + 4;
|
|
|
- p->indexList[2] = 1 + 4;
|
|
|
+ p->indexList[1] = 1 + 4;
|
|
|
+ p->indexList[2] = 2 + 4;
|
|
|
p->indexList[3] = 1 + 4;
|
|
|
- p->indexList[4] = 2 + 4;
|
|
|
- p->indexList[5] = 3 + 4;
|
|
|
+ p->indexList[4] = 3 + 4;
|
|
|
+ p->indexList[5] = 2 + 4;
|
|
|
data->addPolygon(p);
|
|
|
// right side
|
|
|
- p = new Polygon3D();
|
|
|
+ p = new Polygon3D(); // looking from (0,0,0) to (0,-1,0) to see this side
|
|
|
p->indexAnz = 6;
|
|
|
p->indexList = new int[p->indexAnz];
|
|
|
p->indexList[0] = 0 + 12;
|
|
|
- p->indexList[1] = 2 + 12;
|
|
|
- p->indexList[2] = 1 + 12;
|
|
|
+ p->indexList[1] = 1 + 12;
|
|
|
+ p->indexList[2] = 2 + 12;
|
|
|
p->indexList[3] = 1 + 12;
|
|
|
- p->indexList[4] = 2 + 12;
|
|
|
- p->indexList[5] = 3 + 12;
|
|
|
+ p->indexList[4] = 3 + 12;
|
|
|
+ p->indexList[5] = 2 + 12;
|
|
|
data->addPolygon(p);
|
|
|
// top side
|
|
|
- p = new Polygon3D();
|
|
|
+ p = new Polygon3D(); // looking from (0,0,0) to (0,0,-1) to see this side
|
|
|
p->indexAnz = 6;
|
|
|
p->indexList = new int[p->indexAnz];
|
|
|
p->indexList[0] = 0 + 16;
|
|
|
- p->indexList[1] = 2 + 16;
|
|
|
- p->indexList[2] = 1 + 16;
|
|
|
+ p->indexList[1] = 1 + 16;
|
|
|
+ p->indexList[2] = 2 + 16;
|
|
|
p->indexList[3] = 1 + 16;
|
|
|
- p->indexList[4] = 2 + 16;
|
|
|
- p->indexList[5] = 3 + 16;
|
|
|
+ p->indexList[4] = 3 + 16;
|
|
|
+ p->indexList[5] = 2 + 16;
|
|
|
data->addPolygon(p);
|
|
|
// botom side
|
|
|
- p = new Polygon3D();
|
|
|
+ p = new Polygon3D(); // looking from (0,0,0) to (0,0,1) to see this side
|
|
|
p->indexAnz = 6;
|
|
|
p->indexList = new int[p->indexAnz];
|
|
|
p->indexList[0] = 0 + 20;
|
|
|
- p->indexList[1] = 2 + 20;
|
|
|
- p->indexList[2] = 1 + 20;
|
|
|
+ p->indexList[1] = 1 + 20;
|
|
|
+ p->indexList[2] = 2 + 20;
|
|
|
p->indexList[3] = 1 + 20;
|
|
|
- p->indexList[4] = 2 + 20;
|
|
|
- p->indexList[5] = 3 + 20;
|
|
|
+ p->indexList[4] = 3 + 20;
|
|
|
+ p->indexList[5] = 2 + 20;
|
|
|
data->addPolygon(p);
|
|
|
data->calculateNormals();
|
|
|
data->release();
|