From 358bd0456b9b5c619a8cd408ebdb0740321be034 Mon Sep 17 00:00:00 2001 From: sam Date: Fri, 15 Aug 2008 19:05:58 +0000 Subject: [PATCH] * Fix OpenGL orientation (it's supposed to be right-handed). * Add a grayscale plane to illustrate non-orthogonality. git-svn-id: file:///srv/caca.zoy.org/var/lib/svn/research@2723 92316355-f0b4-4df1-b90c-862c8a59935f --- 2008-rubik/colorcube/visu.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/2008-rubik/colorcube/visu.c b/2008-rubik/colorcube/visu.c index fcb982a..36dd507 100644 --- a/2008-rubik/colorcube/visu.c +++ b/2008-rubik/colorcube/visu.c @@ -70,8 +70,8 @@ static void reshape(int w, int h) } #define F(x) ((x)*1.01 - 0.005) -#define CP glColor4f(x0,y0,z0,0.5); glVertex3f(y0,x0,z0) -#define BP glColor3f(0.0,0.0,0.0); glVertex3f(F(y0),F(x0),F(z0)) +#define CP glColor4f(x0,y0,z0,0.5); glVertex3f(x0,y0,z0) +#define BP glColor3f(0.0,0.0,0.0); glVertex3f(F(x0),F(y0),F(z0)) #define BLACK x0 = y0 = z0 = 0.0 #define RED x0 = 1.0; y0 = z0 = 0.0 //#define XRED x0 = 0.8; y0 = z0 = 0.0 @@ -126,6 +126,14 @@ static void display(void) XGREEN; BP; WHITE; BP; WHITE; BP; XRED; BP; glEnd(); + glTranslatef(.5, .5, .4); + glColor4f(.5, .5, .5, .5); + glBegin(GL_QUADS); + glVertex3f(0.891063,-0.45388,0); + glVertex3f(0.0773943,0.151941,-0.985355); + glVertex3f(-0.891063,0.45388,0); + glVertex3f(-0.0773943,-0.151941,0.985355); + glEnd(); glPopMatrix(); glutSwapBuffers();