1 / 15

가자 ! 3D 로 !!! 두번째 강좌

가자 ! 3D 로 !!! 두번째 강좌. 3 강 GPL3D 路 - 하제 - By Gp2k. GPL Pipe line. Camera Transform. World Transform. Fog State. Flipping. Rasterizier. 구성 컴포넌트. CGPL3D 화면의 출력과 프리미티브 들을 다룸 CCAMERA 카메라를 제어함 CGPL3D 에 종속적 CGMLOADER 맥스 익스포팅 파일 로드 (*.gm) 오브젝트 관련 매소드 제공. CGPL3D. Primitives Board

maia
Download Presentation

가자 ! 3D 로 !!! 두번째 강좌

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 가자! 3D로!!!두번째 강좌 3강 GPL3D路 -하제- By Gp2k

  2. GPL Pipe line Camera Transform World Transform Fog State Flipping Rasterizier

  3. 구성 컴포넌트 • CGPL3D • 화면의 출력과 프리미티브 들을 다룸 • CCAMERA • 카메라를 제어함 • CGPL3D에 종속적 • CGMLOADER • 맥스 익스포팅 파일 로드(*.gm) • 오브젝트 관련 매소드 제공

  4. CGPL3D • Primitives • Board • XZ축에 수직으로 서있는 3D 판넬 • 생성 : CreateBlankBoard() • BillBoard • 항상 카메라를 바라보는 3D 판넬 • Board의 일종 • 생성 : CreateAniBillboard(), CreateBillboardFromFile(), CreateBillboardFromTexture() • 출력 : RenderBillboard(), RenderBillboardRot()

  5. CGPL3D • Primitives • Plane • XZ 평면에 수평한 평면 • 생성 : CreateBlankPlane(), CreateAniPlane(), CreatePlane() • 출력 : RenderPlane() • 2D Panel • 3D와 무관하게 2D로 찍는 판넬 • 보통 인터페이스를 만들 때 사용 • 생성 : Create2DPanel…() • 출력 : Render2DPanel()

  6. CGPL3D • Material and Texture • Material • Material의 타입을 설정 • 현재 Default/Light 두 가지 모드만 적용 • SetMaterial() • Texture • 현재 사용될 텍스쳐 파일을 설정 • SetTexture() • Direct 3D Interface • Direct 3D Device • m_pd3dDevice • Texture Output Interface • m_pd3dDevice

  7. CCAMERA • 카메라 이동 • 상대 좌표 이동 • MoveVec() • 절대 좌표 이동 • Movexyz() • 카메라 속성 • Zoom(), GetBillBoardMatrix(), SetDirection(), MoveHeadUpDown() • User Interface • MoveToCenter() • MousePos2XZPlane()

  8. CCAMERA • Visibility • 화면에 보이는지 여부를 판단 • MakeFrust(), IsIn(), IsInSphere() • CGPL3D와 연동 • GetCameraMatrix()를 통해 연결

  9. CGMLOADER • GM파일 만드는 법 • 맥스에서 Export*.ase로 저장 • ASE2GM 으로 변환 • 로딩 • LoadGM(), LoadGM_NoVB() • 렌더링 • Render() • 기타 LOD 구현 및 충돌 체크 등을 추가로 지원할 예정

  10. ALL IN ONE • CGPL3D 초기화 • DX초기화 • Cgpl3d = new CGPL3D(hWnd, 640, 480, TRUE); • Fog Setting • Cgpl3d->SetFog(30.0f, 80.0f, D3DCOLOR_XRGB(0,0,0)); • CCAMERA 초기화 • 스크롤 범위 기반 초기화 • Cam = new CCAMERA(Cgpl3d, D3DXVECTOR3(-100,-100,-100), D3DXVECTOR3(100,100,100)); • 위치 선정 • Cam->Movexyz(0.0f,30.0f,-30.0f); • Cam->SetDirection(D3DXVECTOR3(0.0f, -1.0f, 1.0f));

  11. ALL IN ONE • 객체 생성 • Plane • ground = Cgpl3d->CreatePlane(100,100, makeRectFloat(0.0f, 0.0f, 1.0f, 1.0f), PLANE_CENTER_CENTER, "ground.tga"); • BillBoard • tree = Cgpl3d->CreateBillboardFromFile(15.0f, 15.0f, frect, "cactus.tga"); • GM • CObj = new CGMLOADER(Cgpl3d); • CObj->LoadGM("y1-4.GM");

  12. ALL IN ONE • 출력 • 프레임 고정 • FRAME_LOCK(10); ->한 프레임당 10ms 딜레이 • 카메라와 CGPL3D 바인딩 • Cgpl3d->SetViewMatrix(Cam); • 그리기 시작 • Cgpl3d->BeginDraw(); • 재질 설정 • Cgpl3d->SetMaterial(MATERIAL_DEFAULT);

  13. ALL IN ONE • 출력 • Plane • Cgpl3d->RenderPlane(&ground, D3DXVECTOR3(0.0f, 0.0f, 0.0f), 0); • Billboard • Cgpl3d->RenderBillboard(&tree, TreePosList[i], 0); • GM • CObj->Render(&mat); • 그리기 완료 • Cgpl3d->EndDraw();

  14. Make it real!!! • 관성과 마찰을 적용 • 좀 더 현실적인 Interaction • 부드러운 움직임 • 물체의 자유로운 이동을 위한 Tip • 임의의 각으로 이동 • T = rotY(Θ) • vecPos += T(||vDir||) * velocity • World Transform에서 간단히 Translation을 구현 • Mat_41 = x좌표 • Mat_42 = y좌표 • Mat_43 = z좌표

  15. 정치적 발언 • GPL3D 라이브러리에 대한 문서는 빠른 시일 내에 제공해 드릴 것을 약속드림. • 다음주부터 Fantastc한 게임을 만들어 보아요~ • GPL3D가 lib형태로 바뀌었습니다. • 강력한 Abstraction Barrier로 기술 유출을 방지할 수 있습니다.(할게 있나 -_-;) • 배포하여 라이센스 받읍시다..~~~ 읔…-_-퍽;; • 새로 나온 GPL3D 라이브러리를 받아가셈~~~

More Related