diff options
Diffstat (limited to 'src/mapUtils.cpp')
| -rw-r--r-- | src/mapUtils.cpp | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/src/mapUtils.cpp b/src/mapUtils.cpp index 1023a40..c6a1955 100644 --- a/src/mapUtils.cpp +++ b/src/mapUtils.cpp @@ -5,10 +5,10 @@ * global utils for projection mapping * */ -#pragma once #include "ofMain.h" +//texture binding with normalised coords void bindTexture(ofBaseHasTexture &t) { ofTexture &tex = t.getTextureReference(); tex.bind(); @@ -75,5 +75,21 @@ void drawBox(float size) { glTexCoord2f(0.0f, 1.0f); glVertex3f(-size, size, -size); // Top Left Of The Texture and Quad glEnd(); } - - +void drawBoard(float x,float y,float z) { + glPushMatrix(); + glTranslated(x,y,z); + glBegin(GL_QUADS); + int cx,cz; + for (int i=0;i<8;i++) { + for (int j=0;j<4;j++) { + cx=((i%2)*16)+(j*32)-56; + cz=(i*16)-56; + glVertex3f(cx+8, 0, cz-8); + glVertex3f(cx+8, 0, cz+8); + glVertex3f(cx-8, 0, cz+8); + glVertex3f(cx-8, 0, cz-8); + } + } + glEnd(); + glPopMatrix(); +} |
