

When you run a script, NodeBox reads the code from top to bottom, like a recipe. Then all subsequent elements you draw have that color. All of the elements you draw have the same color, until you switch to a different color. So in NodeBox you "paint" with one color. Naturally, you could paint with both hands and feet holding multiple brushes with multiple colors. And the same texture according to the thickness and softness of the brush. All the lines you then paint on the canvas have the same color. When painting, you can hold one type of brush and put one color of paint on it. Image(self.img, 0, 0, self.img_width, self.The graphics state stores your current color and transformation settings. # max width and height are x1.5 of the original # min width and height are half of the original width and height
Nodebox text portrait update#
# Update the width and height of the image Update angle, width and height of the image This class creates a stretching image objectĭef _init_(self, img, x, y, angle_velocity): Super(Osc_img, self)._init_(centre, velocity, radius) Input image you want to rotate or stretch, Input angle velocity, center of the rotation,Īnd PImage you want to rorate or stretch.ĭef _init_(self, img, centre, velocity, radius): This module inherits the Oscillator class # Display method which can set the filling colourĭef display(self, ellipse_radius, colour):Īnd colour you want to fill(must be color object)Įllipse(self.x, self.y, ellipse_radius, ellipse_radius) # Display method which indicates the centre of rotation Self.amplitude = PVector(amplitude.x, amplitude.y) Self.velocity = PVector(velocity.x, velocity.y) Self.centre = PVector(centre.x, centre.y) # to enable subclasses to inherit this classĭef _init_(self, centre, velocity, amplitude):Ĭentre, velocity and amplitude must be PVector object. This code is based on Daniel Shiffman's in # Display face_front.png and stretch the mouth # locate the wobble centre to centre of the window

# To wobble window mildly, multiple small number to the frameCount # angle increases as the frame count increases # wobble the window and display the face_back.png # rotation centre, angle velocity, rotation_radius # Fit the window size to the image you want to display # Filling color for the oscillator objects # for the Oscillator objects (PVector objects) # rotation_centre, velocity, rotation radius list "face_front": loadImage("face_front.png"), Some part of my code is based on Nature of Code by Daniel Shiffman. “layer composition” of this sketch is like this.Īnd whole code is down below. If you prepare properly photoshopped facial images, you can rotate eyes of it. This sketch wobbles, rotates, stretches images. Tutorial about classes helped me a lot when I wrote this sketch. It is quite a fine language and I like it, but latest nodebox(Nodebox3) has become a node-based language as its name says and nodebox 1 doesn’t have some functions processing has such as imageMode().īy the way, tutorial of nodebox 1 might help you if you don’t know much about python. I prefer python mode to Nodebox, which is also a graphic programming language written in python. They implemented python mode recently, which enables us writing processing code in python syntax and liberate from semicolons and curly brackets. I wrote a sketch in python mode of Processing.
