Thursday, December 13, 2007
Week 8
Week 7
GLfloat angle = 0.0f;
GLfloat width = 40.0f;
GLfloat height = 30.0f;
double x = 0, y = 0;
void init(void)
{
GLfloat ambient[] = { 0.0, 0.0, 0.0, 1.0 };
GLfloat diffuse[] = { 1.0, 1.0, 1.0, 1.0 };
GLfloat specular[] = { 1.0, 1.0, 1.0, 1.0 };
GLfloat position[] = { 0.0, 3.0, 2.0, 0.0 };
GLfloat lmodel_ambient[] = { 0.4, 0.4, 0.4, 1.0 };
glClearColor(0.0, 0.1, 0.1, 0.0);
//Enable Depth test
glShadeModel(GL_SMOOTH);
glLightfv(GL_LIGHT0, GL_AMBIENT, ambient);
glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse);
glLightfv(GL_LIGHT0, GL_POSITION, position);
glLightModelfv(GL_LIGHT_MODEL_AMBIENT, lmodel_ambient);
glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, GL_TRUE);
glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0);
}
void DrawCylinder()
{
GLUquadricObj *Cylinder;
GLUquadricObj *Disk;
Cylinder = gluNewQuadric();
Disk = gluNewQuadric();
glColor3f(1,0,0);
gluCylinder(Cylinder,15,15,40,32,32);
glColor3f(0,1,0);
gluDisk(Disk,0.5,1.5,32,32);
gluQuadricDrawStyle(Cylinder, GLU_FILL);
}
void MyDisplay()
{
GLfloat mat_diffuse[] = { 0.2, 0.5, 1, 1.0 };
GLfloat mat_specular[] = { 0.8, 1.0, 1.0, 1.0 };
GLfloat low_shininess[] = { 2.0 };
glEnable(GL_DEPTH);
glClear(GL_COLOR_BUFFER_BIT GL_DEPTH_BUFFER_BIT);
glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse);
glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular);
glMaterialfv(GL_FRONT, GL_SHININESS, low_shininess);
glPopMatrix();
//Lines
glBegin(GL_LINES);
glVertex3f(0,0,0);
glVertex3f(50,0,0);
glEnd();
glBegin(GL_LINES);
glVertex3f(0,0,0);
glVertex3f(0,50,0);
glEnd();
glBegin(GL_LINES);
glVertex3f(0,0,0);
glVertex3f(0,0,50);
glEnd();
//End of lines
glPushMatrix();
glTranslatef(::x,::y,0);
DrawCylinder();
glutSwapBuffers();
}
void Rescale(GLsizei w, GLsizei h)
{
glViewport(0,0,w,h);
}
void Keyboard(unsigned char key, int x, int y)
{
switch(key)
{
case 'd':
::x+=10;
break;
case 'a':
::x-=10;
break;
case 'w':
::y+=10;
break;
case 's':
::y-=10;
break;
}
glutPostRedisplay();
}
void SetupRC()
{
GLfloat final = width / height;
gluPerspective(60, final, 0, 1000);
gluLookAt(90,90,90,0,1,0,0,1,0);
glFlush();
glPushMatrix();
}
void main(int argc, char **argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DOUBLE GLUT_RGB GLUT_DEPTH);
glutInitWindowSize(800, 600);
glutCreateWindow("My Pratical 7");
glutDisplayFunc(MyDisplay);
init();
glutReshapeFunc(Rescale);
glutKeyboardFunc(Keyboard);
SetupRC();
glutMainLoop();
}
Thursday, November 29, 2007
Week 6
Week 5
Week 4
Sunday, November 25, 2007
Thursday, November 1, 2007
Week 2
UML and more UML. The diagrams were quite simple really... just some arrows here and there. Wonder how some people can't draw them. The lecture was understandable as Mister Tan explained the parts well. Hahaha. Then it was Product and Project Management was alright. The part-time lectuerer talks like one of my friends. I understood most of his lesson and found the contents rather interesting for example, he was talking about his company and his personal experience and stuff... short but really good information to know.
Maths tutorial was fun as always. Miss Soh is still great as a Mathematics teacher. (:
What she taught, I always understood so no problems here.
9a.m to 6p.m of C++ is really a killer.
First off was Computer Graphics lecture... frankly I didn't really pay total attention. Just caught some parts of it. But I know it's something like a recap of last year's DES monitor explanation thingy. Next was Mr Ng with a Advanced C++ lecture which was mysteriously "not as boring" as I expected. Hahaha. No offence. :x
An hour of break and back to the computer for practical. I'm actually very pleased with how the school set up the schedule in which the lecture was right before the lab session. Helps with the memorising of the lecture contents. As usual, did most of it myself.
2 hour break interval... DSA lecture. SLEEPY. Well, kept awake by the cold anyways. Good explanation on pointers too by Mr Low. Made me understand it better.
Thursday, October 18, 2007
Practical 1
Part 2: Mathematics I Recap
- Algebra
- Quadratic equations
- Vectors
- Matrices
- LOL
I understood matrices more than vectors. Vectors I was a little confused here and there, but could cope with it. Overall, I found Maths 1 easy if I had followed the lessons... but did not. :P
Part 3: Review of a Computer Game
Title of Game: GTA: San Andreas <3
Platform of Game: Playstation 2
Genre of Game: Action/Adventure: Modern
Developer: Rockstar North
Product Model Year: 2004
Game Requirements: =.=
Description of Game:
Gameplay:
The gameplay of this game was one of the largest factors why GTA: San Andreas was a big hit, especially with their diehard fans of their great series. GTA: San Andreas offered control of their main antagonist, Carl Johnson, otherwise better known as CJ. With Johnson, you can do a buttload of stuff throughout the game! Shooting innocent cops along the street, getting involved in fierce gun fights, and even working out in the gym. There are stats to max out, totalling to at least a hundred hours of game time spent to enjoy the game fully. Typical side-missions, mini-games and many others lead to an even larger amount of things added to your to-do list. As if the main storyline wasn't enough! :P
Graphics:
The graphics in this game compared to what producers offer now, three years later, are not that great already. Although that few years back, the graphics offered by this game were considered one of the hottest... competable even with the great Final Fantasy series, known for their extremely realistic graphics. Looking at the crazy size of this game, graphics were actually not expected to be good. In fact, many were anticipating worser graphics than the previous series, GTA: Vice City. But, Rockstar North managed to come out stronger, stunning critics and fans alike with their graphics.
Sound:
The sound of this game is amazing... totally alluring in fact! Turn on da music in vehicles and you can listen to radio stations ranging from gangster rap, country music to hip-hop. The voice actors were great, getting in the accents of african-americans and those living in the ghetto. On the streets, you can hear cars zooming past you, or even an aeroplane above, crossing the borders.
Conclusion:
GTA: San Andreas over the span of 3 years have not yet lost its spark among gamers, with buyers still searching for the game on the shelves. The game is superb, like the diaries of CJ, you live it out for him, decide whatever he does, whenever he does. Don't rent it, BUY IT!