Translate, Rotate, Matrix Pages 133-143. Function Function Definition Calling a function Parameters Return type and return statement.

Slides:



Advertisements
Similar presentations
Pass by Value. COMP104 Pass by Value / Slide 2 Passing Parameters by Value * A function returns a single result (assuming the function is not a void function)
Advertisements

How do Methods Work?. Let’s write a method that adds two integer values together and returns the result.
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.
Code Elements and Processing Coordinate System. Code elements: pages Comments: are documentation notes that are ignored by the computer but are.
A Quick Introduction to Processing
Grundaufbau import processing.core.PApplet; public class Proc_Minimal extends PApplet { public void setup(){ size(1024, 768); frameRate(60.0f);
1 Classes, Encapsulation, Methods and Constructors (Continued) Class definitions Instance data Encapsulation and Java modifiers Method declaration and.
PASSING PARAMETERS 1. 2 Parameter Passing (by Value) Parameters Formal Parameters – parameters listed in the header of the function Variables used within.
Functions ROBERT REAVES. Functions  Interface – the formal description of what a subprogram does and how we communicate with it  Encapsulation – Hiding.
Translation and Rotation in 2D and 3D David Meredith Aalborg University.
1 Module 12 Computation and Configurations –Formal Definition –Important Terms –Examples.
, 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.
Module 12 Computation and Configurations Formal Definition Examples.
Class template Describing a generic class Instantiating classes that are type- specific version of this generic class Also are called parameterized types.
Chapter 2 storing numbers and creating objects Pages in Horstmann.
Macro & Function. Function consumes more time When a function is called, the copy of the arguments are passed to the parameters in the function. After.
IAT 355 Lecture 4 Computer Graphics: Rocket. May 9, 2014IAT 3552 Outline  Programming concepts –Programming Computer Graphics –Transformations –Methods.
PAGES:51-59 SECTION: CONTROL1 : DECISIONS Decisions.
Transforming Geometry Groundhog Day. Drawing Quads In a 300 by 200 window, draw two quads of different colors. Don’t show the grey grid.
Methods and Parameters Chapter 5 How to split large programs into isolated sections. Focus on one part of the problem – which can be “called” on or “invoked”
Jens Dalsgaard Nielsen Jan Dimon Bendtsen Dept. of Electronic Systems Basic Programming INS-basis GF, PDP and HST.
B. RAMAMURTHY Simulating Motion and Implementing Animation.
Review Inheritance Overloading and overriding. example1.pde.
2-D Shapes, Color, and simple animation. 7 Basic Shapes Ellipse :: ellipse() Arc :: arc() Line :: line() Point :: point() Rectangle :: rect() Triangle.
Lesson 13-2 Pages Adding Polynomials. What you will learn! 1. How to add polynomials.
XNA Basic Displaying Image & Collision Detect. What’s format image that XNA support? XNA support only.bmp.png and.jpg image..PNG have transparent region.
Computer Graphics 3D Transformations. Translation.
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.
1/17/2016B.Ramamurthy1 Final Review CSE321 B.Ramamurthy.
Week 8 - Friday.  What did we talk about last time?  Static methods.
Creating and Using Class Methods. Definition Class Object.
Methods Awesomeness!!!. Methods Methods give a name to a section of code Methods give a name to a section of code Methods have a number of important uses.
Computation as an Expressive Medium Lab 2: Polygons, Transformations, and Arrays (Oh My) Micah.
Print Row Function void PrintRow(float x[ ][4],int i) { int j; for(j=0;j
Methods.
The Substitution Method Objectives: To solve a system of equations by substituting for a variable.
Computer Science I Text input. Transformations. Yet another jigsaw. Classwork/Homework: Create new application making use of transformations.
Int fact (int n) { If (n == 0) return 1; else return n * fact (n – 1); } 5 void main () { Int Sum; : Sum = fact (5); : } Factorial Program Using Recursion.
Some of Chap 17.
Computer Graphics: Rocket, Java: Class
Algorithms and programming
EQUATION IN TWO VARIABLES:
Chapter 14, Translate & Rotate
Polygons, Transformations, and Arrays
FIGURE 4-10 Function Return Statements
3.2 Serial Communication Part 2
Method Mark and Lyubo.
Transformations 6 University of British Columbia
FIGURE 4-10 Function Return Statements
Code Elements and Processing Coordinate System
4-2 Functions in C In C, the idea of top–down design is done using functions. A C program is made of one or more functions, one and only one of which.
Final Review CSE321 B.Ramamurthy 11/23/2018 B.Ramamurthy.
Exam2 Review CSE113 B.Ramamurthy 12/4/2018 B.Ramamurthy.
Chapter 5, Conditionals Brief Notes
Final Review CSE321 B.Ramamurthy 12/9/2018 B.Ramamurthy.
Code Elements and Processing Coordinate System
Faculty of Computer Science & Information System
FIGURE 4-10 Function Return Statements
9.2 Representing Linear Functions
IAT 265 Lecture 2: Java Loops, Arrays Processing setup, draw, mouse Shapes Transformations, Push/Pop.
Web Service.
Methods, Data and Data Types
Translate, Rotate, Matrix
Animation Pages
Computation as an Expressive Medium
Trigonometry & Random March 2, 2010.
FIGURE 4-10 Function Return Statements
Scope Rules.
Presentation transcript:

Translate, Rotate, Matrix Pages

Function Function Definition Calling a function Parameters Return type and return statement

Function concept int z = add(34, 10); // function call add 3410 XY Function definition: int add (int x, int y) // x,y formal parameters { int sum;// sum is a local variable sum = x + y; return sum; } sum

translate Translate function moves the origin by the amount specified int x,y; x = 10; y = 10; void draw() { background(30,50,60); pushMatrix(); translate(x,y); rect(0,5,70,30); x++; if (x> width) x = 0; y++; if (y>height) y = 0; popMatrix(); }

Leaf & vine example in the book Lets look at the leaf and vine example in the book: pages