projects
/
freeglut
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
got one fo the cube's normals wrong
[freeglut]
/
src
/
fg_geometry.c
diff --git
a/src/fg_geometry.c
b/src/fg_geometry.c
index
583b544
..
a1d683d
100644
(file)
--- a/
src/fg_geometry.c
+++ b/
src/fg_geometry.c
@@
-126,9
+126,9
@@
static GLdouble cube_v[CUBE_NUM_VERT][3] =
/* Normal Vectors */
static GLdouble cube_n[CUBE_NUM_FACES][3] =
{
/* Normal Vectors */
static GLdouble cube_n[CUBE_NUM_FACES][3] =
{
+ { 0.0, 0.0, 1.0},
{ 1.0, 0.0, 0.0},
{ 0.0, 1.0, 0.0},
{ 1.0, 0.0, 0.0},
{ 0.0, 1.0, 0.0},
- { 0.0, 0.0, 1.0},
{-1.0, 0.0, 0.0},
{ 0.0,-1.0, 0.0},
{ 0.0, 0.0,-1.0}
{-1.0, 0.0, 0.0},
{ 0.0,-1.0, 0.0},
{ 0.0, 0.0,-1.0}
@@
-181,7
+181,7
@@
static void fghCubeGenerate()
#define TETR_VERT_ELEM_PER_TETR TETR_VERT_PER_TETR*3
/* Vertex Coordinates */
#define TETR_VERT_ELEM_PER_TETR TETR_VERT_PER_TETR*3
/* Vertex Coordinates */
-static GLdouble tet_r[TETR_NUM_VERT][TETR_NUM_VERT_PER_FACE] =
+static GLdouble tet_r[TETR_NUM_VERT][3] =
{
{ 1.0, 0.0, 0.0 },
{ -0.333333333333, 0.942809041582, 0.0 },
{
{ 1.0, 0.0, 0.0 },
{ -0.333333333333, 0.942809041582, 0.0 },
@@
-328,7
+328,10
@@
static void fghCircleTable(double **sint,double **cost,const int n)
static void fghCube( GLdouble dSize, GLboolean useWireMode )
{
if (!cubeCached)
static void fghCube( GLdouble dSize, GLboolean useWireMode )
{
if (!cubeCached)
+ {
fghCubeGenerate();
fghCubeGenerate();
+ cubeCached = TRUE;
+ }
if (dSize!=1.)
{
if (dSize!=1.)
{
@@
-342,7
+345,10
@@
static void fghCube( GLdouble dSize, GLboolean useWireMode )
static void fghTetrahedron( GLboolean useWireMode )
{
if (!tetrCached)
static void fghTetrahedron( GLboolean useWireMode )
{
if (!tetrCached)
+ {
fghTetrahedronGenerate();
fghTetrahedronGenerate();
+ tetrCached = TRUE;
+ }
fghDrawGeometry(GL_TRIANGLES,tetr_verts,tetr_norms,TETR_VERT_PER_TETR,useWireMode);
}
fghDrawGeometry(GL_TRIANGLES,tetr_verts,tetr_norms,TETR_VERT_PER_TETR,useWireMode);
}