Download - Chapter 3: Simple Graphics Program
![Page 1: Chapter 3: Simple Graphics Program](https://reader035.vdocuments.us/reader035/viewer/2022062217/56814e99550346895dbc4225/html5/thumbnails/1.jpg)
Chapter 3
Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer
Chapter 3: Simple Graphics Program
![Page 2: Chapter 3: Simple Graphics Program](https://reader035.vdocuments.us/reader035/viewer/2022062217/56814e99550346895dbc4225/html5/thumbnails/2.jpg)
Chapter 3
Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer
We will learn
Review coordinate systems Simplest drawing program Graphics API drawing procedure Abstraction of drawing with
graphics API
![Page 3: Chapter 3: Simple Graphics Program](https://reader035.vdocuments.us/reader035/viewer/2022062217/56814e99550346895dbc4225/html5/thumbnails/3.jpg)
Chapter 3
Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer
Take a photograph
Paper: cut to right size Position: place at right palce
![Page 4: Chapter 3: Simple Graphics Program](https://reader035.vdocuments.us/reader035/viewer/2022062217/56814e99550346895dbc4225/html5/thumbnails/4.jpg)
Chapter 3
Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer
Coordinate system
The origin The X/Y Axes
Directions Units on axes
![Page 5: Chapter 3: Simple Graphics Program](https://reader035.vdocuments.us/reader035/viewer/2022062217/56814e99550346895dbc4225/html5/thumbnails/5.jpg)
Chapter 3
Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer
Paper: size and location
![Page 6: Chapter 3: Simple Graphics Program](https://reader035.vdocuments.us/reader035/viewer/2022062217/56814e99550346895dbc4225/html5/thumbnails/6.jpg)
Chapter 3
Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer
Vertex Positions
Order of specification: Va Vb Vc Vd
Clockwise vs Counterclockwise Either is ok, but consistent !
Choice of origin Convenience!
![Page 7: Chapter 3: Simple Graphics Program](https://reader035.vdocuments.us/reader035/viewer/2022062217/56814e99550346895dbc4225/html5/thumbnails/7.jpg)
Chapter 3
Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer
Tutorial 3.1: Computer graphics solution
![Page 8: Chapter 3: Simple Graphics Program](https://reader035.vdocuments.us/reader035/viewer/2022062217/56814e99550346895dbc4225/html5/thumbnails/8.jpg)
Chapter 3
Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer
Tutorial 3.1: Frontend
Main application window and Drawing Window
![Page 9: Chapter 3: Simple Graphics Program](https://reader035.vdocuments.us/reader035/viewer/2022062217/56814e99550346895dbc4225/html5/thumbnails/9.jpg)
Chapter 3
Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer
Tutorial 3.1: Backend programming
Main window (CTutorialDlg) Has an instance of drawing window
At runtime: place the drawing window into the application window
![Page 10: Chapter 3: Simple Graphics Program](https://reader035.vdocuments.us/reader035/viewer/2022062217/56814e99550346895dbc4225/html5/thumbnails/10.jpg)
Chapter 3
Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer
Tutorial 3.1: Drawing Window
CGrfxWindowD3D …
A MFC CWnd object Knows how to replace itself onto an
application window Allows D3D drawing (OnPaint()) …
![Page 11: Chapter 3: Simple Graphics Program](https://reader035.vdocuments.us/reader035/viewer/2022062217/56814e99550346895dbc4225/html5/thumbnails/11.jpg)
Chapter 3
Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer
GrfxWindow: OnPaint() function
Drawing … 4 steps …
![Page 12: Chapter 3: Simple Graphics Program](https://reader035.vdocuments.us/reader035/viewer/2022062217/56814e99550346895dbc4225/html5/thumbnails/12.jpg)
Chapter 3
Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer
GrfxWindow: Drawing …
![Page 13: Chapter 3: Simple Graphics Program](https://reader035.vdocuments.us/reader035/viewer/2022062217/56814e99550346895dbc4225/html5/thumbnails/13.jpg)
Chapter 3
Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer
Lesson learned:
Computer graphics: Draws geometry: Render Must measure and design before
coding Coordinate system
Choose a convenient system: Origin, and units for measurement
![Page 14: Chapter 3: Simple Graphics Program](https://reader035.vdocuments.us/reader035/viewer/2022062217/56814e99550346895dbc4225/html5/thumbnails/14.jpg)
Chapter 3
Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer
Graphics API independent drawing
![Page 15: Chapter 3: Simple Graphics Program](https://reader035.vdocuments.us/reader035/viewer/2022062217/56814e99550346895dbc4225/html5/thumbnails/15.jpg)
Chapter 3
Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer
Graphics objects: Rectangle
![Page 16: Chapter 3: Simple Graphics Program](https://reader035.vdocuments.us/reader035/viewer/2022062217/56814e99550346895dbc4225/html5/thumbnails/16.jpg)
Chapter 3
Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer
Graphics objects: Circle
Center: (0,0) Radius: r If center at (xc,yc)
x = xc + r sin(θ) y = yc + r cos(θ)
![Page 17: Chapter 3: Simple Graphics Program](https://reader035.vdocuments.us/reader035/viewer/2022062217/56814e99550346895dbc4225/html5/thumbnails/17.jpg)
Chapter 3
Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer
Circle: implementation