Posted: October 9th, 2010 | Author: admin | Filed under: Assignments | 15 Comments »
Review
This week we went over drawing functions using pushMatrix and popMatrix(), translate(), rotate() and scale(). We also explored the atan2() function and how it can be used to put objects in a certain direction.
For more information/further reading on this, along with more examples, please see the processing website and read over the following chapters in the book:
The Basics of Drawing with Processing (page 60)
Programming Graphics (page 289)
You should also be experimenting with the basic drawing commands such as line(), rect(), ellipse(), beginShape(), endShape(), etc. These should have been covered in Boot Camp but if you are not familiar with them or feel like you need a refresher let me know.
Code Examples
week6
Homework
Our first assignments have been pretty open ended, and have concentrated on a particular aspect of programming. This week I’d like everyone to follow directions and do similar assignments. This will (hopefully) be fun and give everyone an opportunity to combine everything they have learned so far and make a cohesive program.
The assignment is to create a monster, using code only (no images unless they are secondary, hair strands for example would be fine but an entire monster made of 1 image is not).
I made a VERY simple version of what you should be creating, and I commented the code into oblivion so hopefully it should help you along your way.
The creature should
- Live within a 500×500 processing sketch.
- White Background
- All classes as their own files (use tabs!)
- React to the mouse in some way  (mouse pressed, mouse moved, etc)
- Be completely contained in an object (the object can include other objects, see example)
- The object should be named after you (mine is called SteveMonster, you get the idea…)
- The constructor should take an argument for an x & y position
- You should translate any drawing to this x&y position first and draw relative to that position
- Other than that, go wild and try to use everything we’ve learned and some things that we haven’t!
The idea will be that since we are all coding correctly and using similar patterns we should be able to create a gallery of our monsters in class. Please try your best to stick to the requirements!
Please see the attached class files for a simple example that I made (its not really a monster but yours should be 🙂 ). This should follow the requirements completely. Notice that my main sketch does nothing but create my object, give it a position, and tell it to draw. Everything else happens in the object.
Please let me know if you have any questions, and take your time with this assignment. If everyone is able to complete this assignment correctly and creatively I will feel very comfortable letting everyone moving on to bigger projects and running class as more of a workshop and less of a show and tell/lecture format.
Thanks and make something awesome!
-Steve
PS Check here for some code examples + inspiration
http://www.rmx.cz/monsters/
Learn how people did things and don’t copy, just get inspired and change it up!
Posted: October 3rd, 2010 | Author: admin | Filed under: Assignments | 15 Comments »
Here are the files for the OOP examples we went through again during class, please add these to the existing files from last week so that you have a lot of examples of simple objects and how to use them.
oopWeek2
Your homework is to go back over your homework from last week and make it better. If you had problems last week, fix them. If you didn’t, expand upon last week’s homework and make it awesome! Think about how you can create different types of objects, try to make them work together, and take it further.
Also, try to make your homework have some sort of logical meaning or concept. It doesn’t have to be earth shattering but it would be good to have some basic explanation for what inspired you to make what you did. If you aren’t feeling very inspired, look to the real world (nature is great) and try to emulate something that exists physically.
As usual, email me with any questions/concerns and I’ll do my best to help you on your way.
Posted: September 24th, 2010 | Author: admin | Filed under: Assignments, Examples | 11 Comments »
This week we went over a lot, so try to look at the examples and play around with them before moving onto your assignment. I also recommend looking at Chapter 5 of the Programming interactivity book for a general overview of everything we went over in class. The section on OOP starts on page 129.
oopExamples
Homework Assignment
This weeks homework assignment will be similar to last week, but with a concentration on using objects. The requirements are:
-A minimum of 25 objects, which are stored in an array
-Different behaviors for the objects based on input (mouse position, mouse press/release, key presses, etc)
-All drawing of your object (ellipse(), rect(), etc, any call that directly draws to the screen) should be within your object
-All objects should not look the same, they can be similar but think about how you can use properties (variables) within the class to make them unique. Experiment with RGB, alpha, size, position, etc.
Bonus
-Use fonts or images instead of drawing shapes
-Create an object that contains a number of other objects, ie: a CircleGroup class that contains man Circle objects…
Try to think about what you want to do BEFORE you start to program and think about how it would make sense logically. It may be best to work with your classmates/ask questions of each other. As usual I am always available for help through email, but please have a specific question and code that shows you have tried to make things work.
Thanks and see you in class Thursday!
Posted: September 17th, 2010 | Author: admin | Filed under: Assignments, Examples | 12 Comments »
Files
Here are the class files that we created in class. Please check them out, play around with them and make sure you have a basic understanding of the concepts. We went over a lot of stuff in the first class, so feel free to send me an email if you are not quite understanding something or need some advice on where to learn more.
Someone brought up in class the fact that there are better books that concentrate on Processing in detail, and that these may be better for some students at this point. I can recommend the official Processing book by Casey Reas and Ben Fry as well as Daniel Shiffman’s book. If you really feel like you are not comfortable with the processing environment or just want to get into some advanced topics you should definitely look into these books.
ClassExamplesWeek3
Homework
For homework I’d like to continue along the mini-assignment format and have you apply the new concepts that we learned in class.
Please create a sketch that has a minimum of 100 items, all of which are stored in an array. Create a boolean that can be turned off and on using the keyboard and have all or some of the items in the array change based on the value of the boolean. Also use the mouse as input, so that when the mouse is pressed the items appear or act one way, and when the mouse is released they act another way.
Bonus: Use timing (either framerate or millis()) to change the appearance of the items over time.
The emphasis should be on creating well written code and understanding the concepts. The visuals can be as simple or complex as you would like. If you feel comfortable with everything we’ve gone over there is a lot of room for creativity within this assignment, so go crazy. If you really are still struggling with the concepts just create something simple and make sure it works.
As always if you have any questions email me and I’ll be happy to help.
Class Time
As I said on Thursday I have no problem with starting class at 3:15 so get some food, take your time coming to class and be ready to work when you get there.
Posted: September 13th, 2010 | Author: admin | Filed under: Assignments | 14 Comments »
For next week I would like everyone to read over/review the programming interactivity book through Chapter 3 “Processing” and make sure that you are comfortable with the topics mentioned. These basics should have been covered in boot camp, but if you don’t come from a programming background I STRONGLY suggest you go over them again. You may find that things that you didn’t quite grasp before will make sense now that you have had some practical experience. You don’t need to read everything word for work unless you are completely fresh to programming, in which case this would probably be in your best interest.
Once you have completed this reading/feel comfortable, you should play around with processing a bit and have a simple application ready for class on Thursday.
The guidelines for the application are as follows:
– Draw AT LEAST 1 shape through code
– Change AT LEAST 1 attribute of this shape (position, rotation, size, color, etc) through code based on keyboard or mouse interaction
– Provide a way everything to return to its original form
Super simple example:
Triangle drawn on the canvas, when a user clicks it rotates and changes color, when they release the mouse it goes back to it’s original rotation and color.
You can view this assignment as a bit of an evaluation of your skill level, so try your best and let me know if you need any help. Several of you have mentioned that you would like to get into openFrameworks, which would be really awesome, but I need to be sure that you have a firm grasp on the basics first, so put in a good effort.
Posting Your Homework
Homework should be uploaded to a web directory (I don’t care if you use a.parsons.edu or your own personal server), and then a link should be made to the applet (preferably to the html that processing creates). Create a comment under this post, using your name as the posting name, and provide a simple description of the applet and a link to it in the comments.
If anyone has any questions about this feel free to email me and I’ll help you out.
We will go over everyone’s work briefly in class thursday.