Processing Assign 1
Learning to Draw
Save a new Processing file as Assign1Draw.
Your goal is to draw one of the following things/scenes.
Your drawing must include:
Need to center a rectangle?
Need help with colour? Try http://processing.org/tutorials. There is a tutorial on shapes and a separate one dealing with colours.
Too easy? Once you are done, add some text. Text can be simple (not much more difficult than drawing a shape) or complex (scrolling, spinning ,curved, etc.) The following tutorial will show you how. Be aware that it takes THREE lines of code to create and use a new font.
Learning to Draw
Save a new Processing file as Assign1Draw.
Your goal is to draw one of the following things/scenes.
- a house on a street
- an ipod
- a car or truck
- a snowman
- a robot
- hockey card
- or game card image
- or an ID Card
- any other scene that you can think of
Your drawing must include:
- A resized window
- Background colour
- At least 10 shapes, including all of the following:
- lines
- rectangles
- ellipses
- some shapes must be filled, using multiple colours
- multiple stroke thicknesses such as strokeWeight(5);
- an embedded picture (To learn how to do this see below)
Need to center a rectangle?
- Start with: rectMode(CENTER);
- Then specify the center points instead of the corner: rect(center, center, size, size)
Need help with colour? Try http://processing.org/tutorials. There is a tutorial on shapes and a separate one dealing with colours.
Too easy? Once you are done, add some text. Text can be simple (not much more difficult than drawing a shape) or complex (scrolling, spinning ,curved, etc.) The following tutorial will show you how. Be aware that it takes THREE lines of code to create and use a new font.
- Text Tutorial - Link to the site but scroll down to the section called Displaying Text. http://www.processing.org/tutorials/text/
For Adding Pictures - http://processing.org/tutorials/pixels/. or follow these instructions:
- Save a picture with a simple name.
- In Processing, choose Sketch… Add File and go find that picture you just saved
- Set up the picture with these two lines:
- PImage bikeImg;
- bikeImg = loadImage("bike.jpg");
- You can now add that image as many times as you want using one of the following lines of code
- image(bikeImg, x ,y, width_you_want, height_you_want);
- OR image(bikeImg, 25,100); This will just use the picture’s normal width and height.