100codedays
100codedays
[PROCESSING] 100 days challenge
11 posts
Don't wanna be here? Send us removal request.
100codedays · 7 years ago
Text
Color
colorMode(): 
colorMode(HSB, 360, 100, 100);
HSB: hue, saturation, brightness
Hue:0° to 360°(color scala)
Saturation: %0(no saturation) to % 100(full saturation)
Brightness: %0 (dark,black) to %100 (light)
colorMode(RGB, 255, 255, 255 );
RGB: Red, green, blue
Red:0(no red) to 255(so red)
Green:0(no green) to 255(so green)
Blue: 0(no blue) to 255(so blue)
for colors:
fill(_,_,_);
fill(0,0,0); // RGB and Black
fill(255,255,255); //RGB and White
for greys:
fill(_);
fill(100);
0(black) to 255(white)
for Transparency: 
fill(_,_);  //2nd alpha
fil(_,_,_,_); //4th alpha
[alpha is also from 0 (0% opacity) to 255 (100% opacity)]
0 notes
100codedays · 7 years ago
Text
p1
void setup() {  size(720, 720); // size!!  noCursor(); } the setup() function sets the size of the display window and the cursor invisible. void draw() { ...  colorMode(HSB, 360, 100, 100);  // colorMode() allows users to change the way color value is interpreted. HSB specifies the color model. 
 rectMode(CENTER); //!!
 noStroke();  background(mouseY/2, 100, 100); // background!!  fill(360-mouseY/2, 100, 100);  rect(360, 360, mouseX+1, mouseX+1); ... } Mouse: position x: size of the rectangle, position y: Hue
0 notes
100codedays · 7 years ago
Photo
Tumblr media Tumblr media Tumblr media
p1
0 notes
100codedays · 7 years ago
Text
Mathematics 01
with simple numbers:
float a = (2 +2 .9) / 7;   After execution the value 0.7 is saved in a.
with strings:
String s = “circumference of Jupiter:” +(142348*PI) + “km”;  the variable s then contains the string “circumference of Jupiter: 424234.5 km”
with variables:
int i = myVariable*50; the value in myVariable is multiplied by 50 and the result saved in i.
0 notes
100codedays · 7 years ago
Text
Arrays
when working with a large number of values, it is inconvenient to create a variable for each value. an array allows a list of values to be managed.
String[ ] planets = {”Mercury”, “Venus”,”Earth”, “Mars”, “Jupiter”, “Saturn”, “Uranus”, “Neptune”);
println(planets[0]);
the square brackets after String indicate that variable planet should be created or initialized as an array of strings. this array will immediately be filled with eight values (the planet names).
Values can be accessed by entering an index number in the square brackets following the variable name. the index 0 points to the first entry in the array.
If values are not immediately assigned to an array, the array can be created first and filled later:
int[ ] planerDiameter = new inte[7];
planetDiameter[0] = 4678;
planetDiameter[0] = 6838;
planetDiameter[0] = 7532;
the value 7 in the square brackets initializes an array for seven values.
values are them assigned to the array. this could also happen later while the program is running.
....
0 notes
100codedays · 7 years ago
Text
Variables and Data types
int myVariable;
myVariable = 5;
the variable myVariable is created.
The value 5 is then saved there.
Variable types:
boolean myBoolean = true;  Logic values(Boolean Values): true or false
int MyInteger = 7;  Integers: e.g. 50, -384
float myFloat = -3.219;  Floating point value: e.g. 0.02, -73.2, 80.0
char myClar = ‘A’;  A single charactere.g. ‘a, ‘A’, ‘9′, ‘&’
String myString = “This is a text.”;  Character string/text:e.g. “Hello World”
0 notes
100codedays · 7 years ago
Photo
Tumblr media
Move, rotate, scale coordinate system:
translate(40,20);
rotate(0.5);
scale(1.5);
move the coordinates system 40 pixels to the right and 20 pixels downwards.
rotate it 0.5 radians(about 30 degrees),
scale it by a factor of 1.5
0 notes
100codedays · 7 years ago
Text
Display and renderer
size(640,480);
the display is now 640 pixels wide and 480 pixels high.
4 renderers:
size(640,480,JAVA2D);  standard renderer: this is used if nothing else has been specified,
size(640,480,P2D);  Processing 2D renderer, 
size(640,480 ,P3D ); Processing 3D renderer,better,
size(640,480,OPENGL); this requires OpenGL-compatible graphic hardware.
0 notes
100codedays · 7 years ago
Text
Setup and Draw
setup: once
draw: loop
void draw(){
println(frameCount);
}
println displays text in console area.
void setup(){
rameRate(30); 
}
to specify how many images are shown per second.
Standard number is 60 images per second, but this can be reset the command frameRate().
0 notes
100codedays · 7 years ago
Text
Commands 01
that draw 
ellipse, rec, line, point,..
how should be drawn
stroke, strokeWeight, noStroke, fill, nofill,.. 
0 notes
100codedays · 7 years ago
Text
hello ellipse
ellipse(70,70,60,60);
strokeWeight(4);
fill(128);
rect(50,50,40,30);
Draw an ellipse at the coordinates (70,70) with a width and height of 60 pixels. Set the line to 4 pixels. set the fill colour to a medium grey. Draw a rectangle at the coordinates (50,50) with a width of 40 and height of 30.
0 notes