Computer Science I Adding a timing feature. Classwork/Homework: finish final project. Prepare for review for final. Post on programming topic.

Slides:



Advertisements
Similar presentations
A Quick Introduction to Processing
Advertisements

© Calvin College, Being abstract is something profoundly different from being vague... The purpose of abstraction is not to be vague, but to create.
1. Tuesday: Halloween Shoot due TOMORROW. You must make a contact sheet of your photos and print it from my computer tomorrow. -5 pts for every day I don’t.
Cosc 5/4730 Game Design. A short game design primer. A game or animation is built on an animation loop. – Instance variables of “objects” are updated.
Images. PImage class PImage is a class for loading and displaying an image in Processing. Declare a PImage type: PImage img; Make a new instance by loading.
Data: Programming Design and Modularization IS 101Y/CMSC 101 Computational Thinking and Design Thursday, September 26, 2013 Marie desJardins University.
IAT 800 Lab 1: Loops, Animation, and Simple User Interaction.
ICM Week 2. Structure - statements and blocks of code Any single statement ends with semicolon ; When we want to bunch a few statements together we use.
Lecture 3 IAT 800. Sept 15, Fall 2006IAT 8002 Suggestions on learning to program  Spend a lot of time fiddling around with code –Programming is something.
PROCESSING Animation. Objectives Be able to create Processing animations Be able to create interactive Processing programs.
Scratch the Cat. Object Oriented Programing Writing computer programs Based on Objects Instead of Actions Based on Data Instead of Logic.
IAT 355 Lecture 4 Computer Graphics: Rocket. May 9, 2014IAT 3552 Outline  Programming concepts –Programming Computer Graphics –Transformations –Methods.
Introduction to TouchDevelop
We will be creating a spaceship that simulates real movements in space. The spaceship will fire a laser beam that can destroy targets. The spaceship will.
Programming Games Google Map API examples. CSS. Classwork/homework: Catch up. Upload work. Show your [more] complex Google Maps API example. Plan your.
SE 320 – Introduction to Game Development Lecture 8: Animations, GUIs, Debugging and IDEs Lecturer: Gazihan Alankuş Please look at the last two slides.
Keyboard and Events. What about the keyboard? Keyboard inputs can be used in many ways---not just for text The boolean variable keyPressed is true if.
KeyListener and Keyboard Events Another type of listener listens for keyboard entry – the KeyListener which generates KeyEvents –to implement KeyListener,
A way to pull together related data A Shape Class would contain the following data: x, y, height, width Then associate methods with that data A Shape.
Blender 2.5 Interface. The Blender Interface Penggunaan Mouse.
Click on these! %2Fblank%2Fbrowse.asp%3FA%3D383%26BMDRN%3D2000%26BCOB%3D0% 26C%3D64893.
Variables. Todays Lesson  In todays lesson you are going to:  Learn to use variables  Learn to ask for user input  Learn to save the users response.
CIS 3.5 Lecture 2.2 More programming with "Processing"
Test 2 Review. General Info. All tests are comprehensive. You are still responsible for the material covered prior to the first exam. You will be tested.
Computer Science I Classes and objects Classwork/Homework: Examine and modify my examples. Make your own.
______________________________________________________________________________________ SCHOOL OF INTERACTIVE ARTS + TECHNOLOGY [SIAT] |
Computer Science I Programming in Java (programming using Processing IN Java, using IntelliJ IDE) Classwork/Homework: copy your Processing projects over.
Computer Science I Arrays. Parallel structures. Classwork/Homework: Build your own bouncing things.
Computer Science I Recap: variables & functions. Images. Pseudo-random processing.
Computer Science I Looping. User input. Classwork/Homework: Incorporate looping & user input into a sketch.
Word 2007® Business and Personal Communication How can Microsoft Word 2007 help you work with others?
Computer Science I Share plans for virtual something. Text. Show my virtual dog. Classwork: Plans for your virtual something. Homework: start implementation.
Processing TYWu. Where can I download? 2.0b9 Windows 32-bit.
ENEE150 – 0102 ANDREW GOFFIN More With Pointers. Importance of Pointers Dynamic Memory (relevant with malloc) Passing By Reference Pointer Arithmetic.
Review Random numbers mouseX, mouseY setup() & draw() frameRate(), loop(), noLoop() Mouse and Keyboard interaction Arcs, curves, bézier curves, custom.
Computer Science I Text input. Transformations. Yet another jigsaw. Classwork/Homework: Create new application making use of transformations.
Computer Science I Animations. Bouncing ball. The if statement. Classwork/homework: bouncing something. Compress and upload work to Moodle.
Computer Science I Go over midterm. Reprise on curves. Table examples. The map function. Testing Strings. Fonts. Classwork/Homework: Complete midterm project.
Computer Science I Looking at code: "Where did Prof. Shablinsky go" Classwork/homework: midterm projects.
Computer Science I More class examples. Paths. Jigsaw. Tolerance. Classwork/homework: Your class project. Post proposal for midterm project.
Computer Science I Slingshot example. ProcessingJS example. Review for midterm quiz. Classwork/Homework: study for midterm. Work on midterm project.
Time to upload Virtual something.
Computer Science I Libraries. Sound. Saving frames as images. Classwork/Homework: Make sketch using sound. Add saving frames.
Creating User Interfaces Reprise on guest speaker. Usability checklists. Reprise on user- centered. Semantic tags. Responsive design. Classwork/homework:
The Stingray Example Program CMT3311. Stingray - an example 2D game May be useful as a simple case study Most 2D games need to solve generic problems.
Computer Science I Split. Regular Expressions Classwork: Trivia questions. Share. Show (stage 1) final project. Homework: work on final project.
Scratch Programming Cards
Advanced Higher Computing Science
Some of Chap 17.
Computer Graphics: Rocket, Java: Class
Static Detection of Cross-Site Scripting Vulnerabilities
Introduction to Event-Driven Programming
Classwork: Examine and enhance falling drop(s) or make your own.
Computer Science I Variables. Methods.
Chapter 14, Translate & Rotate
LCC 6310 Computation as an Expressive Medium
Using the Stopwatch object
Roller Coaster Design Project
Programming Games Mouse position. Examples. Review for final quiz.
Introduction to Object-Oriented Programming
CIS 470 Mobile App Development
For Net Art Lecture 2 J Parker
Chapter 10 Algorithms.
Computer Science I Fonts. Building on one jigsaw to make another.
Chapter 10 Algorithms.
More programming with "Processing"
Programming for Art: Images
LCC 6310 Computation as an Expressive Medium
Chapter 10 Algorithms.
Exploring Computer Science Lesson 4-14
Presentation transcript:

Computer Science I Adding a timing feature. Classwork/Homework: finish final project. Prepare for review for final. Post on programming topic.

Objective Add to rotating cube of photos sketch the feature that cube rotates by itself if user does nothing. How to detect nothing happening????

How to detect the absence of an event? Answer in this case – keep track of time since last mouseDragged invocation. Use millis() and two global variables. int last; int interval = 6000; //time to wait Initialize last in setup function last = millis(); //time since program started Set (reset) last in mouseDragged – This will happen again and again while mouse is dragged. Check in draw

void mouseDragged() { float rate = 0.01; last = millis(); rotx += (pmouseY-mouseY) * rate; roty += (mouseX-pmouseX) * rate; }

void draw() { background(0); textSize(20); text("Drag using mouse anywhere on screen to rotate cube. If no action, cube will rotate by itself.",17,14); noStroke(); translate(width/2.0, height/2.0, -100); if ((millis()-last) > interval) { setRotation(); } rotateX(rotx); rotateY(roty); scale(200); TexturedCube(frog,flowers,makeup); }

Made a distinct function void setRotation() { rotx += PI/400; roty += PI/400; } Experimented with PI/400 to get speed what seemed appropriate.

How to allow viewer to add file(s) This is considered a security risk. – May not be able to do it in ProcessingJS Add code – Use an array, originally with 3 images – Program keyPressed Which calls selectInput, which sets up a callback: names a function to be called when user either selects a file or hits cancel

void keyPressed () { selectInput("Select an image file, or hit cancel.","fileSelected"); } void fileSelected(File selection) { PImage img; if (selection == null) { println("Window was closed or the user hit cancel."); } else { img = loadImage(selection.getAbsolutePath()); picfiles = (PImage[]) append(picfiles,img); selectInput("Select an image file, or hit cancel.","fileSelected"); }

Classwork/homework Work on final project: due 5/2. Prepare for final quiz 5/9. – Look at guide to final. Ask questions now or next class. One last posting: Think about Processing and doing Processing. Compare with using other computer tools. Compare with other programming languages, if you are familiar with other languages. Post to the appropriate forum.