Download presentation
Presentation is loading. Please wait.
1
Translate, Rotate, Matrix
Transform1: Translate, Matrices Pages
2
Review Curve Vertex At least 4 points: Control point1, vertex 1, vertex 2, control point2 A smooth curve is drawn between vertext1 and vertex 2 based on the control points.
3
Function Function Definition Calling a function Parameters
Return type and return statement
4
Function: Intuitive Understanding
Function F F(x) X
5
Examples Add 10 20 10 X=10, y=4 Multiply (x,y) 40 Subtract 6 4
6
Function concept int z = add(34, 10); // function call
Function definition: int add (int x , int y) // x,y formal parameters { int sum;// sum is a local variable sum = x + y; return sum; } add 34 10 X Y sum
7
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(); }
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.