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
78ac064
..
d6b3e8f
100644
(file)
--- a/
scene.c
+++ b/
scene.c
@@
-124,7
+124,7
@@
GLfloat angle2 = 30; /* in degrees */
\r
/* Near and far parameters */
\r
GLfloat near = -10;
\r
\r
/* Near and far parameters */
\r
GLfloat near = -10;
\r
-GLfloat far =
5
0;
\r
+GLfloat far =
1
0;
\r
\r
/* Zoom factor for mouse movements */
\r
GLfloat zoomFactor = 1.0;
\r
\r
/* Zoom factor for mouse movements */
\r
GLfloat zoomFactor = 1.0;
\r
@@
-611,14
+611,15
@@
void drawFloor() {
* Draw x, z axis on floor
\r
*/
\r
void drawLine() {
\r
* Draw x, z axis on floor
\r
*/
\r
void drawLine() {
\r
+ // **NOTE: fix function
\r
glDisable(GL_TEXTURE_2D);
\r
glEnable(GL_BLEND);
\r
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
\r
glDisable(GL_TEXTURE_2D);
\r
glEnable(GL_BLEND);
\r
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
\r
- glColor4ub( 0.0, 0.0, 0.0, 0.
0
);
\r
+ glColor4ub( 0.0, 0.0, 0.0, 0.
5
);
\r
\r
glBegin(GL_LINES);
\r
\r
glBegin(GL_LINES);
\r
- glVertex3i( 10.0, 0
,
0.0);
\r
- glVertex3i( -10.0, 0
,
0.0);
\r
+ glVertex3i( 10.0, 0
.1, 1
0.0);
\r
+ glVertex3i( -10.0, 0
.1, -1
0.0);
\r
glEnd();
\r
\r
glDisable(GL_BLEND);
\r
glEnd();
\r
\r
glDisable(GL_BLEND);
\r
@@
-636,6
+637,12
@@
void display() {
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
+ glEnable(GL_LIGHT0);
\r
+ glLightfv(GL_LIGHT0, GL_POSITION, light0_pos);
\r
+ glLightfv(GL_LIGHT0, GL_AMBIENT, ambient0);
\r
+ glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse0);
\r
+ glLightfv(GL_LIGHT0, GL_SPECULAR, specular0);
\r
+ glEnable(GL_LIGHTING);
\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
\r
// **NOTE: Currently this rotation function is all that moves the camera off
\r
// the flat surface. Need to integrate function into gluLookAt
\r
UCC
git Repository :: git.ucc.asn.au