mirror of
https://github.com/brendanhaines/javaProcessing.git
synced 2024-09-19 20:35:51 -06:00
55 lines
1.1 KiB
Java
55 lines
1.1 KiB
Java
|
class DisplayNewQuad extends Display3D {
|
||
|
|
||
|
public DisplayNewQuad() {
|
||
|
super();
|
||
|
}
|
||
|
|
||
|
public DisplayNewQuad( int bkgnd) {
|
||
|
super( bkgnd );
|
||
|
}
|
||
|
|
||
|
public void drawBackground() {
|
||
|
// sphere
|
||
|
pushMatrix();
|
||
|
rotateX((float)(Math.PI/2));
|
||
|
noFill();
|
||
|
stroke(100, 127 );
|
||
|
sphere( width );
|
||
|
popMatrix();
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
*
|
||
|
*/
|
||
|
public void drawObject() {
|
||
|
int s = 1;
|
||
|
fill( 255 );
|
||
|
|
||
|
rotateZ( (float)( Math.PI/4 ) );
|
||
|
translate( 80, 0, 0 );
|
||
|
box( 100, 10, 10 );
|
||
|
translate( -80, 0, 0 );
|
||
|
|
||
|
rotateZ( (float)( Math.PI/2 ) );
|
||
|
translate( 80, 0, 0 );
|
||
|
box( 100, 10, 10 );
|
||
|
translate( -80, 0, 0 );
|
||
|
|
||
|
fill( 255, 0, 0 );
|
||
|
|
||
|
rotateZ( (float)( Math.PI/2 ) );
|
||
|
translate( 80, 0, 0 );
|
||
|
box( 100, 10, 10 );
|
||
|
translate( -80, 0, 0 );
|
||
|
|
||
|
rotateZ( (float)( Math.PI/2 ) );
|
||
|
translate( 80, 0, 0 );
|
||
|
box( 100, 10, 10 );
|
||
|
translate( -80, 0, 0 );
|
||
|
|
||
|
rotateZ( (float)( Math.PI/4 ) );
|
||
|
|
||
|
fill( 20 );
|
||
|
box( 50, 50, 15 );
|
||
|
}
|
||
|
}
|