"Don't tell me how hard you work. Tell me how you get done."
- James J. Ling

Rotation practice in OpenGL

August 29, 2006

Someone guess what this code do…:)  This is an OpenGL code in C++

 

#include <GL/glut.h>

void event_display (void)
{
    glClear(GL_COLOR_BUFFER_BIT);

 glColor3f(1.0, 1.0, 0.0);
 glRotatef(45.0, 0.0, 0.0, 1.0);
 glRotatef(-45.0, 0.0, 1.0, 0.0);
 glRotatef(90.0, 1.0, 0.0, 0.0);
 glRotatef(45.0, 0.0, 1.0, 0.0);
 glRotatef(-45.0, 0.0, 0.0, 1.0);
 
 glutWireCube(.5);

 glColor3f(1.0, 1.0, 1.0);
    glBegin(GL_LINES);
  glVertex3f(0.0, 0.0, 0.0);
        glVertex3f(1.0, 1.0, 1.0);
    glEnd();

   
 glFlush();
}

 

void init (void)
{
    glClearColor(0.0, 0.0, 0.0, 0.0);

}

void main(int argc, char** argv)
{
    glutInit(&argc, argv);
    glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB);
    glutInitWindowSize(300, 300);
    glutInitWindowPosition(0, 0);
    glutCreateWindow(argv[0]);

    init();

    glutDisplayFunc(event_display);
    glutMainLoop();
}

Posted by phengpheng at 7:56 am | permalink

Previous Comments

opengl girl ste di miyo! :D

Posted by niel at August 29, 2006, 8:38 pm

hehe…once lang gane yo yan OpenGL…:)

Posted by phengpheng at August 30, 2006, 8:59 pm

pyOpengl for OPenGl programmers… hehe
http://pyopengl.sourceforge.net/documentation/opengl_diffs.html…

Posted by jay at August 31, 2006, 9:00 am

All comments are moderated. Your comments will not appear here unless approved by the blog owner. Thank you.

Add a comment








     

August 2006
M T W T F S S
« Jul   Sep »
 123456
78910111213
14151617181920
21222324252627
28293031  

About Me

A Computer Science graduate who is a fanatic in assembly, java, and j2me programming. Developed BlueVoice system (Direct Voice Communication in Mobile Phones), this system allows mobile users to experience FREE VOICE CALLS

Subscribe

Technorati
Bloglines

Tagboard

tinnitus treatment:

thanks You sure do know what your’e talking about. Man, this blog is just great! I cant wait to read more of what youv’e got to say. Im really happy that I came across this when I did because I was really starting

phengpheng:

Haven’t managed my blog for a long time already because I’m so busy now… Sorry to cause you guyz trouble…

Jun Mark:

hoW tO creaTE a PrOGram thAT woULD oUTpuT ascii table???

Jun Mark:

pLZ anSwer mY qUEstions

cutieGurl:

how to convert binary to hexadecimal, decimal and octal?????????please. answer me??????????

mary ann:

kuya, ung binary to decimal converter nyo. mali man? ung sa mga compare mo. ung may 0,9,A,F etc… bad character lumalabaspls rep asap po. tnx

carol:

how to convert decimal to binary to octal and hexadecimal

Galwin:

been here!

galwin:

nice site. hope you could visit mine, too.

pathy:

FRIENDS FOREVER!! Miss you na!!!

ridvan:

aus, i seldom see lady programmers. hehe. keep it up. and oh yeah, i guess i saw you during the MICT Quiz Show held in cdo. :)
keep up the codes!

phengpheng:

I miss updating this blog… Sana may time and pc ako to learn new stuffs aside from my work…

support:

Congratulations, you’ve just completed the installation of this shoutbox.

pheng:

uy! you’re here again!

Jay:

Woooohhhh orange…sweat… nakakasilaw! hehe :)

jay:

tagboard flood hehe sensya… had nothing fun to do. :)

pheng:

jaaaaayyyyy….:) ketal man?:)

niel:

no spamming please :p hehehe joke lang jay.

Jay:

Uyyyyyy!!!! Grraaaaaaaiiiinnnneeee
:)
Sssshhhh, el sikret! :)
Niiiiiiiiiiiiieeeeeel
Sup dude!!!!
Paaaaaaaaaaaaaathy
Ketal!?

niel:

ei pheng! :D slick-elegant layout! love it!

Leave a message ▼