adds DisplayNewQuad.java (improved quadcopter render)

This commit is contained in:
Brendan Haines 2015-05-08 20:38:08 -06:00
parent 4060ceaf2d
commit 8d4930c224
3 changed files with 57 additions and 2 deletions

55
DisplayNewQuad.java Normal file
View File

@ -0,0 +1,55 @@
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 );
}
}

View File

@ -3,7 +3,7 @@ all: build run
run: run_tester3d
build:
javac -cp '.:core.jar:gluegen-rt.jar:jogl-all.jar:gluegen-rt-natives-macosx-universal.jar:jogl-all-natives-macosx-universal.jar' Display3D.java DisplayQuad.java Tester3D.java
javac -cp '.:core.jar:gluegen-rt.jar:jogl-all.jar:gluegen-rt-natives-macosx-universal.jar:jogl-all-natives-macosx-universal.jar' Display3D.java DisplayQuad.java Tester3D.java DisplayNewQuad.java
run_tester:
java -cp '.:core.jar:gluegen-rt.jar:jogl-all.jar:gluegen-rt-natives-macosx-universal.jar:jogl-all-natives-macosx-universal.jar' tester

View File

@ -22,7 +22,7 @@ class Tester3D {
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setLayout( new BorderLayout() );
area3d = new DisplayQuad( 80 );
area3d = new DisplayNewQuad( 80 );
frame.add( area3d, BorderLayout.CENTER );
area3d.init();
while( area3d.defaultSize && !area3d.finished )