diff options
| author | Tim Redfern <tim@eclectronics.org> | 2012-01-02 01:40:11 +0000 |
|---|---|---|
| committer | Tim Redfern <tim@eclectronics.org> | 2012-01-02 01:40:11 +0000 |
| commit | 8b005ba4cebd9909496e0d032770efe9844b5675 (patch) | |
| tree | 963ab648ba0876099830edbbd93d9becee96259c /src/mapUtils.cpp | |
| parent | a728ca18def61a13bbd7d0680dfab011d7ea20ac (diff) | |
camera light orbiting not working
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(); +} |
