git.ucc.asn.au
/
atyndall
/
cits2231.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4bce415
)
(no commit message)
author
Ash Tyndall
<
[email protected]
>
Tue, 18 Oct 2011 12:48:49 +0000
(20:48 +0800)
committer
Ash Tyndall
<
[email protected]
>
Tue, 18 Oct 2011 12:48:49 +0000
(20:48 +0800)
scene.c
patch
|
blob
|
history
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