diff --git a/DisplayNewQuad.java b/DisplayNewQuad.java new file mode 100644 index 0000000..020e6d0 --- /dev/null +++ b/DisplayNewQuad.java @@ -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 ); + } +} \ No newline at end of file diff --git a/Makefile b/Makefile index f62cffa..64e4b1a 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/Tester3D.java b/Tester3D.java index d72e74c..6a7ec21 100644 --- a/Tester3D.java +++ b/Tester3D.java @@ -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 )