Vertices, Curves, Color, Images mostly without details 02/16/2010.

Slides:



Advertisements
Similar presentations
CS 4731: Computer Graphics Lecture 20: Raster Graphics Part 1 Emmanuel Agu.
Advertisements

CHAPTER 20 CREATING SVG GRAPHICS. LEARNING OBJECTIVES How to embed a graphic stored within a.SVG file in an HTML page How to use the and tag pair to specify.
A Quick Introduction to Processing
Processing Lecture. 1 What is processing?
Variables and Operators
Lecture # 11 JavaScript Graphics. Scalable Vector Graphics (SVG) Scalable Vector Graphics (SVG), as the name implies, are - scalable (without pixelation):
Copyright © Texas Education Agency, All rights reserved. Images and other multimedia content used with permission. 1 Telling a Story: Introduction.
Translation and Rotation in 2D and 3D David Meredith Aalborg University.
Introduction to Multimedia
FUNDAMENTALS OF PROGRAMMING SM1204 Semester A 2011.
, Fall 2006IAT 800 Lab 2: Polygons, Transformations, and Arrays.
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter Java Applets What is an Applet? How do you create.
Higher-level PHP constructs for manipulating image files.
Web Page Development Identify elements of a Web Page Start Notepad
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter Chapter 5 Applets and Graphics.
2.02 Understand Digital Vector Graphics
Introduction to Computer Graphics
JRN 440 Adv. Online Journalism Vector file formats for print and projected Wednesday, 2/22/12.
Polygon Lists & 3-D File Formats Glenn G. Chappell U. of Alaska Fairbanks CS 481/681 Lecture Notes Monday, February 18, 2002.
Geometers Sketch pad. Step 1: Open Sketch pad Use this to select items Use this to draw a point Use this to draw a circle Use this to draw a line Use.
Default Fill & Stroke D Swap Fill & Stroke Shift X None / Gradient > Color < Stroke X Fill (Click to activate) X More about Fill and Stroke:
1 Web Developer Foundations: Using XHTML Chapter 4 Key Concepts.
1 Web Developer & Design Foundations with XHTML Chapter 4 Key Concepts.
Adobe Illustrator CS? Is a graphic design software - it is the industry's premier vector- drawing environment for creating graphics that scale across media.
Chapter 2: Color and Applets Coming up: Introduction to Graphics.
Chapter 3: Images Yaqoob Al-Slaise ITBIS351. Outline Work out your graphical approach by planning your approach Organizing your tools Configuring your.
SVG for Designers Tom Hoferek. Objectives Introduce SVG Illustrate its capabilities Demonstrate SVG in action Speculate, discuss, answer questions.
File Formats and Vector Graphics. File Types Images and data are stored in files. Each software application uses different native file types and file.
Illustrator I I450 Technology Seminar. Bitmap vs. Vector Photoshop = Bitmap Illustrator = Vector Bitmap images are resolution dependent Vector images.
DIGITAL IMAGE. Basic Image Concepts An image is a spatial representation of an object An image can be thought of as a function with resulting values of.
Vertices, Edges and Faces By Jordan Diamond. Vertices In geometry, a vertices is a special kind of point which describes the corners or intersections.
Computation as an Expressive Medium Lab 2: Polygons, Transformations, and Arrays Evan.
______________________________________________________________________________________ SCHOOL OF INTERACTIVE ARTS + TECHNOLOGY [SIAT] |
CISC 110 Day 3 Introduction to Computer Graphics.
Creating Vectors – Part One 2.02 Understand Digital Vector Graphics.
IAT-241 Animation Visualization  Visual thinking  Hand and digital drawing  3D spaces and transformations.
Computer Science I 3D Classwork / Homework: plan and implement your own 3D example.
FUNDAMENTALS OF PROGRAMMING SM1204 SEMESTER A 2012.
Digital Media Lecture 5: Vector Graphics Georgia Gwinnett College School of Science and Technology Dr. Jim Rowan.
Computation as an Expressive Medium Lab 2: Polygons, Transformations, and Arrays (Oh My) Micah.
What is Computing? What can be Programmed? Creative Computing Processing Downloading Processing Dropbox Primitive Shapes – point – line – triangle – quad.
Lesson 9: Web Graphics. Objectives Distinguish between vector and raster graphic types Identify and choose appropriate image file formats, including browser-compatibility.
Learn how to make your drawings come alive…  COURSE: SKETCH RECOGNITION Analysis, implementation, and comparison of sketch recognition algorithms, including.
Vector Graphics 2.02 Understand Digital Vector Graphics.
Lesson 13 – Color and Typography. 2 Objectives Understand basic color theory. Understand the color wheel. Understand how color is presented on a computer.
Graphics Basic Concepts 1.  A graphic is an image or visual representation of an object.  A visual representation such as a photo, illustration or diagram.
Main characteristics of Vector graphics  Vector graphics provide an elegant way of constructing digital images (diagrams, technical illustration and.
Bitmap vs. Vector How computers work with photographs and drawings.
2.02 Understand Digital Vector Graphics
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
2.02 Understand Digital Vector Graphics
Bitmap Image Vectorization using Potrace Algorithm
Polygons, Transformations, and Arrays
2.02 Understand Digital Vector Graphics
2.02 Understand Digital Vector Graphics
Digital Media Dr. Jim Rowan ITEC 2110.
Lecture 7: Introduction to Processing
Introducing Adobe Illustrator
IAT 265 Lecture 2: Java Loops, Arrays Processing setup, draw, mouse Shapes Transformations, Push/Pop.
PPT6: Advanced Geometric Algorithms
Creating Vectors – Part One
Processing Environment
Computation as an Expressive Medium
Lets shape up! Pages:
Variables and Operators
Creating Vectors – Part One
2.02 Understand Digital Vector Graphics
Lets shape up! Pages:
2.02 Understand Digital Vector Graphics
Drawing Shapes (Graphics Class) Creating Objects Packages
Presentation transcript:

Vertices, Curves, Color, Images mostly without details 02/16/2010

Shapes Shape –Interesting geometric structure –General outline In processing beginShape()‏ endShape()‏ No translation within a shape

Vertices and Modes Vertex –Corner point of a polygon –Interesting point in a shape Modes –POINTS, LINES, TRIANGLES, TRIANGLE_FAN, TRIANGLE_STRIP, QUADS, QUAD_STRIPPOINTS, LINES, TRIANGLES, TRIANGLE_FAN, TRIANGLE_STRIP, QUADS, QUAD_STRIP –CLOSECLOSE

Catmull-Rom splines “Vertices” specified with curveVertex Control points –First and last “vertices” –Give the initial and final curves

Bézier curves Normally –Every third point is anchor –First and final points are anchors –All other points are control For first anchor vertex( ax, ay )‏ For remaining controls and anchor triples bezierVertix( cx 1, cy 1, cx 2, cy 2, ax, ay ) ;

Bézier tricks For a sharp turn –Use the last anchor as the next control For a closed shape –Make the first and final anchors the same For a straight line –Just use a plain vertex

Late breaking news Scalable Vector Graphics (SVC)‏ –XML for drawing 2D graphics PShape –Processing library using SVG SVG editors –Illustrator –OpenOffice –Amaya

Mathematical functions Square –sq(x) → x 2 Square root –sqrt(x) → x 0.5 Exponentiation –pow(x, y) → x y

Normalization norm(value, low, high)‏ –How far between low and high is value? –The result is between 0.0 and 1.0 lexp(low, high, amt)‏ –Reverses norm –Amt is between 0.0 and 1.0 map(value, low1, high1, low2, high2)‏ –Maps between two value ranges

Normalization math norm(value, low, high)‏ –(value-low)/(high-low)‏ lexp(low, high, amt)‏ –amt*(high-low)+low map(value, low1, high1, low2, high2)‏ –lexp(norm(value,low1,high1),low2,high2)‏

Why normalization? In Spring 2010, Embedded Systems –Arduino board reads a number based on how far a hand is held above an infrared sensor –Processing translates this to a “paddle” position in pongpong A thermin works similarlythermin Useful is scaling information for display

Color Models colorMode(RGB, 255);RGB // processing's default color model // used almost exclusively in // computer science applications colorMode(HSB, 360, 100, 100);HSB // hue, saturation, value(brightness) // used predominately in art, available // in most graphics and animation packages My first somewhat buggy Java applet

Hexadecimal color Web standards may use hex Hex digits –0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F Base 16 –A8 is 10* or 168 In web # notation –six hex digits gives three numbers from 0 to 255 –# is 128, 128, 0 Or olive as an HTML color nameHTML color name

A short little lab Start with something like the following size(800, 600) ; for (int x=0; x<width; ++x) { for (int y=0; y<height; ++y) { stroke(map(x+y, 0, width+height, 0, 255)) ; point(x, y) ; }

What to try Modify the program to vary color Use more interesting variations –Make the red value depend on x or x-y Use sq and sqrt to obtain a “non-linear” color transition –Something like sq(x) rather than x+y

Using an image In processing IDE –Add an image to the environment In processing code –Load the image –Display the image –Tint the image

Adding the image In the processing IDE –Sketch » Add File… –Select an image file Download one from if you wantwww.unca.edu Image file will be packaged with program

Displaying the image In your processing program –Declare an PImage object –Load the file into the PImage object –Display the image with image()‏ image()‏ Something like the following size(300, 500) ; PImage bandImg ; bandImg = loadImage("SC-RangersOpt.jpg") ; image(bandImg, 0, 0) ;

Trying it out Display an image Make a collage of two images Use tint() to color your image tint()