From ffd287a3d20b3fb6f1b74fd7e782ca7eef23a60e Mon Sep 17 00:00:00 2001 From: Diederick Niehorster 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: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@1408 7f0cb862-5218-0410-a997-914c9d46530a --- progs/demos/shapes/shapes.c | 8 ++++---- src/fg_geometry.c | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/progs/demos/shapes/shapes.c b/progs/demos/shapes/shapes.c index b22ee37..7c8a186 100644 --- a/progs/demos/shapes/shapes.c +++ b/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/src/fg_geometry.c b/src/fg_geometry.c index e125cf7..3463723 100644 --- a/src/fg_geometry.c +++ b/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; -- 1.7.10.4