[그래픽] [OpenGL] opengl 움직이는 큐브만들기 소스
페이지 정보
작성일 21-10-05 17:26본문
Download : cube.rtf
주석과 설명 자세히
//0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,17,18,19,20,21,22,23
void RotateY1Positive()
HINSTANCE hInstance; // Holds The Instance Of The Application
BOOL active=TRUE; // Window Active Flag Set To ㅁTRUE By Default
int znegative[24] = {16,17,18,19, 7, 4, 5, 6,20,23,22,21,15,12,13,14, 8,11,10, 9, 0, 1, 2, 3}; // 시계방향
int prevX, prevY;
설명
GLfloat xrot = 15.0f, yrot = 60.0f;
HDC hDC=NULL; // Private GDI Device Context
int temp[27];
그래픽스 시간에 만든 OpenGL을 이용한 프로그램 소스입니다 visual c++ 이나 프로그램에 소스만 붙여서 바로 실행가능하고 이쁘고 깔끔한 마우스로 움직이는 큐브 소스입니다. 주석과 설명 자세히 달아져 있습니다
HGLRC hRC=NULL; // Permanent Rendering Context
int zpositive[24] = {20,21,22,23, 5, 6, 7, 4,16,19,18,17,13,14,15,12, 0, 1, 2, 3, 8,11,10, 9}; // 반시계방향
달아져 있습니다
GLfloat zr1 = 0.0f, zr2 = 0.0f, zr3 = 0.0f;
그래픽스 시간에 만든 OpenGL을 이용한 호로그램 소스입니다
BOOL fullscreen=TRUE; // Fullscreen Flag Set To Fullscreen Mode By Default
int xnegative[24] = {13,12,15,14, 1, 2, 3, 0, 5, 4, 7, 6, 9,10,11, 8,19,16,17,18,21,22,23,20}; // 위로 회전
//회전 방향에 따른 상태變化(변화)표
opengl, cube, opengl cube, 그래픽스, 큐브
#include
block[ 0] = ypositive[temp[18]];
GLfloat yr1 = 0.0f, yr2 = 0.0f, yr3 = 0.0f;
GLuint box; // Storage For The Box Display List
#include // Header File For Windows
BOOL LButtonPressed=FALSE;
다.
int ynegative[24] = { 3, 0, 1, 2,20,21,22,23,11, 8, 9,10,16,19,18,17, 6, 7, 4, 5,14,13,12,15}; // 오른쪽으로 회전
int ypositive[24] = { 1, 2, 3, 0,18,19,16,17, 9,10,11, 8,22,21,20,23,12,15,14,13, 4, 5, 6, 7}; // 왼쪽으로 회전
Download : cube.rtf( 33 )
[그래픽] [OpenGL] opengl 움직이는 큐브만들기 소스
// 문자 출력 기능 뺌 (소스엔 구현)
int xpositive[24] = { 7, 4, 5, 6, 9, 8,11,10,15,12,13,14, 1, 0, 3, 2,17,18,19,16,23,20,21,22}; // 아래로 회전
BOOL keys[256]; // Array Used For The Keyboard Routine
BOOL RButtonPressed=FALSE;
레포트 > 공학,기술계열
순서
#include // Header File For The GLu32 Library
visual c++ 이나 호로그램에 소스만 붙여서 바로 실행가능하고
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); // Declaration For WndProc
GLfloat xr1 = 0.0f, xr2 = 0.0f, xr3 = 0.0f;
memcpy(temp, block, 27*sizeof(int) ); // block을 temp로 복사(27*sizeof(int) 크기)
{
#include // Header File For The OpenGL32 Library
HWND hWnd=NULL; // Holds Our Window Handle
#include // Header File For The Glaux Library
int block[27];
이쁘고 깔끔한 마우스로 움직이는 큐브 소스입니다.