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
e3004ee
..
c6ef084
100644
(file)
--- a/
scene.c
+++ b/
scene.c
@@
-132,6
+132,8
@@
GLfloat angle2 = 30; /* in degrees */
GLfloat near = -10;
\r
GLfloat far = 10;
\r
\r
GLfloat near = -10;
\r
GLfloat far = 10;
\r
\r
+static float zoomFactor = 1.0;
\r
+
\r
/**
\r
* Prints out error message when file cannot be read
\r
* @param fileName Name of file that could not be read
\r
/**
\r
* Prints out error message when file cannot be read
\r
* @param fileName Name of file that could not be read
\r
@@
-491,11
+493,11
@@
void windowReshape(int w, int h) {
glMatrixMode(GL_PROJECTION);
\r
glLoadIdentity();
\r
if (w <= h)
\r
glMatrixMode(GL_PROJECTION);
\r
glLoadIdentity();
\r
if (w <= h)
\r
- glOrtho(
near, far,
near*(GLfloat)h/(GLfloat)w,
\r
- far*(GLfloat)h/(GLfloat)w, near, far);
\r
+ glOrtho(
zoomFactor*near, zoomFactor*far, zoomFactor*
near*(GLfloat)h/(GLfloat)w,
\r
+
zoomFactor*
far*(GLfloat)h/(GLfloat)w, near, far);
\r
else
\r
else
\r
- glOrtho(near*(GLfloat)w/(GLfloat)h,
\r
-
far*(GLfloat)w/(GLfloat)h, near,
far, near, far);
\r
+ glOrtho(
zoomFactor*
near*(GLfloat)w/(GLfloat)h,
\r
+
zoomFactor*far*(GLfloat)w/(GLfloat)h, zoomFactor*near, zoomFactor*
far, near, far);
\r
glMatrixMode(GL_MODELVIEW);
\r
glLoadIdentity();
\r
}
\r
glMatrixMode(GL_MODELVIEW);
\r
glLoadIdentity();
\r
}
\r
UCC
git Repository :: git.ucc.asn.au