|
@@ -59,18 +59,23 @@ namespace Test.bbiwarg
|
|
|
int width = depthImage.getWidth();
|
|
|
int height = depthImage.getHeight();
|
|
|
|
|
|
- for (int x = 0; x < width; x++) {
|
|
|
- for (int y = 0; y < height; y++) {
|
|
|
- short depth = depthImage.getDepth(x, y);
|
|
|
-
|
|
|
- int relX = x - width / 2;
|
|
|
- int relY = y - height / 2;
|
|
|
-
|
|
|
- GL.Begin(BeginMode.Polygon);
|
|
|
- GL.Vertex3(relX-0.5f, relY+0.5f, -depth);
|
|
|
- GL.Vertex3(relX+0.5f, relY+0.5f, -depth);
|
|
|
- GL.Vertex3(relX+0.5f, relY-0.5f, -depth);
|
|
|
- GL.Vertex3(relX-0.5f, relY-0.5f, -depth);
|
|
|
+ for (int x = 0; x < width-1; x++) {
|
|
|
+ for (int y = 0; y < height-1; y++)
|
|
|
+ {
|
|
|
+ short depth00 = depthImage.getDepth(x, y);
|
|
|
+ short depth01 = depthImage.getDepth(x + 1, y);
|
|
|
+ short depth10 = depthImage.getDepth(x, y+1);
|
|
|
+ short depth11 = depthImage.getDepth(x + 1, y+1);
|
|
|
+
|
|
|
+ int relX0 = x - width / 2;
|
|
|
+ int relY0 = y - height / 2;
|
|
|
+ int relX1 = x + 1 - width / 2;
|
|
|
+ int relY1 = y + 1 - width / 2;
|
|
|
+
|
|
|
+ GL.Begin(BeginMode.Triangles);
|
|
|
+ GL.Vertex3(relX0, relY0, -depth00);
|
|
|
+ GL.Vertex3(relX0, relY1, -depth01);
|
|
|
+ GL.Vertex3(relX1, relY0, -depth10);
|
|
|
GL.End();
|
|
|
}
|
|
|
}
|