Contents

조회 수 8758 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
#include<GL/glut.h>

void myinit(void);
void display(void);

void main(int argc, char **argv)
{
        glutInit(&argc, argv);
        glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
        glutInitWindowSize(500, 500);
        glutInitWindowPosition(0, 0);
        glutCreateWindow("Simple OpenGL example");
        glutDisplayFunc(display);
        myinit();
        glutMainLoop();
}

void myinit(void)
{
        glClearColor(1.0, 1.0, 1.0, 0.0);
        glColor3f(1.0, 0.0, 0.0);

        glMatrixMode(GL_PROJECTION);
        glLoadIdentity();
        gluOrtho2D(0.0, 500.0, 0.0, 500.0);
        glMatrixMode(GL_MODELVIEW);
}

void display(void)
{
        typedef GLfloat point2[2];

        point2 vertices[3] = { {0.0, 0.0}, {250.0, 500.0}, {500.0, 0.0} };

        int i, j, k;
        int rand();
        point2 p = {75.0, 50.0};
        glClear(GL_COLOR_BUFFER_BIT);

        for(k=0; k<500; k++)
        {
                j = (rand()) % 3;

                p[0] = (p[0]+vertices[j][0])/2.0;
                p[1] = (p[1]+vertices[j][1])/2.0;

                glBegin(GL_POINTS);
                glVertex2fv(p);
                glEnd();
        }

        glFlush();
}


?

  1. [linux] ipchains 사용예(패킷 필터링)

    Date2003.04.23 CategorySystem/OS Byhooni Views14181
    Read More
  2. [linux] ipfwadm를 이용한 패킷필터링(구버전)

    Date2003.04.23 CategorySystem/OS Byhooni Views13025
    Read More
  3. [windows] 98/ME 속도 빠르게 튜닝(부팅,메모리,레지스터)

    Date2003.04.23 CategorySystem/OS Byhooni Views50452
    Read More
  4. [windows] 도스 사용 팁

    Date2003.04.23 CategorySystem/OS Byhooni Views17817
    Read More
  5. [windows] 여러가지 활용 팁

    Date2003.04.23 CategorySystem/OS Byhooni Views19979
    Read More
  6. [windows] 배치(bat)파일 제작 방법

    Date2003.04.23 CategorySystem/OS Byhooni Views17012
    Read More
  7. [linux] 패킷 스니퍼링

    Date2003.04.23 CategorySystem/OS Byhooni Views16325
    Read More
  8. [linux] 패킷의 소스 주소 바꾸기

    Date2003.04.23 CategorySystem/OS Byhooni Views18794
    Read More
  9. [linux] iptables 명령어 매뉴얼(options)

    Date2003.04.23 CategorySystem/OS Byhooni Views11344
    Read More
  10. [linux] 간단한 NAT 설정 script

    Date2003.04.23 CategorySystem/OS Byhooni Views12608
    Read More
  11. [linux] 랜카드 2개 설정 & iptables 로 사설 ip..

    Date2003.04.23 CategorySystem/OS Byhooni Views14743
    Read More
  12. [linux] apache, php, jsp 환경설정하기..

    Date2003.04.23 CategorySystem/OS Byhooni Views15246
    Read More
Board Pagination Prev 1 ... 4 5 6 7 8 9 10 11 12 13 ... 98 Next
/ 98