1 / 8

10/8 ~ 10/24

10/8 ~ 10/24. 최순용. FLTK. FLTK 는 쉽게 window 생성 및 OpenGL 을 사용할 수 있게 만들어진 GUI Toolkit GPL license MyWindow.h , MyWindow.cpp 에서 FLTK 라이브러리를 사용해서 window 생성 , rendering 등을 하는 MyWindow class 작성. - MyWindow.h 일부 - … #include <Fl/Fl_Gl_Window.h> #include "Ship.h"

regina
Télécharger la présentation

10/8 ~ 10/24

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. 10/8 ~ 10/24 최순용

  2. FLTK • FLTK는 쉽게 window생성 및 OpenGL을 사용할 수 있게 만들어진 GUI Toolkit • GPL license • MyWindow.h , MyWindow.cpp에서 FLTK라이브러리를 사용해서 window생성, rendering등을 하는 MyWindow class 작성

  3. - MyWindow.h 일부 - … #include <Fl/Fl_Gl_Window.h> #include "Ship.h" class MyWindow : public Fl_Gl_Window { public: float rotation; float rotationIncrement; bool animating; Ship * boat; public: // Constructor and destructor MyWindow(int width, int height, char* title); virtual ~MyWindow(void); // Initialize the GL operation which is set up necessary operation void InitializeGL(void); // Overwrite the draw operation in Fl_Gl_Window virtual void draw(void); // Function to draw a cube void DrawCube(void); virtual int handle(int event); }; …

  4. *.Obj 파일 • 3D 오브젝트의 vertex, normal, texture coordinate정보와 한 face를 이루고 있는 vertex의 집합정보를 가지고 있다. • Obj 파일 내용 v x y z vn x y z vt x y f v/vt/vn v/vt/vn v/vt/vn

  5. - boat.obj 일부 - … v -2.41346 0.274552 5.27829 v -2.36675 -0.012347 5.28305 v -2.3834 0.274552 5.49626 vt 0.685692 0.49269 vt 0.686872 0.507775 vt 0.688578 0.492912 vn -0.978009 -0.171867 0.11815 vn -0.979463 -0.157386 0.126025 vn -0.978327 -0.157058 0.13494 f 1/1/1 2/2/2 3/3/3 …

  6. Load .obj • <fstream> • ifstream::open, good, getline, close

  7. Load .obj • Count number of vertex, normal, texture, face • Allocate array vertex, normal, texture, face. (Size : number of xxx) • Open file .obj -> sscanf(buffer, “format”, array …)

  8. 문제점 및 고민 • boat.obj를 가져왔기 때문에 파일 구조에 대해서 완벽하게 파악하기 어려움 • 배 class에 포함될 범주 정하기 • 기타 여러 .obj파일을 모델링하고 생성해야할 것 • 환경 텍스쳐 Mapping 기법 알아보기

More Related