Transforming Geometry Groundhog Day. Drawing Quads In a 300 by 200 window, draw two quads of different colors. Don’t show the grey grid.

Slides:



Advertisements
Similar presentations
This terms course Last term we both worked on learning 2 things –Processing –The concepts of graphics etc. This term will focus more on the basic concepts.
Advertisements

A Quick Introduction to Processing
Transformations We want to be able to make changes to the image larger/smaller rotate move This can be efficiently achieved through mathematical operations.
IAT 334 Lab 2 Computer Graphics: Rocket, PImage. June 4, 2010IAT 3342 Outline  Programming concepts –Programming Computer Graphics –Transformations –Methods.
Translate, Rotate, Matrix Pages Function Function Definition Calling a function Parameters Return type and return statement.
Translation and Rotation in 2D and 3D David Meredith Aalborg University.
IAT 334 Java using Processing ______________________________________________________________________________________ SCHOOL OF INTERACTIVE ARTS + TECHNOLOGY.
, Fall 2006IAT 800 Lab 2: Polygons, Transformations, and Arrays.
IAT 800 Lecture 4. Sept 18, Fall 2006IAT 8002 Outline  Programming concepts –Methods –Classes  Talk about project 1  Reading: Read Chapters 1-4 of.
Logo Lesson 3 TBE 540 Fall 2004 Farah Fisher. Prerequisites for Lesson 3 Before beginning this lesson, the student must be able to… Use simple Logo commands.
Solve Systems of Linear Equations with a Common Term Using the Elimination Method.
By D. Fisher Geometric Transformations. Learning Targets I can draw transformations of reflections, rotations, translations and combinations of these.
PROCESSING Animation. Objectives Be able to create Processing animations Be able to create interactive Processing programs.
Using Matrices to Perform Geometric Transformations
Foundations of Computer Graphics (Fall 2012) CS 184, Lecture 2: Review of Basic Math
1 Matrix Math ©Anthony Steed Overview n To revise Vectors Matrices n New stuff Homogenous co-ordinates 3D transformations as matrices.
PROCESSING. * Java SDK * downloads/jdk7-downloads html
IAT 355 Lecture 4 Computer Graphics: Rocket. May 9, 2014IAT 3552 Outline  Programming concepts –Programming Computer Graphics –Transformations –Methods.
Elements of Photojournalism
Using Free GIMP Software to Create Value Portraits Juli Fraher Pontiac District #429 Pontiac, IL.
Image Synthesis Rabie A. Ramadan, PhD 2. 2 Java OpenGL Using JOGL: Using JOGL: Wiki: You can download JOGL from.
1 What you will learn  We need to review several concepts from Algebra II: Solving a system of equations graphically Solving a system of equations algebraically.
1 Loops and Branches Ch 21 and Ch18 And how you can use them to draw cool pictures!
PROCESSING Methods. Objectives Be able to define methods that return values Be able to define methods that do not return values Be able to use random.
TILING Wallpaper groups. Maths + Informatics + Art We created symmetrical artworks by using the program Kali.
Representation. Objectives Introduce concepts such as dimension and basis Introduce coordinate systems for representing vectors spaces and frames for.
Graphic Basics in C ATS 315. The Graphics Window Will look something like this.
Insert a clipart of a monkey in the box below. Make it have a blue background. Then insert a clipart of a Horse in the box. Make it have a green background.
Review Inheritance Overloading and overriding. example1.pde.
CGDD 4003 THE MATH LECTURE (BOILED DOWN, YET LIGHTLY SALTED)
Jens Krüger & Polina Kondratieva – Computer Graphics and Visualization Group computer graphics & visualization 3D Rendering Praktikum: Shader Gallery The.
Direct3D Workshop November 17, 2005 Workshop by Geoff Cagle Presented by Players 2 Professionals.
 Remember back in geometry when you did translations? A translation is a. The coordinates of a point use a rule to move from its to its. slide preimageimage.
Section 9.2 Adding and Subtracting Matrices Objective: To add and subtract matrices.
Animation Pages Function Function Definition Calling a function Parameters Return type and return statement.
Computation as an Expressive Medium Lab 2: Polygons, Transformations, and Arrays Evan.
Lesson 3: Arrays and Loops. Arrays Arrays are like collections of variables Picture mailboxes all lined up in a row, or storage holes in a shelf – You.
LESSON 5-1 I can draw reflected images. I can recognize and draw lines of symmetry.
1 Building Your Own Turtle Functions For making really cool pictures!
{ Human Proportion: Faces and Figures Ebony Pencil.
Jens Krüger & Polina Kondratieva – Computer Graphics and Visualization Group computer graphics & visualization GameFX C# / DirectX 2005 The Rendering Pipeline.
Coordinate Systems Lecture 1 Fri, Sep 2, The Coordinate Systems The points we create are transformed through a series of coordinate systems before.
Honors Geometry.  We learned how to set up a polygon / vertex matrix  We learned how to add matrices  We learned how to multiply matrices.
Computation as an Expressive Medium Lab 2: Polygons, Transformations, and Arrays (Oh My) Micah.
IAT 265 Images in Processing PImage. Jun 27, 2014IAT 2652 Outline  Programming concepts –Classes –PImage –PFont.
Computer Science I Text input. Transformations. Yet another jigsaw. Classwork/Homework: Create new application making use of transformations.
OpenGL and You I Cast, Therefore I Am. Ray Casting Idea is simple, implementation takes some work –Cast rays as if you were the camera –Determine intersection.
IAT 800 Lecture 8 PImage and PFont. Oct 13, Fall 2009IAT 8002 Outline  Programming concepts –PImage –PFont.
Transformations for GCSE Maths Enlargement Translation Reflection Rotation.
Main characteristics of Vector graphics  Vector graphics provide an elegant way of constructing digital images (diagrams, technical illustration and.
COMPUTER GRAPHICS AND LINEAR ALGEBRA AN INTRODUCTION.
CSE 167 [Win 17], Lecture 2: Review of Basic Math Ravi Ramamoorthi
Transforms.
Computer Graphics: Rocket, Java: Class
IAT 265 PImage and PFont.
Chapter 14, Translate & Rotate
Polygons, Transformations, and Arrays
Graphics Fundamentals
LCC 6310 Computation as an Expressive Medium
Chapter 7 Functions.
Chapters 5/4 part2 understanding transformations working with matrices
Projection in 3-D Glenn G. Chappell
IAT 265 Lecture 2: Java Loops, Arrays Processing setup, draw, mouse Shapes Transformations, Push/Pop.
Translate, Rotate, Matrix
Animation Pages
Transformations.
Announcements How to save your work? Quiz solution 5/5/2019
Computation as an Expressive Medium
Trigonometry & Random March 2, 2010.
Using Matrices to Perform Geometric Transformations
Presentation transcript:

Transforming Geometry Groundhog Day

Drawing Quads In a 300 by 200 window, draw two quads of different colors. Don’t show the grey grid.

Adding a face Add eyes, nose, and mouth. The picture below is the top of the groundhog. The grid units are 100/12.

Multiple groundhogs To repeat at a different location –Use variables for X and Y points quad(ghX+150, ghY, ghX+100, ghY+200, ….) To repeat at a different size –Use variable for scale float scale = size/200 ; quad(int(150*scale), 0, int(100*scale), int(200*scale), ….)

Multiple groundhogs To repeat at a different location and size –Use variables for X, Y, and scale float scale = size/200 ; quad(ghx+int(150*scale), ghY, ghx+int(100*scale), ghy+int(200*scale), ….) To repeat at a 45 angle –Take out a good geometry book!

Better yet Use transformation matrices –Without really understanding the math Linear transformations Affine transformations Linear algebra Matrices Euclidean geometry Cartesian coordinates You’ll be able to –Draw slanted ellipses –Draw big slanted groundhogs –Draw tiny groundhogs looking in mirrors –Make Toy Story 4

The translate function size(400, 400) ; ellipse(100, 100, 80, 40) ; translate(10, 10) ; ellipse(100, 100, 80, 40) ;

Why not three! size(400, 400) ; ellipse(100, 100, 80, 40) ; translate(10, 10) ; ellipse(100, 100, 80, 40) ; translate(20, 20) ; ellipse(100, 100, 80, 40) ; Perhaps not what you expected

Are these the same? int x = 200 ; int y = 200 ; ellipse(x+100, y+100, 80, 40) ; int x = 200 ; int y = 200 ; translate(x, y) ; ellipse(100, 100, 80, 40) ; for (int x=0; x<=200; x+=100) { for (int y=0; y<=200; y+=100) { ellipse(x+100, y+100, 80, 40) ; } for (int x=0; x<=200; x+=100) { for (int y=0; y<=200; y+=100) { translate(x, y) ; ellipse(100, 100, 80, 40) ; }

Controlling transformations To discard current “transformation matrix” and return to the old matrix popMatrix() ; To start a new current matrix and save a copy of the current matrix pushMatrix() ; To add transforms to the current matrix translate() –And a few more to come

One translation at a time size(400, 400) ; for (int x=0; x<=200; x+=100) { for (int y=0; y<=200; y+=100) { pushMatrix() ; translate(x, y) ; ellipse(100, 100, 80, 40) ; popMatrix() ; }

Too clever a translation size(400, 400) ; for (int i=0; i<3; i++) { pushMatrix() ; for (int j=0; j<3; j++) { ellipse(100, 100, 80, 40) ; translate(0, 100) ; } popMatrix() ; translate(100, 0) ; }

A different slant size(400, 400) ; rotate(radians(30)) ; fill(255,0,0) ; ellipse(300, 100, 100, 50) ; rotate(PI/6) ; fill(0, 255, 0) ; ellipse(100, 0, 100, 50) ;

May I supersize that? size(400, 400) ; ellipse(50, 50, 10, 10) ; scale(6) ; ellipse(50, 50, 10, 10) ;

Translate and Rotate size(600, 600) ; ellipse(100, 100, 10, 10) ; pushMatrix() ; fill(0,255,0) ; translate(100, 100) ; rotate(PI/6) ; ellipse(300, 300, 200, 100) ; popMatrix() ; pushMatrix() ; fill(0,127,0) ; rotate(PI/6) ; translate(100, 100) ; ellipse(300, 300, 200, 100) ; popMatrix() ;

Translate and Scale size(600, 600) ; ellipse(100, 100, 10, 10) ; pushMatrix() ; fill(255,0,0) ; // red translate(100, 100) ; scale(0.5) ; ellipse(300, 300, 200, 100) ; popMatrix() ; pushMatrix() ; fill(127,0,0) ; scale(0.5) ; translate(100, 100) ; ellipse(400, 400, 200, 100) ; popMatrix() ;

Scale and rotate It’s the same in either order size(600, 600) ; ellipse(100, 100, 10, 10) ; pushMatrix() ; fill(0,0,255) ; rotate(PI/6) ; scale(0.5) ; ellipse(400, 400, 200, 100) ; popMatrix() ;

In-Class Exercise: Draw six groundhogs Make the window 600 by 600 Draw a 2 by 3 collection of groundhogs for (int i=0; i<2; i++) { for (int j=0; j<3; j++) { Consider the following –Vary the groundhog position –Change the groundhog size –Rotating the groundhog

Assignment 3Assignment 3 - Due Feb 10 Write a program that repeats a pattern of groundhogs in several places throughout the screen. Try to put a little variation in the pattern. Use a screen size of 400x400. You must use translate(), rotate(), and scale(). Remember to comment your code and to submit only your source code.