OPengl로 로봇암(ROBOT ARM) 구현 (모델링)
- 최초 등록일
- 2010.12.16
- 최종 저작일
- 2010.12
- 11페이지/ 한컴오피스
- 가격 1,000원
목차
1. 문제제기
2. 문제분석 및 소스
3. 실행화면
4. 느낀점
본문내용
엄마 로봇 모델링
Wireframe model
계층구조 모델링
주어진 회전각 에 따라 각 부품그리기
계층구조 모델링 (Hierachical modeling)
부품의 dependency: 애니메이션의 경우 움직임의 기준을 고려
(또는, 부품의 포함관계)
<중 략>
모델링 순서
1. 원점 좌표
2. Base 회전각에 따라 좌표계 설정
3. Base 그리기
4. Lower arm 을 그리기 위해 좌표계 설정(Base 윗면으로 이동, Lower arm 회전각으로 회전…)
5. Lower arm 그리기
6. Upper arm 을 그리기 위해 좌표계 설정
7. Upper arm 그리기
<중 략>
#include <windows.h>
#include <gl.h>
#include <glu.h>
#include <glut.h>
#include <math.h>
// 헤더파일
int speed = 1.0; // 스피드 변수
static float thetaBase;
static float thetaLower;
static float thetaUpper;
static bool leftMode;
static bool rightMode;
static bool downMode;
static bool upMode;
static bool homeMode;
static bool endMode;
GLUquadricObj *p;
void Base(void)
{
glPushMatrix(); // 메트릭스 푸쉬
glColor3f(1.0, 0.7, 0.0); // 컬러값
glTranslatef(0, -1.0, 0); // 이동
glRotatef(-90, 1, 0, 0); // 회전
glRotatef(thetaBase, 0, 0, 1);
gluCylinder(p, 0.5, 0.5, 0.3, 20, 1);
glPopMatrix(); // 메트릭스 팝
}
참고 자료
없음