primitives - CAP4730: Computational Structures in Computer...

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon
CAP4730: Computational Structures in Computer Graphics Portions obtained from Leonard McMillan’s COMP136 Notes: www.cs.unc.edu/~mcmillan/comp136/Lecture 6 2D Basics, Line Drawing, and Clipping
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Definitions CG API – Computer Graphics Application Programming Interface (OpenGL, DirectX) Graphics primitives – functions in the API that describe picture components How could we describe an object? Typically focus on object shape Define an object’s shape with geometric primitives Span of primitives are defined by the API What are some types? Lines, Triangles, Quadrics, Conic sections, Curved surfaces
Background image of page 2
Two Dimensional Images Use Cartesian coordinates We label the two axes as X (horizontal) Y (vertical) Origin is in the lower left How big is the space? So what is the image we see on a screen? We call this space the world coordinate system X Axis Y Axis (0,0) +X +Y
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Partition the space into pixels 1. Define a set of points (vertices) in 2D space. 2. Given a set of vertices, draw lines between consecutive vertices. 3. If you were writing OpenGL yourself, let’s talk about low level calls 4. What about 2D vs 3D? Screen Coordinates – references to frame buffer locations Q: True or Flase: Screen Coordinates == World Coordinates +X +Y (2,1) (2,7) (9,1) (9,7)
Background image of page 4
Pixels ?=glSetPixel(?) ?=glGetPixel(?) Scan line number – y Column number – x
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Absolute and Relative Coordinate Specifications Absolute coordinates
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 27

primitives - CAP4730: Computational Structures in Computer...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online