Animating Coordinate Geometry In this unit we will expand upon our knowledge of using counters to create motion pictures. By using incremental mathematics,

Slides:



Advertisements
Similar presentations
Creative Computing. \\ aims By the end of the session you will be able to: 1.Move objects around 2.Write simple interactive programs 3.Use the mouse position.
Advertisements

Introduction to Programming
A Quick Introduction to Processing
CSC 123 – Computational Art Introduction to Shape and composition
Material obtained from a Guilford County Workshop, July, 2014 V
 By carefully incrementing the X and/or Y values of our set of lines, we can create a game board for a boat game.  Lines that go from left to right are.
Tic Tac Toe size(600,600); Aim: How can we set up our canvas and display for a Tic Tac Toe game? 1. Sketch the two drawings and write the two code.
Introduction to Animation Programming Our next set of exercises will look at animation on the following link:
What is iteration? I mean, what is iteration? Seriously, what is iteration?
Aim: Use the given examples to record examples and our own ideas in our journal 1.Write technical examples in journal and/or participate in full.
Initializing The HTML Our initial HTML calls upon the API (application programming interface) and sets up the body of the page for use. We can make improvements.
Battleships Recognize Impact In this example, we will establish a Boolean variable (true or false) to decide if the boat has been hit. Then, we will adjust.
Text, Masks, and Live Effects – Lesson 41 Text, Masks, and Live Effects Lesson 4.
Introduction to Shape Programming When we make geometric shapes with computers, we have to give specific numbers to tell the computer exactly what to do.
Responsive Battleships The battleship animation we created needs to respond to user input to be considered a game. The user will be able to launch an attack.
Using Coordinate Geometry to Create Moving Images In unit 29 we created a simple drawing for the background of a children’s game. We are going to start.
Week Rob Pooley Basics of animation and Flash Lecture 1 F27EM1.
Locally Edited Animations We will need 3 files to help get us started at
Bill Nye on Planets and Moons
Creating Special Effects
History of Astronomy Review. Universe in 2 parts: imperfect Earth and perfect heavens – 55 spheres.
Game 1: Mr. Happy’s Quest For our original canvas, we had designed a child’s background using simple shapes. For this project, we will add objects that.
Adobe Fireworks CS3 Revealed CHAPTER ONE: GETTING STARTED WITH ADOBE FIREWORKS.
Macromedia Fireworks 8 Revealed MACROMEDIA FIREWORKS GETTING STARTED WITH.
Default Fill & Stroke D Swap Fill & Stroke Shift X None / Gradient > Color < Stroke X Fill (Click to activate) X More about Fill and Stroke:
Pivot Introduction.
Programming games Reflection Bouncing things, Memory Server-side: Survey. ActionScript 2 examples. Homework: Finish Video or Audio. Post proposal for your.
Computer Graphics Soft Body Animation - Skinning CO2409 Computer Graphics Week 22.
Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education Game Programming Advanced Computer Programming.
Programming for Artists ART 315 Dr. J. R. Parker Art/Digital Media Lab Lec 10 Fall 2010.
Creating Art With Simple Shapes By carefully implementing simple shapes to an HTML canvas we can create useful graphics. With enough time, lines, ellipses.
PHY281 Scientific Java Programming LoopsSlide 1 Loops In this section we will learn how to repeat a series of instructions using loops and to use this.
Chapter 3.1 – Observing the Solar System
Our Solar System.
Geometry. The screen where you can see what happens when you play your game is called the STAGE. The SCRIPT BANK is where the types of instructions are.
Motions of the Earth ….it ’ s what moves us. Two motions of the Earth Rotation - Circular movement of an object around an axis Revolution -The movement.
2-D Shapes, Color, and simple animation. 7 Basic Shapes Ellipse :: ellipse() Arc :: arc() Line :: line() Point :: point() Rectangle :: rect() Triangle.
Animation Pages Function Function Definition Calling a function Parameters Return type and return statement.
Computer Programming Modeling a Passive Solar Home.
Introductory Graphics Chapter Three. Computer Graphics §Full motion pictures (“Star Wars”) l animated films §Virtual reality §Games §Simulators (air craft.
Continuous. Flow of Control Programs can broadly be classified as being –Procedural Programs are executed once in the order specified by the code varied.
Graphics Primitives in Processing 1/14/2010. size(x, y) ; Sets the initial size of the screen Units are in pixels –Pixel == picture element –Small dots.
Adobe InDesign CS5 – Illustrated Unit C: Working with Objects.
Color Aesthetics Weinman, chapter 2 Terms, color themes and relationships, type, layout Aesthetics a guiding principle in matters of artistic beauty and.
Computer Science I Animations. Bouncing ball. The if statement. Classwork/homework: bouncing something. Compress and upload work to Moodle.
1 CSC 221: Computer Programming I Fall 2009 Introduction to programming in Scratch  animation sprites  motion, control & sensing  costume changes 
Unit 1: Space 1. Section 10-1 Notes 2 Celestial Bodies Celestial bodies are natural objects out in space including planets, stars, moons, asteroids and.
 The universe is everything throughout space.  The universe is constantly changing. It is being created and destroyed all of the time.  There are many.
Create a Halloween Computer Game in Scratch
Part 1: Planets and SS models Part 2: Kepler’s Laws of Motion
Lesson One: The Beginning Chapter 1: Pixels Learning Processing Daniel Shiffman Presentation by Donald W. Smith Graphics from
20 minutes maximum exhibits
Part 1: Planets and SS models Part 2: Kepler’s Laws of Motion
Chapter 7 Functions.
First text statement positioned here at guide intersection
Chapter 6 Loops (iteration).
Advanced Computer Programming
Chapter Lessons Understand the Fireworks work environment
Chapter 10 Algorithms.
Mouse Inputs in Processing
Topic one text label Topic two text label Topic three text label
Chapter 10 Algorithms.
Lecture 7: Introduction to Processing
Chapter 5 Section 1 The Sky from earth
The coordinate system Susan Ibach | Technical Evangelist
Chapter 10 Algorithms.
Chapter 4, Variables Brief Notes
CSC 221: Introduction to Programming Fall 2018
Presentation transcript:

Animating Coordinate Geometry In this unit we will expand upon our knowledge of using counters to create motion pictures. By using incremental mathematics, we can have objects move and/or change to make a better looking game.

//explosion var w =.1; var t =.1; void draw(){ noStroke(); fill(100,0,0); ellipse(225,225,w*35,w*35); fill(155,0,0); ellipse(225,225,w*25,w*25); fill(255,0,0); ellipse(225,225,w*15,w*15); w = w + t; if (w>1) t = -t; if (w<.1) t = -t; }

//boat var a = 1; var b = 1; var x = 60; var y = 60; void draw(){ strokeWeight(2); stroke(120,120,120); fill(75,75,75); rect(x,y,30,130); if (x < 300) x = x + a; if (x > 299) y = y + b; if (y > 200) y = 200; //other code

Practice 1, 20% Use the example code to have boats and explosions move throughout the game board. Continue to improve the overall game to make it look like a professional game with original boats, explosions and movements.

Animating Coordinate Geometry //explosion //boat Practice 1, 20%

Having Objects React With Planned Randomness We have made objects bounce back and forth before. On the computer, an object can bounce in a perfect line off a perfect object and remain exactly on track. However, this does not look real since the world contains imperfections. We will add some randomness to our bounce to make it look real.

Example Code var x = 0; var y = 0; var a = 10; var b = 10; void draw(){ ellipse(x,y,140,140); fill(0,50,0); //other ellipses x = x + a; y = y + b; if (x > 600) bounceX(); if (x < 0) bounceX(); if (y > 600) b = - b; if (y < 0) b = - b; }

Creating Our Own Function void bounceX(){ t = random(-50, 50); t = t / 100; a = - a; a = a + t; }

Practice 2, 20% Using the guided example code as a base to start, have the previously created ellipse design bounce around the screen. Improve the overall aesthetics of the background and the moving objects. Use the example given to have more than one set of bouncing ellipses.

Review Having Objects React with Planned Randomness Example Code Creating Our Own Function Practice 2, 20%

Moving Stick Figures The stick figures have a lot of limbs and joints. To make them move in a way that appears to be a natural person requires careful planning. In this practice, we will make one or more stick figures move in an animation.

Example Code var xAll = 0; var yHand = 0; var t=-1; void draw(){ if (xAll < 500) xAll = xAll + 5; if (xAll >= 500) yHand = yHand + t; if (yHand >= 30) t = -t; if (yHand <= 0) t = -t; //shapes codes }

background(100,100,100); //head ellipse(200+xAll,200+yHand,80,80); //body line(200+xAll,240,200+xAll,340); //legs line(200+xAll,340,175+xAll,460); line(200+xAll,340,250+xAll,460); //upper arm line(200+xAll,240,170+xAll,300);

Practice 3, 20% Make one of the stick figures move across the screen and wave hello. Have other stick figures move in appealing ways. Improve the overall aesthetics of the stick figures and the background.

 Moving Stick Figures  Example Code  Shapes With Variables  Practice 3, 20%

Space Adventure! Making the planets and the elliptical orbits of our solar system move can make for a nice animation that can lead to a successful game. In this practice, we will create the illusion of the orbits and planets moving.

var t =.01 var x = 1.0; void draw(){ background(10,10,10); x = x - t; if(x < 0.0) t = -t; if(x > 1.0) t = -t; //stars stroke(random(1,255),random(1,255),random(1,255)) ; fill(random(1,255),random(1,255),random(1,255)); ellipse(random(1,800),random(1,500),5,5);

Example Code Part 2 //sun fill(255,255,00); ellipse(400,255,100,100); //planet orbits noFill(); stroke(255,255,255); ellipse(400,255,x*200,150); //x is a percentage ellipse(400,255,(1-x)*250,200); //opposite path of other orbit //planets fill(50,50,255); ellipse(500-x*100,255,15,15); }

 In this practice, the celestial objects will move in a way that looks realistic.  Be certain to balance the amount of things happening in the animation to make it interesting, but not crazy or overwhelming.  After the orbits and planets move in a real looking way, adjusted the overall aesthetics and add an alien space ship.

Review Space Adventure Example Code Example Code Part 2 Practice 4, 20%

 The beginning of our programs have two lines like the following:   Instead of downloading the file every time, get a local copy of the file and change the link to just the file name.

Linking To and From The Index The index file should be called as index.htm. The current project has a file such as 32.htm. Link the web page for this project back to your index. Link the index to this project.

 Many ships move without crashing  Explosions appear and fade away  Bouncing ball has a friend to make two bouncing balls  Even more friends  Stick figure have friends that move with  Space has comets, aliens, 8 or more planets  Planets are aligned with orbitals

Improvements Aesthetics Boats look like real ships instead of just rectangles Explosions have more complex shapes and graphics Bouncing ball trail has varied colors. Moving stick figures look realistic in limb motion Stars are real looking instead of flashing all over Sun has more complex colors with moving “flame”

Review Changing Called Files To Local Links Linking To and From the Index Improvements: Functional Improvements: Aesthetics

Happy Drawing 2 size(800, 800); background(0,200,200); fill(100,100,100); //horizontal grid line(0,50,800,50); line(0,100,800,100); line(0,150,800,150); line(0,200,800,200); line(0,250,800,250); //vertical grid line(50,0,50,800); line(100,0,100,800); line(150,0,150,800); line(200,0,200,800); line(250,0,250,800); //boat strokeWeight(2); stroke(120,120,120); fill(75,75,75); rect(60,60,30,130); //explosion noStroke(); fill(100,0,0); ellipse(225,225,35,35); fill(155,0,0); ellipse(225,225,25,25); fill(255,0,0); ellipse(225,225,15,15); size(600, 600); background(255,255,255); stroke(255,255,255); strokeWeight(1); fill(0,150,0); ellipse(0,0,160,160); fill(0,100,0); ellipse(0,0,140,140); fill(0,50,0); ellipse(0,0,120,120); fill(250,0,0); ellipse(0,0,100,100); fill(200,0,0); ellipse(0,0,80,80); fill(150,0,0); ellipse(0,0,60,60); fill(100,0,0); ellipse(0,0,40,40); fill(50,0,0); ellipse(0,0,20,20); size(800, 600); background(100,100,100); stroke(0,0,0); strokeWeight(10); //head ellipse(200,200,80,80); //body line(200,240,200,340); //legs line(200,340,175,460); line(200,340,250,460); //upper arm line(200,240,170,300); size(800, 500); background(10,10,10); //stars stroke(255,255,255); ellipse(random(1,800),random(1,500),1,1); //sun fill(255,255,00); ellipse(400,255,100,100); //planet orbits noFill(); ellipse(400,255,200,150); ellipse(400,255,250,200); //planets fill(50,50,255); ellipse(500,255,15,15);