done renaming
This commit is contained in:
15
Lektion 1/Lokale_Variablen/Mitte/Mitte.pde
Normal file
15
Lektion 1/Lokale_Variablen/Mitte/Mitte.pde
Normal file
@@ -0,0 +1,15 @@
|
||||
void setup()
|
||||
{
|
||||
size(800, 600);
|
||||
}
|
||||
void draw()
|
||||
{
|
||||
// Clear Background to prevent shadows
|
||||
background(40, 40, 40, 256);
|
||||
|
||||
|
||||
line(0, 0, mouseX, mouseY);
|
||||
|
||||
circle(mouseX, mouseY, 10);
|
||||
circle(mouseX * .5, mouseY * .5, 10);
|
||||
}
|
||||
24
Lektion 1/Lokale_Variablen/Zwillinge/Zwillinge.pde
Normal file
24
Lektion 1/Lokale_Variablen/Zwillinge/Zwillinge.pde
Normal file
@@ -0,0 +1,24 @@
|
||||
void setup()
|
||||
{
|
||||
size(800, 600);
|
||||
}
|
||||
void draw()
|
||||
{
|
||||
// Clear Background to prevent shadows
|
||||
background(40, 40, 40, 256);
|
||||
|
||||
//First circle
|
||||
fill(0, 50, 256);
|
||||
circle(mouseX, mouseY, 100);
|
||||
|
||||
// Second circle
|
||||
// project mouse pos between 0 and 1. Take inverse to get the point symmetric postion
|
||||
PVector fitMouse = new PVector((float) mouseX / (float) width, (float) mouseY / (float) height);
|
||||
PVector twinPos = new PVector((1.0f - fitMouse.x) * width, (1.0f - fitMouse.y) * height);
|
||||
|
||||
fill(256, 50, 0);
|
||||
circle(twinPos.x, twinPos.y, 100);
|
||||
|
||||
|
||||
//println(fitMouseX + ", " + inverseMouseX );
|
||||
}
|
||||
Reference in New Issue
Block a user