소개글
컴퓨터그래픽스 OpenGL 여러가지 소스 주석처리 및 변경
목차
1. Bitmap Raster for Text 비트맵 텍스트 문자 변형
2. alpha3D, alpha, model 실행 결과 확인
3. 각각의 프로그램 소스 분석
4. 각각의 결과를 변형
5. 참 조
본문내용
1. Bitmap Raster for Text 비트맵 텍스트 문자 변형
#include <GL/glut.h>
#include <stdlib.h>
GLubyte rasters[24] = {
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0,
0x00, 0xc0, 0x00, 0xff, 0x00, 0xff, 값 변형 < 변형 결과 >
0x00, 0xc0, 0x00, 0xc0, 0x00, 0xc0,
0x00, 0xff, 0xff, 0xff, 0xff};
void init(void)
{
glPixelStorei (GL_UNPACK_ALIGNMENT, 1);
glClearColor (0.0, 0.0, 0.0, 0.0);
}
void display(void)
{
glClear(GL_COLOR_BUFFER_BIT);
glColor3f (1.0, 1.0, 1.0);
glRasterPos2i (20, 20);
glBitmap (10, 12, 0.0, 0.0, 11.0, 0.0, rasters);
glBitmap (10, 12, 0.0, 0.0, 11.0, 0.0, rasters);
glBitmap (10, 12, 0.0, 0.0, 11.0, 0.0, rasters);
glFlush();
}
void reshape(int w, int h)
{
glViewport(0, 0, (GLsizei) w, (GLsizei) h);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho (0, w, 0, h, -1.0, 1.0);
glMatrixMode(GL_MODELVIEW);
}
참고 자료
없음