git.ucc.asn.au
/
atyndall
/
cits2231.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
(no commit message)
[atyndall/cits2231.git]
/
scene.c
diff --git
a/scene.c
b/scene.c
index
8101ddb
..
1654527
100644
(file)
--- a/
scene.c
+++ b/
scene.c
@@
-255,8
+255,14
@@
void keyboard(unsigned char key, int x, int y) {
case 'e':
\r
camy = camy - 1;
\r
break;
\r
case 'e':
\r
camy = camy - 1;
\r
break;
\r
+ case 'z':
\r
+ rot = rot + 1;
\r
+ break;
\r
+ case 'x':
\r
+ rot = rot - 1;
\r
+ break;
\r
}
\r
}
\r
- printf("Camera is now at (%f, %f, %f)
\n", camx, camy, camz
);
\r
+ printf("Camera is now at (%f, %f, %f)
, angle %f\n", camx, camy, camz, rot
);
\r
glutPostRedisplay();
\r
}
\r
\r
glutPostRedisplay();
\r
}
\r
\r
@@
-289,7
+295,7
@@
void display() {
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
\r
glLoadIdentity();
\r
gluLookAt(
\r
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
\r
glLoadIdentity();
\r
gluLookAt(
\r
-
0.0, 1
0.0, 100.0, /* eye is at (x,y,z) */
\r
+
100.0, 10
0.0, 100.0, /* eye is at (x,y,z) */
\r
0.0, 0.0, 0.0, /* center is at (x,y,z) */
\r
0.0, 1.0, 0.0 /* up is in postivie Y direction */
\r
);
\r
0.0, 0.0, 0.0, /* center is at (x,y,z) */
\r
0.0, 1.0, 0.0 /* up is in postivie Y direction */
\r
);
\r
@@
-298,7
+304,7
@@
void display() {
\r
// **NOTE: Currently this rotation function is all that moves the camera off
\r
// the flat surface. Need to integrate function into gluLookAt
\r
\r
// **NOTE: Currently this rotation function is all that moves the camera off
\r
// the flat surface. Need to integrate function into gluLookAt
\r
-
//glRotatef(30.0
, 1.0, 0.0, 0.0);
\r
+
glRotatef(rot
, 1.0, 0.0, 0.0);
\r
\r
/* Reposition the light source. */
\r
lightPosition[0] = 12*cos(lightAngle);
\r
\r
/* Reposition the light source. */
\r
lightPosition[0] = 12*cos(lightAngle);
\r
UCC
git Repository :: git.ucc.asn.au