Computer Graphics

 

 

Syllabus

期末成績(公告三天,將於本星期五送出成績。目前可以修訂的僅有期末考,可至助教處(4208, 翁助教)看是否有更改錯誤,其餘分數不會改變)

 

學生期末作品:

project 2

Solution for Project 2

project 3

    PIL Handbook

Solution for Project 3

project 4

第七組 蘇育萱、方思婷作品    Powerpoint,  Program

第九祖  張晉瑋、黃振綱、徐誌偉 Report, (下載後需使用adobe flash player播放), Program

Solution for Project 4

project 5

Solution for Project 5

週數 Course Notes Python Notes Python Program Assignment

9/9

Application of Computer Graphics

Syllabus in Purdue CS177, 2013 by Prof. Hoffmann

 

1. Computer Graphics Programming: Computer Science, Algorithm, Memory Size, Python basic

 

 

How to install Python. by 江清水

Problem Assignment 1 by 江清水

 

如何看Problem Assignment的Solution by 江清水

Solution for Problem Assignment 1 by 江清水

 

 

HW: 定義函數F2C(f)將華氏溫度f換算成攝氏溫度。

9/16

 

2. Input, Variables, Assignment, Expression, Output, Python Type

 

project 1 from Purdue University (Exercise for students)

 

Problem Assignment 2 by 江清水

Solution for Problem Assignment 2 by 江清水

 

9/23

 

3. Local/global variables, function, parameters, Precedence

 

4. Boolean, While, If .. Else

Problem Assignment 3 by 江清水 (posted on Sep. 23, 2:10Pm)

Solution Assignment 3 by 江清水(還有部分題目未解,上課講解有同學解出後將公告正確答案)

HW: 計算兩正整數的GCD

9/30

  5. List, for, String, Sequence project 2 from Purdue University

Problem Assignment 4 by 江清水 (posted on Sep. 23, 2:10Pm)

Solution Assignment 4 by 江清水(還有部分題目未解,上課講解有同學解出後將公告正確答案)

10/7

  recursive functions

Problem Assignment 5 by 江清水 (posted on Oct. 7, 2:10Pm)

Solution Assignment 5 by 江清水

project 3 from Purdue University

project 4 from Purdue University

10/14

2D Coordinate Geometry. [PPT][Word] by 江清水 6. Library
Problem Assignment 6: 向量內積、轉至矩陣、矩陣相乘 by 江清水

Solution for Assignment 6 by 江清水

分組學期報告定案

project 5 from Purdue University

10/21

2D Viewing Operations. [PPT][Word] by 江清水 7. Review

8. Data Structure: List, Tree

Problem Assignment 7 numpy module by  江清水 (posted on Oct. 14, 2:10Pm)

Problem Assignment 7 by 江清水 (function 描繪)

Solution for Problem Assignment 7 by 江清水

Solution for Problem Assignment 7 by 江清水

10/28

    調課(至大陸蘇州大學學術交流)

11/4

3D Coordinates 9. File I/O, Trees Problem Assignment 8: File input and output (posted on Nov 4, 2:10) by 江清水

input file for Problem 8 by 江清水

Solution for Problem 8 by 江清水

Image Process

11/11

Projection 10. Tree and Recursion

Problem Assignment 9: Image Processing (PIL Module) by 江清水

input file for problem 9 by 江清水

Solution for Problem 9 by 江清水

Loop Review

十一

11/18

Curves by 江清水 11. Problem 10: Hermit Curve (PIL Module) by 江清水

Solution for Problem 10

十二

11/25

Recursive 12 Problem 11-1:  Traverse of Tree by 江清水

Problem 11_2: Reverse a list by 江清水

Solution for Problem 11

十三

12/2

  13 Problem 12_1: Sort Method (Merge Sort) by 江清水

Problem 12_2: Sort Method (Heap Sort) by 江清水

Solution for Problem 12

十四

12/9

  14

15

OpenGL Module

Problem 13: Draw a circle by using OpenGL module. by 江清水

Solution for Problem 13. by 江清水

十五

12/16

  16 Problem 14: Translation again by using OpenGL module. by 江清水

Solution for Problem 14. by 江清水

12/18 Surface 1by 江清水   補課: 學生報告
十六

12/23

    Problem 15: Animation: sphere moving in a box.  by 江清水

Solution for Problem 15 by 江清水

十七

12/30

Rendering 1 by 江清水 Review Course Problem 16: Material, Light, rendering. by 江清水

Solution for Problem 16 by 江清水

十八1/6     期末考
       
     

A History of Photography From Web (Cherokee County Schools)

Camara from Joe Collins

Photography (From:www.georgetown.edu)

Camara from Joe Collins

Computer Graphics and Its Application. [PPT][Word] by 江清水

 

   

 

The newest version of OpenGL. OpenGL 4.3, release on 8/6/2012. (網路英文資料)

OpenGL Books. (網路英文資料)

 

OpenGL安裝說明
 

OpenGL 0: How to include the slut.h in visual C++? [PPT][Word] by 許伶潁

This chapter tells you how to include the slut.h into visual C++, ......

 

OpenGL 1: Your first simple program "simple.c". [simple.c by Angel][PPT files by Yi-Min Kuo][simple.JPG]

In this program, you learn how to open a window, draw a square in the window using the following GL and GLUT functions:

    glClear, glBegin, glEnd, glFlush

    glutCreateWindow, glutDisplayFunc, glutMainLoop

   

What is Sierpinski Gasket?

3D Coordinate System. [PPT][Word] by 江清水

OpenGL 2: A Demo Program to show you OpenGL features including smooth shading, antialiasing, texture mapping, color interpolation.     [demo.c by Angel][demo.JPG]

It is a demo program. All of the OpenGL (glut) features will be illustrated more detail in the future class.

 

OpenGL 3-6: Sierpinski Gasket. There are 3 programs for Sierpinski Gasket, including:

(1) 2D Sierpinski Gasket generated using randomly selected Vertices and bisection. [gasket.c by Angel][gasket.JPG]

(2) Recursive subdivision of triangle to form Sierpinske gasket. [gasket2.c by Angel][gasket2.JPG]

(3) 3D Sierpinski Gasket GL program. [gasket3D.c by Angel][gasket3d.JPG]

(4) Recursive subdivision of tetrahedron to form 3D Sierpinski Gasket. [tetra.c by Angel][tetra.JPG]

You learn the following GL and GLUT functions:

(1) glClearColor, glColor, glMatrixMode, glLoadIdentity, glOrtho2D

         glutInit, glutInitDisplayMode, glutInitWindowPosition

(2) No new function.

(3) glOrtho

      glutIdleFunc, glutMouseFunc

(4) glNormal, glViewport, glEnable

     glutPostRedisplay, glutReshapeFunc

You also learn recursive techniques in (2),  how to use mouse with OpenGL to start and stop program execution in (3), how to avoid the distortion in the window in (4).  

There are references for Sierpinski Gasket on the web. I recommend the one by Paul Baurke for our undergraduate student.

    Introduction to OpenGl Functions.

OpenGL 7: Earth. THis is a program to demo the use of quad strips and triangle fans for modeling a sphere by longitude and latitiude. You should know how to parameterize a sphere. [earth.c by Angle][earth.JPG][PPT by Yi-Min Kuo]

      Library functions: glrotate, glPolygonMode;

                                   glutSwapBuffers

 

OpenGL 8: Square. The program illustrates the use of the glut library for interfacing with a Window System. [square.c by Angle][square.JPG][PPT by Yi-Min Kuo]

       Library function: glutMotionFunc;

   

 

OpenGL 9: Double buffer. Why we need the double buffering? How to handle the animation using OpenGL? This program with chapter 1 of the OpenGL Programming Guide gives you detail explanation. [double.c from Silicon Graphics][double.JPG]

 

OpenGL 10: Lines and lines stipple. This program demonstrates geometric primitives and their attributes, especially the line and line stipples. Please read the Chapter 2 of the OpenGL Programming Guide. [lines.c from Silicon Graphics][lines.JPG]

   

 

OpenGL 11: Polygon stippling. This program demonstrates polygon stippling. Please read the Chapter 2 of the OpenGL Programming Guide. [polys.c from Silicon Graphics][polys.JPG]

 

 

OpenGL 12: Model Transformation and Viewing Transformation. The program demonstrates modeling transformation glScalef() and viewing transformation gluLookAt(). [cube.c from Silicon Graphics][cube.JPG]

    Library Function: glScalef, glMatrixMode, glFrustum; gluLookAt; glutWireCube. 

 

   

 

OpenGL 13: Model Transformation. This program demonstrates modeling transformations. [model.c from Silicon Graphics][model.JPG]

 

OpenGL 14: Single buffer and double buffer. This program will show two windows at the same time with single buffer and double buffer used. [single_double.c by Angle][single_double.JPG]

    Library Function: glPushAttrib, glPopAttrib, glRasterPos.

 

   

OpenGL 15: New Paints. This program teach us how to design a simple tools bar. Let user have interaction with OpengGL program. [newpaint.c][newpaint.JPG][PPT by Yi-Min Kuo]

    Library Function: glutBitmapCharacter, glutBitmapWidth, glutCreateMenu, glutAddMenuEntry, glutAttachMenu, glutAddSubMenu.

 

OpenGL 16: Shadow. This program draws a polygon and its shadow. [shadow.c by Angle][shadow.JPG]

   

OpenGL 17: Sphere. This program show the display of sphere in three modes: wire frame, constant, and interpolative shading. [sphere.c by Angle][sphere.JPG]

 

OpenGL 18: Smooth-Shaded Triangle. This program is drawing a triangle with smooth model color. [smooth.c][smooth.JPG]

     Library Function: glShadeModel.

十一    

OpenGL 19: Using glColorMaterial. This is an interactive program that uses glColorMaterial() to change material parameters. Pressing each of the three mouse buttons changes the color of the diffuse reflection. [colormat.c][colormat.JPG]

    Library Function: glColorMaterial, glMaterial.

 

OpenGL 20: A Simple Bezier Curve. The program draws a cubic Bezier curve using four control points.[bezcurve.c][bezcurve.JPG]

    Library Function: glMap1, glEvalCoord.

十二    

OpenGL 21: Curves. This is a simple interactive curve drawing program. [curves.c by Angel][curves.JPG]

    Library Function: glMapGrid, glEvalMesh.

 

OpenGL 22: Read Pixels. This program reads pixels values from display and prints out RGB. [readpixels.c by Angel][readpixels.JPG]

    Library Function: glRect, glReadPixels, glReadBuffer, glPixelStore.

 

十三    

OpenGL 23: Blending. Blend colors to achieve such effects as making objects appear translucent. [alpha.c from Redbook][alpha.JPG]

    Library Function: glBlendFunc;

 

OpenGL 24: Three-Dimensional Blending: [alpha3D.c from Redbook][alpha3D.JPG]

    Library Function: glEnable, glGenLists, glNewList, glutSolidSphere, glEndList

 

十四    

OpenGL 25: Use the accumulation buffer to do full-scene antialiasing on a scene with orthographic parallel projection.[accanti.c][accanti.JPG]

    Library Function: glMaterial, glLight, glLightModel, ShadeModel, glClearAccum,

OpenGL 26: Antipoly. This program draws filled polygons with antialiased edges. [aapoly.c][aapoly.JPG]

    Library Function: glCullFace, glBlendFunc

 

十五    

OpenGL 27: Fog. This program draws 5 red spheres, each at a different z distance from the eye, in different types of fog. Pressing the f key chooses between 3 types of  fog: exponential, exponential squared, and linear.[fog.c][fog.JPG]

    Library Function: glFog, glHint,

 

OpenGL 28: Fogindex. This program draws 5 wireframe spheres, each at a different z distance from the eye, in linear fog.[fogindex.c]

    Library Function: glutSetColor, glClearIndex

十六      
十七   學生期末報告  

 

專題題目及報告時間:

  1/3 1/10
3:30 第一組 建築物製作(10/4)

PPT    Menu   視訊1 視訊2

第十組 電玩遊戲立體人物模組(10/4)

PPT   圖片1 圖片2  圖片3

3:45 第二組 卡通人臉繪製(10/4)

PPT    Menu   Program   視訊

第十一組 利用Sketchup建置室內設計圖(10/4)

PPT   Menu   Program1   Program2

4:00 第三組 LOGO設計(10/11)

PPT    Menu   Program

第十二組 3D模型建構與控制-人形模組(10/4)

PPT   Menu   Program

4:15 第四組 機器人動畫(10/11)

PPT   Menu   Program

第十三組 遊戲的物理學

PPT   Menu   Program

4:30 休息十分鐘。請勿吵到其他班級上課
4:40 第五組 Plane game with VB(10/4)

PPT    Menu   Program   Demo

 課堂反映問卷

 

4:55 第六組 小精靈遊戲(10/11)

PPT   Menu   Program 

第十四組   國旗妙妙妙(10/4)

PPT   Program

5:10 第七組 動畫電影製作探討(10/4)

報告

第十五組   多拉A夢2D圖(10/4)

PPT   視訊

5:25 第八組 全自動區分計算機和人類的圖靈測試(10/4)

PPT   Menu   Program

第十六組   360度全景攝影探討(10/11)

PPT

5:40 休息十分鐘。請勿吵到其他班級上課
5:50 第九組 機器人打籃球(10/4)

PPT    Menu   Program   Demo

教師講評
6:05 教師講評 教師講評

    

以下內容部分為未來授課教材,僅供參考。


OpenGL Notes

The teaching course in SIGGRAPH in 2001 by Shreiner, Angel and Shreiner. [Contents][Notes]

 

 

Assignment

Assignment 1: This OpenGL program assignment is due on October 3, 2006.

Assignment 2: This OpenGL program assignment is due on November 7, 2006.

Assignment 3: This OpenGL program assignment is due on December 12, 2006.

95學年度第一學期計算機圖學期末報告分組名單暨報告題目

[參考]94學年度第二學期計算機圖學期末報告題目

 


Student Gallery

ID Output
92156241

PH Curve

92156241

Facial Drawing

90156150

Representation of Surface

92156140

Projections and Shadows

92156102

Ratio of the Circumference

92156297

Double Helix

Cone/Cone Intersection
CyclographicMaps
89156217

Sierpinski tiling arrowhead

89133037

Sierpinski carpet


         相關網址:

            相關書籍:             Computer Graphics using Open GL by F.S. Hill, Jr.

                                           http://www.prenhall.com/hill

            有關OpenGL:        http://www.opengl.org

                                           http://www.sgi.com/software/opengl/manual.html

                                           OpenGL Programming Guide

                                           Silicon Graphic

            相關網站:      Search Engine:    http://www.google.com/ 後鍵入OpenGL或Computer Graphics 搜尋

                                   CG basic idea:    http://www.geom.umn.edu/docs/reference/CRC-formulas/

                                                              http://astronomy.swin.edu.au/~pbourke/

                                   CG Research Site: http://mambo.ucsc.edu/psl/cg.html    

                                                                http://cggmwww.csie.nctu.edu.tw/index.html