14
Sun-Jeong Kim OpenGL Programming (2) 11 th Week, 2008 Computer Graphics 2 Adding the Source Code

OpenGL Programming (2)graphics.hallym.ac.kr/teach/2008/cg/src/15prac.pdf · 2008. 9. 16. · OpenGL Programming (2) 11th Week, 2008 2 Computer Graphics Adding the Source Code. 3 Computer

  • Upload
    others

  • View
    5

  • Download
    0

Embed Size (px)

Citation preview

Page 1: OpenGL Programming (2)graphics.hallym.ac.kr/teach/2008/cg/src/15prac.pdf · 2008. 9. 16. · OpenGL Programming (2) 11th Week, 2008 2 Computer Graphics Adding the Source Code. 3 Computer

Sun-Jeong Kim

OpenGL Programming (2)

11th Week, 2008

Computer Graphics2

Adding the Source Code

Page 2: OpenGL Programming (2)graphics.hallym.ac.kr/teach/2008/cg/src/15prac.pdf · 2008. 9. 16. · OpenGL Programming (2) 11th Week, 2008 2 Computer Graphics Adding the Source Code. 3 Computer

Computer Graphics3

Linking the Library Files

Project PropertiesConfiguration Properties Linker Input

Additional Dependencies: opengl32.lib glu32.libopengl32.lib glu32.lib

Computer Graphics4

실행 결과 – “main1.cpp”

Page 3: OpenGL Programming (2)graphics.hallym.ac.kr/teach/2008/cg/src/15prac.pdf · 2008. 9. 16. · OpenGL Programming (2) 11th Week, 2008 2 Computer Graphics Adding the Source Code. 3 Computer

Computer Graphics5

Drawing Primitives (1)

Computer Graphics6

실행 결과 – Lines

Page 4: OpenGL Programming (2)graphics.hallym.ac.kr/teach/2008/cg/src/15prac.pdf · 2008. 9. 16. · OpenGL Programming (2) 11th Week, 2008 2 Computer Graphics Adding the Source Code. 3 Computer

Computer Graphics7

Drawing Primitives (2)

Computer Graphics8

실행 결과 – Triangles

Page 5: OpenGL Programming (2)graphics.hallym.ac.kr/teach/2008/cg/src/15prac.pdf · 2008. 9. 16. · OpenGL Programming (2) 11th Week, 2008 2 Computer Graphics Adding the Source Code. 3 Computer

Computer Graphics9

Properties of Primitives (1)

Computer Graphics10

실행 결과 – Line’s Property (1)

Page 6: OpenGL Programming (2)graphics.hallym.ac.kr/teach/2008/cg/src/15prac.pdf · 2008. 9. 16. · OpenGL Programming (2) 11th Week, 2008 2 Computer Graphics Adding the Source Code. 3 Computer

Computer Graphics11

Properties of Primitives (2)

Computer Graphics12

실행 결과 – Line’s Property (2)

Page 7: OpenGL Programming (2)graphics.hallym.ac.kr/teach/2008/cg/src/15prac.pdf · 2008. 9. 16. · OpenGL Programming (2) 11th Week, 2008 2 Computer Graphics Adding the Source Code. 3 Computer

Computer Graphics13

연습 문제 (1)

glLineStipple( ) 함수의 입력 파라미터를 조절하여 다양한 모양의 점선을 만들어 보시오.

Computer Graphics14

Properties of Primitives (3)

Page 8: OpenGL Programming (2)graphics.hallym.ac.kr/teach/2008/cg/src/15prac.pdf · 2008. 9. 16. · OpenGL Programming (2) 11th Week, 2008 2 Computer Graphics Adding the Source Code. 3 Computer

Computer Graphics15

실행 결과 – Polygon’s Property (1)

Computer Graphics16

Properties of Primitives (4)

Page 9: OpenGL Programming (2)graphics.hallym.ac.kr/teach/2008/cg/src/15prac.pdf · 2008. 9. 16. · OpenGL Programming (2) 11th Week, 2008 2 Computer Graphics Adding the Source Code. 3 Computer

Computer Graphics17

실행 결과 – Polygon’s Property (2)

Computer Graphics18

Properties of Primitives (5)

Page 10: OpenGL Programming (2)graphics.hallym.ac.kr/teach/2008/cg/src/15prac.pdf · 2008. 9. 16. · OpenGL Programming (2) 11th Week, 2008 2 Computer Graphics Adding the Source Code. 3 Computer

Computer Graphics19

Properties of Primitives (6)

Computer Graphics20

실행 결과 – Polygon’s Property (3)

Page 11: OpenGL Programming (2)graphics.hallym.ac.kr/teach/2008/cg/src/15prac.pdf · 2008. 9. 16. · OpenGL Programming (2) 11th Week, 2008 2 Computer Graphics Adding the Source Code. 3 Computer

Computer Graphics21

연습 문제 (2)

변수 pattern[ ]의 값을 변경하여, 다양한 무늬로다각형 내부를 채색하시오.

Computer Graphics22

Polygons + Lines (1)

Page 12: OpenGL Programming (2)graphics.hallym.ac.kr/teach/2008/cg/src/15prac.pdf · 2008. 9. 16. · OpenGL Programming (2) 11th Week, 2008 2 Computer Graphics Adding the Source Code. 3 Computer

Computer Graphics23

실행 결과 – Polygons + Lines (1)

Computer Graphics24

Polygons + Lines (2)

Page 13: OpenGL Programming (2)graphics.hallym.ac.kr/teach/2008/cg/src/15prac.pdf · 2008. 9. 16. · OpenGL Programming (2) 11th Week, 2008 2 Computer Graphics Adding the Source Code. 3 Computer

Computer Graphics25

Polygons + Lines (3)

Computer Graphics26

실행 결과 – Polygons + Lines (2)

Page 14: OpenGL Programming (2)graphics.hallym.ac.kr/teach/2008/cg/src/15prac.pdf · 2008. 9. 16. · OpenGL Programming (2) 11th Week, 2008 2 Computer Graphics Adding the Source Code. 3 Computer

Computer Graphics27

연습 문제 (3)

지난 주에 구현한 프로그램에, Primitive들의 속성을 추가하시오.

마우스를 이용하여 점의 위치 입력

Points – 크기, 색상 지정

Lines – 너비, 색상, 무늬 지정

Triangles, Rectangles, N-Polygons – 색상, 무늬, 외곽선(무늬 포함) 지정