Wednesday, October 31, 2007

3rd week of my lab

Today what was taught was how to draw simple shape through coding.

For example to draw a triangle you have to type
glBegin(GL_TRIANGLES);
glVertex3f(0.5f, 0.5f, 0.0f);
glVertex3f(1.0f, 1.0f, 0.0f);
glVertex3f(0.75f,0.5f, 0.0f);
glEnd( );

into the void myDisplay(void) function.

The same goes for quadilaterals but as they have 4 points an additonal

glVertex3f(x.xf,y.yf, 0.0f); is needed

eg
glBegin(GL_QUADS);
glVertex3f(-0.5,-0.5,0);
glVertex3f(0.5,-0.5,0);
glVertex3f(0.5,0.5,0);
glVertex3f(-0.5,0.5,0);
glEnd( );

Also by placing a glColor3f(0.0,0.0f,1.0f); infront of a glBegin(GL_(your shape))

will give you a desired colour with 1 being the strongest i think.

This glColor gives a blue colour.

Now on the show pictures of what was done:
Triangle

2nd week of my lab

On this week I have learnt how to actually draw something onto the computer screen. Also some new abbreviation like CLUT(Colour Look Up Table). I also have discovered the reason for a callback function and its uses over other conventional method.

Here's a sample code of what I did:

void MeltDown()
{
static int lines[800];
for(int i=0;i<800;i++) 10="="0)">600)
lines[i]=0;
}
for(int j=0;j=100&&j<=200) { PlotPixel(i,599-j,0,255,255); } else if(j>200&&j<=300) { PlotPixel(i,599-j,0,255,0); } else if(j>300&&j<=400) { PlotPixel(i,599-j,255,255,0); } else if(j>400&&j<=500) { PlotPixel(i,599-j,255,0,0); } } } }

This is how it looks like

Wednesday, October 17, 2007

Game review


Game title: Warhawk

Game platform: Playstation 3(PS3)

Game genre: Sci-Fi Shooter

Developer: Incognito

Product Model Year: 2007

Game requirements: NIL

Game description: Warhawk is an online game played on the PS3 which allows you to play with up to 31 players. Warhawk also feature 3 different types of gameplay: zones, CTF(Capture The Flag) , DM(DeathMatch) or TDM(Team DeathMatch) and Dogfight where you fight against other player in aircraft and only aircraft.

Game play: The gameplay is mostly like Battlefield series where you have to work as a team to capture certain zones in order to acheive victory. You can either go on foot, ride a vehicle such as a tank or hop into an aircraft and blast the daylights out of your enemies.

Graphics: The graphic are quite nice , smooth and the aircraft and vehicles look quite real to me that is. Have a look at it yourself.

Sound: As for sound, it is quite an important aspect in the game. An example would be that when you are in an aircraft, a buzzing sound will mean that there are homing missles locked on to your aircraft and you will have to take measures to avoid them.

Conculsion: Warhawk is quite a nice game to play and the fun multiplies when you have friends playing together with you online or on the same PS3 console.

Intro and Maths

Yo,
This is my first time blogging, the reason for this is because I am required to do so by my course module.
In this first week's practical, I am supposed to set up a website and maintain it (which is what i am doing now in fact)
Next, I have to post on my website a breif review of my maths and the review of a computer game of my choice.

This week the only lab session I have gone to is the Advanced C++ on tuesday. That session was mostly on recap on the C++ I learnt on the previous semester. An example would be that I had to write a program that shows the abbreivation of the shortform entered by the user.
Eg,
if(state==NCstate==ncstate==nCstate==Nc)
{
cout<<"NC stands for North Carolina.\n";
}
Now on to maths..

Vectors
On vectors, I can mostly understand the questions and how to do. However when the vectors come into the 3d zone I begin to have a little problem on understanding them.

Matrix
On matrix, the only parts I have problems with is finding the determinent of 3x3 matrix and above.

Indices
Not much problems with indices at all

Will there also be dfifferenciation ,intergration and the use of logarithem in CG?
I wonder..