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
49661b1
..
39ff405
100644
(file)
--- a/
scene.c
+++ b/
scene.c
@@
-308,6
+308,9
@@
void motion(int x, int y) {
// w: left/right, h: near/far
\r
//so.x, so.y, so.z
\r
//sceneObjs[curObject].x += (x - startx)*leftrightFactor;
\r
// w: left/right, h: near/far
\r
//so.x, so.y, so.z
\r
//sceneObjs[curObject].x += (x - startx)*leftrightFactor;
\r
+
\r
+ sceneObjs[curObject].x += (x - startx) * sin(90 - camAngle*camAngleFactor);
\r
+ sceneObjs[curObject].z += (x - startx) * cos(90 - camAngle*camAngleFactor);
\r
} else if ( buttonSelected == GLUT_MIDDLE_BUTTON ) {
\r
// w: big/small
\r
float diff = (x - startx);
\r
} else if ( buttonSelected == GLUT_MIDDLE_BUTTON ) {
\r
// w: big/small
\r
float diff = (x - startx);
\r
@@
-375,7
+378,7
@@
void display() {
0.0, 10.0, 0.0 /* up is in postivie Y direction */
\r
);
\r
\r
0.0, 10.0, 0.0 /* up is in postivie Y direction */
\r
);
\r
\r
- glRotatef(camAngle*camAngleFactor, 1.0, 0.0, 0.0);
\r
+ glRotatef(camAngle*camAngleFactor, 1.0, 0.0, 0.0);
// Set camera angle upward
\r
\r
/* Reposition the light source 0. */
\r
lightPosition0[0] = 12*cos(lightAngle0);
\r
\r
/* Reposition the light source 0. */
\r
lightPosition0[0] = 12*cos(lightAngle0);
\r
UCC
git Repository :: git.ucc.asn.au