mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
Move the Primitives 3D example to Basics
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
/**
|
||||
* Primitives 3D.
|
||||
*
|
||||
* Placing mathematically 3D objects in synthetic space.
|
||||
* The lights() method reveals their imagined dimension.
|
||||
* The box() and sphere() functions each have one parameter
|
||||
* which is used to specify their size. These shapes are
|
||||
* positioned using the translate() function.
|
||||
*/
|
||||
|
||||
size(640, 360, P3D);
|
||||
background(0);
|
||||
lights();
|
||||
|
||||
noStroke();
|
||||
pushMatrix();
|
||||
translate(130, height/2, 0);
|
||||
rotateY(1.25);
|
||||
rotateX(-0.4);
|
||||
box(100);
|
||||
popMatrix();
|
||||
|
||||
noFill();
|
||||
stroke(255);
|
||||
pushMatrix();
|
||||
translate(500, height*0.35, -200);
|
||||
sphere(280);
|
||||
popMatrix();
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ void setup()
|
||||
|
||||
// Set the font and its size (in units of pixels)
|
||||
textFont(fontA);
|
||||
textAlign(CENTER);
|
||||
textAlign(CENTER, CENTER);
|
||||
|
||||
// Only draw once
|
||||
noLoop();
|
||||
@@ -32,7 +32,7 @@ void draw()
|
||||
// Set the left and top margin
|
||||
int margin = 6;
|
||||
int gap = 60;
|
||||
translate(margin*1.5, margin*2);
|
||||
translate(margin*10, margin*1.5);
|
||||
|
||||
// Create a matrix of letterforms
|
||||
int counter = 0;
|
||||
|
||||
Reference in New Issue
Block a user