From eec680a34b7240dcfefcb06d4bb19d139082c81f Mon Sep 17 00:00:00 2001 From: dcnieho Date: Mon, 19 Nov 2012 02:26:07 +0000 Subject: [PATCH] fixed normals of glutCone, thanks Ioannis! Also now using irad as base input for cone and cylinder, while using orad as height. Without that the problem can't be seen in our demo git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1408 7f0cb862-5218-0410-a997-914c9d46530a --- freeglut/freeglut/progs/demos/shapes/shapes.c | 8 ++++---- freeglut/freeglut/src/fg_geometry.c | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/freeglut/freeglut/progs/demos/shapes/shapes.c b/freeglut/freeglut/progs/demos/shapes/shapes.c index b22ee37..7c8a186 100644 --- a/freeglut/freeglut/progs/demos/shapes/shapes.c +++ b/freeglut/freeglut/progs/demos/shapes/shapes.c @@ -445,10 +445,10 @@ static void drawSolidTorus(void) { glutSolidTorus(irad,orad,slices static void drawWireTorus(void) { glutWireTorus (irad,orad,slices,stacks); } static void drawSolidSphere(void) { glutSolidSphere(orad,slices,stacks); } /* orad doubles as size input */ static void drawWireSphere(void) { glutWireSphere(orad,slices,stacks); } /* orad doubles as size input */ -static void drawSolidCone(void) { glutSolidCone(orad,orad,slices,stacks); } /* orad doubles as size input */ -static void drawWireCone(void) { glutWireCone(orad,orad,slices,stacks); } /* orad doubles as size input */ -static void drawSolidCylinder(void) { glutSolidCylinder(orad,orad,slices,stacks); } /* orad doubles as size input */ -static void drawWireCylinder(void) { glutWireCylinder(orad,orad,slices,stacks); } /* orad doubles as size input */ +static void drawSolidCone(void) { glutSolidCone(irad,orad,slices,stacks); } /* irad doubles as base input, and orad as height input */ +static void drawWireCone(void) { glutWireCone(irad,orad,slices,stacks); } /* irad doubles as base input, and orad as height input */ +static void drawSolidCylinder(void) { glutSolidCylinder(irad,orad,slices,stacks); } /* irad doubles as radius input, and orad as height input */ +static void drawWireCylinder(void) { glutWireCylinder(irad,orad,slices,stacks); } /* irad doubles as radius input, and orad as height input */ static void drawSolidTeapot(void) { /* per Glut manpage, it should be noted that the teapot is rendered diff --git a/freeglut/freeglut/src/fg_geometry.c b/freeglut/freeglut/src/fg_geometry.c index e125cf7..3463723 100644 --- a/freeglut/freeglut/src/fg_geometry.c +++ b/freeglut/freeglut/src/fg_geometry.c @@ -1298,9 +1298,9 @@ void fghGenerateCone( (*vertices)[idx ] = cost[j]*r; (*vertices)[idx+1] = sint[j]*r; (*vertices)[idx+2] = z; - (*normals )[idx ] = cost[j]*sinn; - (*normals )[idx+1] = sint[j]*sinn; - (*normals )[idx+2] = cosn; + (*normals )[idx ] = cost[j]*cosn; + (*normals )[idx+1] = sint[j]*cosn; + (*normals )[idx+2] = sinn; } z += zStep;