mirror of
https://github.com/brendanhaines/javaProcessing.git
synced 2024-12-25 10:26:59 -07:00
adds DisplayNewQuad.java (improved quadcopter render)
This commit is contained in:
parent
4060ceaf2d
commit
8d4930c224
55
DisplayNewQuad.java
Normal file
55
DisplayNewQuad.java
Normal 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 );
|
||||||
|
}
|
||||||
|
}
|
2
Makefile
2
Makefile
|
@ -3,7 +3,7 @@ all: build run
|
||||||
run: run_tester3d
|
run: run_tester3d
|
||||||
|
|
||||||
build:
|
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:
|
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
|
java -cp '.:core.jar:gluegen-rt.jar:jogl-all.jar:gluegen-rt-natives-macosx-universal.jar:jogl-all-natives-macosx-universal.jar' tester
|
||||||
|
|
|
@ -22,7 +22,7 @@ class Tester3D {
|
||||||
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||||
frame.setLayout( new BorderLayout() );
|
frame.setLayout( new BorderLayout() );
|
||||||
|
|
||||||
area3d = new DisplayQuad( 80 );
|
area3d = new DisplayNewQuad( 80 );
|
||||||
frame.add( area3d, BorderLayout.CENTER );
|
frame.add( area3d, BorderLayout.CENTER );
|
||||||
area3d.init();
|
area3d.init();
|
||||||
while( area3d.defaultSize && !area3d.finished )
|
while( area3d.defaultSize && !area3d.finished )
|
||||||
|
|
Loading…
Reference in New Issue
Block a user