diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml
new file mode 100644
index 0000000..b6f4091
--- /dev/null
+++ b/.idea/inspectionProfiles/Project_Default.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
index 9411eec..8c66cbc 100644
--- a/.idea/modules.xml
+++ b/.idea/modules.xml
@@ -2,7 +2,7 @@
-
+
\ No newline at end of file
diff --git a/.idea/uiDesigner.xml b/.idea/uiDesigner.xml
new file mode 100644
index 0000000..e96534f
--- /dev/null
+++ b/.idea/uiDesigner.xml
@@ -0,0 +1,124 @@
+
+
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+
+
+ -
+
+
+ -
+
+
+
+
+
\ No newline at end of file
diff --git a/Assignment3.iml b/Project1.iml
similarity index 100%
rename from Assignment3.iml
rename to Project1.iml
diff --git a/bin/GraphicsObjects/Arcball.class b/bin/GraphicsObjects/Arcball.class
deleted file mode 100644
index 1fa1fde..0000000
Binary files a/bin/GraphicsObjects/Arcball.class and /dev/null differ
diff --git a/bin/GraphicsObjects/Point4f.class b/bin/GraphicsObjects/Point4f.class
deleted file mode 100644
index 607119b..0000000
Binary files a/bin/GraphicsObjects/Point4f.class and /dev/null differ
diff --git a/bin/GraphicsObjects/Utils.class b/bin/GraphicsObjects/Utils.class
deleted file mode 100644
index c4ca330..0000000
Binary files a/bin/GraphicsObjects/Utils.class and /dev/null differ
diff --git a/bin/GraphicsObjects/Vector4f.class b/bin/GraphicsObjects/Vector4f.class
deleted file mode 100644
index f124ed7..0000000
Binary files a/bin/GraphicsObjects/Vector4f.class and /dev/null differ
diff --git a/bin/GraphicsObjects/quat.class b/bin/GraphicsObjects/quat.class
deleted file mode 100644
index 0ab9924..0000000
Binary files a/bin/GraphicsObjects/quat.class and /dev/null differ
diff --git a/bin/META-INF/MANIFEST.MF b/bin/META-INF/MANIFEST.MF
deleted file mode 100644
index c2184f5..0000000
--- a/bin/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,3 +0,0 @@
-Manifest-Version: 1.0
-Main-Class: MainWindow
-
diff --git a/bin/MainWindow.class b/bin/MainWindow.class
deleted file mode 100644
index 50278cd..0000000
Binary files a/bin/MainWindow.class and /dev/null differ
diff --git a/bin/Scene/Objects/Ground.class b/bin/Scene/Objects/Ground.class
new file mode 100644
index 0000000..f707049
Binary files /dev/null and b/bin/Scene/Objects/Ground.class differ
diff --git a/bin/Scene/Objects/Human.class b/bin/Scene/Objects/Human.class
new file mode 100644
index 0000000..d3ffb52
Binary files /dev/null and b/bin/Scene/Objects/Human.class differ
diff --git a/bin/Scene/Objects/LAVA_Door.class b/bin/Scene/Objects/LAVA_Door.class
new file mode 100644
index 0000000..ba769f5
Binary files /dev/null and b/bin/Scene/Objects/LAVA_Door.class differ
diff --git a/bin/Scene/Objects/TNT_Door.class b/bin/Scene/Objects/TNT_Door.class
new file mode 100644
index 0000000..b0461fa
Binary files /dev/null and b/bin/Scene/Objects/TNT_Door.class differ
diff --git a/bin/Scene/Objects/Wall.class b/bin/Scene/Objects/Wall.class
new file mode 100644
index 0000000..f17b44a
Binary files /dev/null and b/bin/Scene/Objects/Wall.class differ
diff --git a/bin/Scene/Scene$1.class b/bin/Scene/Scene$1.class
new file mode 100644
index 0000000..660b7ca
Binary files /dev/null and b/bin/Scene/Scene$1.class differ
diff --git a/bin/Scene/Scene.class b/bin/Scene/Scene.class
new file mode 100644
index 0000000..5339631
Binary files /dev/null and b/bin/Scene/Scene.class differ
diff --git a/bin/Scene/base/IDrawListener.class b/bin/Scene/base/IDrawListener.class
new file mode 100644
index 0000000..8c83fc2
Binary files /dev/null and b/bin/Scene/base/IDrawListener.class differ
diff --git a/bin/Scene/base/IDrawable.class b/bin/Scene/base/IDrawable.class
new file mode 100644
index 0000000..41ccc05
Binary files /dev/null and b/bin/Scene/base/IDrawable.class differ
diff --git a/bin/Scene/base/IMovable.class b/bin/Scene/base/IMovable.class
new file mode 100644
index 0000000..b5460d3
Binary files /dev/null and b/bin/Scene/base/IMovable.class differ
diff --git a/bin/Scene/base/IScalable.class b/bin/Scene/base/IScalable.class
new file mode 100644
index 0000000..885c794
Binary files /dev/null and b/bin/Scene/base/IScalable.class differ
diff --git a/bin/Scene/base/SceneManager.class b/bin/Scene/base/SceneManager.class
new file mode 100644
index 0000000..71cb11d
Binary files /dev/null and b/bin/Scene/base/SceneManager.class differ
diff --git a/bin/Scene/base/SceneObject.class b/bin/Scene/base/SceneObject.class
new file mode 100644
index 0000000..17f330a
Binary files /dev/null and b/bin/Scene/base/SceneObject.class differ
diff --git a/bin/base/GraphicsObjects/Arcball.class b/bin/base/GraphicsObjects/Arcball.class
new file mode 100644
index 0000000..739fd39
Binary files /dev/null and b/bin/base/GraphicsObjects/Arcball.class differ
diff --git a/bin/base/GraphicsObjects/Point4f.class b/bin/base/GraphicsObjects/Point4f.class
new file mode 100644
index 0000000..e9f9806
Binary files /dev/null and b/bin/base/GraphicsObjects/Point4f.class differ
diff --git a/bin/base/GraphicsObjects/Utils.class b/bin/base/GraphicsObjects/Utils.class
new file mode 100644
index 0000000..8b0fd0c
Binary files /dev/null and b/bin/base/GraphicsObjects/Utils.class differ
diff --git a/bin/base/GraphicsObjects/Vector4f.class b/bin/base/GraphicsObjects/Vector4f.class
new file mode 100644
index 0000000..767d538
Binary files /dev/null and b/bin/base/GraphicsObjects/Vector4f.class differ
diff --git a/bin/base/GraphicsObjects/quat.class b/bin/base/GraphicsObjects/quat.class
new file mode 100644
index 0000000..aa24f67
Binary files /dev/null and b/bin/base/GraphicsObjects/quat.class differ
diff --git a/bin/base/RenderProgramStatement.class b/bin/base/RenderProgramStatement.class
new file mode 100644
index 0000000..95e4a4d
Binary files /dev/null and b/bin/base/RenderProgramStatement.class differ
diff --git a/bin/objects3D/Cube.class b/bin/base/objects3D/Cube.class
similarity index 58%
rename from bin/objects3D/Cube.class
rename to bin/base/objects3D/Cube.class
index 27f8711..3c850e0 100644
Binary files a/bin/objects3D/Cube.class and b/bin/base/objects3D/Cube.class differ
diff --git a/bin/objects3D/Cylinder.class b/bin/base/objects3D/Cylinder.class
similarity index 60%
rename from bin/objects3D/Cylinder.class
rename to bin/base/objects3D/Cylinder.class
index ec78548..b2167ee 100644
Binary files a/bin/objects3D/Cylinder.class and b/bin/base/objects3D/Cylinder.class differ
diff --git a/bin/objects3D/Grid.class b/bin/base/objects3D/Grid.class
similarity index 57%
rename from bin/objects3D/Grid.class
rename to bin/base/objects3D/Grid.class
index c2ac57a..da9144c 100644
Binary files a/bin/objects3D/Grid.class and b/bin/base/objects3D/Grid.class differ
diff --git a/bin/objects3D/Sphere.class b/bin/base/objects3D/Sphere.class
similarity index 84%
rename from bin/objects3D/Sphere.class
rename to bin/base/objects3D/Sphere.class
index a430557..8c60245 100644
Binary files a/bin/objects3D/Sphere.class and b/bin/base/objects3D/Sphere.class differ
diff --git a/bin/objects3D/TexCube.class b/bin/base/objects3D/TexCube.class
similarity index 74%
rename from bin/objects3D/TexCube.class
rename to bin/base/objects3D/TexCube.class
index be796d9..d3b951b 100644
Binary files a/bin/objects3D/TexCube.class and b/bin/base/objects3D/TexCube.class differ
diff --git a/bin/objects3D/TexSphere.class b/bin/base/objects3D/TexSphere.class
similarity index 79%
rename from bin/objects3D/TexSphere.class
rename to bin/base/objects3D/TexSphere.class
index a78e3e3..4518cdf 100644
Binary files a/bin/objects3D/TexSphere.class and b/bin/base/objects3D/TexSphere.class differ
diff --git a/bin/main/Camera.class b/bin/main/Camera.class
new file mode 100644
index 0000000..648ac68
Binary files /dev/null and b/bin/main/Camera.class differ
diff --git a/bin/main/Engine.class b/bin/main/Engine.class
new file mode 100644
index 0000000..fd53377
Binary files /dev/null and b/bin/main/Engine.class differ
diff --git a/bin/main/Main$1.class b/bin/main/Main$1.class
new file mode 100644
index 0000000..a25d9d8
Binary files /dev/null and b/bin/main/Main$1.class differ
diff --git a/bin/main/Main.class b/bin/main/Main.class
new file mode 100644
index 0000000..1ada7d8
Binary files /dev/null and b/bin/main/Main.class differ
diff --git a/bin/main/MainWindow$1.class b/bin/main/MainWindow$1.class
new file mode 100644
index 0000000..a20104c
Binary files /dev/null and b/bin/main/MainWindow$1.class differ
diff --git a/bin/main/MainWindow.class b/bin/main/MainWindow.class
new file mode 100644
index 0000000..4753f24
Binary files /dev/null and b/bin/main/MainWindow.class differ
diff --git a/bin/main/Util.class b/bin/main/Util.class
new file mode 100644
index 0000000..30f3f1d
Binary files /dev/null and b/bin/main/Util.class differ
diff --git a/bin/objects3D/Human.class b/bin/objects3D/Human.class
deleted file mode 100644
index 8a04469..0000000
Binary files a/bin/objects3D/Human.class and /dev/null differ
diff --git a/hs_err_pid3890.log b/hs_err_pid3890.log
new file mode 100644
index 0000000..e497c55
--- /dev/null
+++ b/hs_err_pid3890.log
@@ -0,0 +1,612 @@
+#
+# A fatal error has been detected by the Java Runtime Environment:
+#
+# SIGSEGV (0xb) at pc=0x00007fff202734af, pid=3890, tid=0x0000000000000f03
+#
+# JRE version: Java(TM) SE Runtime Environment (8.0_271-b09) (build 1.8.0_271-b09)
+# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.271-b09 mixed mode bsd-amd64 compressed oops)
+# Problematic frame:
+# C [libobjc.A.dylib+0x84af] objc_release+0x1f
+#
+# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
+#
+# If you would like to submit a bug report, please visit:
+# http://bugreport.java.com/bugreport/crash.jsp
+# The crash happened outside the Java Virtual Machine in native code.
+# See problematic frame for where to report the bug.
+#
+
+--------------- T H R E A D ---------------
+
+Current thread (0x00007fb00d009000): JavaThread "main" [_thread_in_native, id=3843, stack(0x000070000798c000,0x0000700007a8c000)]
+
+siginfo: si_signo: 11 (SIGSEGV), si_code: 1 (SEGV_MAPERR), si_addr: 0x0000000000000020
+
+Registers:
+RAX=0x6000000000000000, RBX=0x0000000000000001, RCX=0x0000000000000000, RDX=0x0000000000000007
+RSP=0x0000700007a8b498, RBP=0x0000700007a8b4d0, RSI=0x00007fb009558df0, RDI=0x00007fb00b840820
+R8 =0x00007fb0099046c8, R9 =0x0000000000000000, R10=0x00007fb00b8277b0, R11=0x00007fff22c9eb3a
+R12=0x00007fb00b840820, R13=0xa3a3a3a3a3a3a3a3, R14=0x00007fb00a01b090, R15=0x00007fb00a01b000
+RIP=0x00007fff202734af, EFLAGS=0x0000000000010246, ERR=0x0000000000000004
+ TRAPNO=0x000000000000000e
+
+Top of Stack: (sp=0x0000700007a8b498)
+0x0000700007a8b498: 00007fff2029120f 85fd44d75ac60000
+0x0000700007a8b4a8: 00007fb00a01b000 00007fb00b83c300
+0x0000700007a8b4b8: 000000010ec1c910 00007fff7bacafbf
+0x0000700007a8b4c8: 00007fb00d0091f8 0000700007a8b4f0
+0x0000700007a8b4d8: 00007fff20273e30 85fd44d75ac6009f
+0x0000700007a8b4e8: 00007fb00a01b090 0000700007a8b510
+0x0000700007a8b4f8: 00007fff2048da66 85fd44d75ac6009f
+0x0000700007a8b508: 00007fb00b83c300 0000700007a8b550
+0x0000700007a8b518: 00007fff21219123 00007fff872e50d8
+0x0000700007a8b528: 0000000000000000 00007fb0094320b0
+0x0000700007a8b538: 85fd44d75ac6009f 00007fb00b960820
+0x0000700007a8b548: 00007fb00973c310 0000700007a8b580
+0x0000700007a8b558: 000000012d59ccce 000000010ec1c918
+0x0000700007a8b568: 0000000000000000 0000700007a8b608
+0x0000700007a8b578: 00007fb00d009000 0000700007a8b5e0
+0x0000700007a8b588: 0000000111ba56c7 000000076b80f300
+0x0000700007a8b598: 0000000111ba53e2 0000700007a8b5a0
+0x0000700007a8b5a8: 000000010ec1c910 0000700007a8b608
+0x0000700007a8b5b8: 000000010ec1ce78 0000000000000000
+0x0000700007a8b5c8: 000000010ec1c918 0000000000000000
+0x0000700007a8b5d8: 0000700007a8b600 0000700007a8b650
+0x0000700007a8b5e8: 0000000111b952bd 000000076b8fb568
+0x0000700007a8b5f8: 0000000111b9ed18 000000076b90fb48
+0x0000700007a8b608: 000000076b80f300 0000700007a8b610
+0x0000700007a8b618: 000000010ec1c817 0000700007a8b680
+0x0000700007a8b628: 000000010ec1ce78 0000000000000000
+0x0000700007a8b638: 000000010ec1c888 0000700007a8b600
+0x0000700007a8b648: 0000700007a8b670 0000700007a8b6d8
+0x0000700007a8b658: 0000000111b95302 0000000000000000
+0x0000700007a8b668: 000000076b80f300 000000076b90fb48
+0x0000700007a8b678: 000000076b80f248 000000076b8fb5f8
+0x0000700007a8b688: 0000000000000001 000000076b8fb608
+
+Instructions: (pc=0x00007fff202734af)
+0x00007fff2027348f: 90 48 85 ff 74 76 89 f8 83 e0 01 48 85 c0 75 6c
+0x00007fff2027349f: 48 8b 07 48 b9 f8 ff ff ff ff 7f 00 00 48 21 c1
+0x00007fff202734af: 48 8b 51 20 f6 c2 04 74 54 a8 01 74 6f 48 b9 00
+0x00007fff202734bf: 00 00 00 00 00 80 00 48 ba 00 00 00 00 00 00 00
+
+Register to memory mapping:
+
+RAX=0x6000000000000000 is an unknown value
+RBX=0x0000000000000001 is an unknown value
+RCX=0x0000000000000000 is an unknown value
+RDX=0x0000000000000007 is an unknown value
+RSP=0x0000700007a8b498 is pointing into the stack for thread: 0x00007fb00d009000
+RBP=0x0000700007a8b4d0 is pointing into the stack for thread: 0x00007fb00d009000
+RSI=0x00007fb009558df0 is an unknown value
+RDI=0x00007fb00b840820 is an unknown value
+R8 =0x00007fb0099046c8 is an unknown value
+R9 =0x0000000000000000 is an unknown value
+R10=0x00007fb00b8277b0 is an unknown value
+R11=0x00007fff22c9eb3a: -[NSResponder release]+0 in /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit at 0x00007fff22c93000
+R12=0x00007fb00b840820 is an unknown value
+R13=0xa3a3a3a3a3a3a3a3 is an unknown value
+R14=0x00007fb00a01b090 is an unknown value
+R15=0x00007fb00a01b000 is an unknown value
+
+
+Stack: [0x000070000798c000,0x0000700007a8c000], sp=0x0000700007a8b498, free space=1021k
+Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
+C [libobjc.A.dylib+0x84af] objc_release+0x1f
+C [libobjc.A.dylib+0x8e30] objc_autoreleasePoolPop+0xa1
+C [CoreFoundation+0x42a66] _CFAutoreleasePoolPop+0x16
+C [Foundation+0x1f123] -[NSAutoreleasePool release]+0x83
+C [liblwjgl.dylib+0x16cce] Java_org_lwjgl_opengl_MacOSXContextImplementation_setView+0x10e
+j org.lwjgl.opengl.MacOSXContextImplementation.setView(Ljava/nio/ByteBuffer;Ljava/nio/ByteBuffer;)V+0
+j org.lwjgl.opengl.MacOSXContextImplementation.makeCurrent(Lorg/lwjgl/opengl/PeerInfo;Ljava/nio/ByteBuffer;)V+7
+j org.lwjgl.opengl.ContextGL.makeCurrent()V+46
+j org.lwjgl.opengl.DrawableGL.makeCurrent()V+14
+j org.lwjgl.opengl.Display.makeCurrent()V+3
+j org.lwjgl.opengl.Display.makeCurrentAndSetSwapInterval()V+0
+j org.lwjgl.opengl.Display.create(Lorg/lwjgl/opengl/PixelFormat;Lorg/lwjgl/opengl/Drawable;Lorg/lwjgl/opengl/ContextAttribs;)V+108
+j org.lwjgl.opengl.Display.create(Lorg/lwjgl/opengl/PixelFormat;)V+12
+j org.lwjgl.opengl.Display.create()V+7
+j main.Engine.(II)V+16
+j main.Main.main([Ljava/lang/String;)V+10
+v ~StubRoutines::call_stub
+V [libjvm.dylib+0x2d4795]
+V [libjvm.dylib+0x30582b]
+V [libjvm.dylib+0x308edb]
+C [java+0x316c] JavaMain+0x9dc
+C [libsystem_pthread.dylib+0x68fc] _pthread_start+0xe0
+C [libsystem_pthread.dylib+0x2443] thread_start+0xf
+C 0x0000000000000000
+
+Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
+j org.lwjgl.opengl.MacOSXContextImplementation.setView(Ljava/nio/ByteBuffer;Ljava/nio/ByteBuffer;)V+0
+j org.lwjgl.opengl.MacOSXContextImplementation.makeCurrent(Lorg/lwjgl/opengl/PeerInfo;Ljava/nio/ByteBuffer;)V+7
+j org.lwjgl.opengl.ContextGL.makeCurrent()V+46
+j org.lwjgl.opengl.DrawableGL.makeCurrent()V+14
+j org.lwjgl.opengl.Display.makeCurrent()V+3
+j org.lwjgl.opengl.Display.makeCurrentAndSetSwapInterval()V+0
+j org.lwjgl.opengl.Display.create(Lorg/lwjgl/opengl/PixelFormat;Lorg/lwjgl/opengl/Drawable;Lorg/lwjgl/opengl/ContextAttribs;)V+108
+j org.lwjgl.opengl.Display.create(Lorg/lwjgl/opengl/PixelFormat;)V+12
+j org.lwjgl.opengl.Display.create()V+7
+j main.Engine.(II)V+16
+j main.Main.main([Ljava/lang/String;)V+10
+v ~StubRoutines::call_stub
+
+--------------- P R O C E S S ---------------
+
+Java Threads: ( => current thread )
+ 0x00007fb00c8ee000 JavaThread "AWT-Shutdown" [_thread_blocked, id=31527, stack(0x0000700009c78000,0x0000700009d78000)]
+ 0x00007fb00d066800 JavaThread "AppKit Thread" daemon [_thread_in_native, id=259, stack(0x00007ffeeb71b000,0x00007ffeebf1b000)]
+ 0x00007fb00d850800 JavaThread "Service Thread" daemon [_thread_blocked, id=39427, stack(0x00007000099ef000,0x0000700009aef000)]
+ 0x00007fb00d04c000 JavaThread "C1 CompilerThread11" daemon [_thread_blocked, id=39939, stack(0x00007000098ec000,0x00007000099ec000)]
+ 0x00007fb00c020800 JavaThread "C1 CompilerThread10" daemon [_thread_blocked, id=40451, stack(0x00007000097e9000,0x00007000098e9000)]
+ 0x00007fb00c020000 JavaThread "C1 CompilerThread9" daemon [_thread_blocked, id=23811, stack(0x00007000096e6000,0x00007000097e6000)]
+ 0x00007fb00c01f000 JavaThread "C1 CompilerThread8" daemon [_thread_blocked, id=23299, stack(0x00007000095e3000,0x00007000096e3000)]
+ 0x00007fb00a040800 JavaThread "C2 CompilerThread7" daemon [_thread_blocked, id=40963, stack(0x00007000094e0000,0x00007000095e0000)]
+ 0x00007fb00a040000 JavaThread "C2 CompilerThread6" daemon [_thread_blocked, id=41475, stack(0x00007000093dd000,0x00007000094dd000)]
+ 0x00007fb00a01d000 JavaThread "C2 CompilerThread5" daemon [_thread_blocked, id=41731, stack(0x00007000092da000,0x00007000093da000)]
+ 0x00007fb00a01c000 JavaThread "C2 CompilerThread4" daemon [_thread_blocked, id=42243, stack(0x00007000091d7000,0x00007000092d7000)]
+ 0x00007fb00b098800 JavaThread "C2 CompilerThread3" daemon [_thread_blocked, id=22531, stack(0x00007000090d4000,0x00007000091d4000)]
+ 0x00007fb00b098000 JavaThread "C2 CompilerThread2" daemon [_thread_blocked, id=42755, stack(0x0000700008fd1000,0x00007000090d1000)]
+ 0x00007fb00b097000 JavaThread "C2 CompilerThread1" daemon [_thread_blocked, id=43011, stack(0x0000700008ece000,0x0000700008fce000)]
+ 0x00007fb00b096800 JavaThread "C2 CompilerThread0" daemon [_thread_blocked, id=21763, stack(0x0000700008dcb000,0x0000700008ecb000)]
+ 0x00007fb00d82d800 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, id=16643, stack(0x0000700008cc8000,0x0000700008dc8000)]
+ 0x00007fb00a818000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=15875, stack(0x0000700008bc5000,0x0000700008cc5000)]
+ 0x00007fb00c01d800 JavaThread "Finalizer" daemon [_thread_blocked, id=13315, stack(0x00007000089bc000,0x0000700008abc000)]
+ 0x00007fb00c01b000 JavaThread "Reference Handler" daemon [_thread_blocked, id=13059, stack(0x00007000088b9000,0x00007000089b9000)]
+=>0x00007fb00d009000 JavaThread "main" [_thread_in_native, id=3843, stack(0x000070000798c000,0x0000700007a8c000)]
+
+Other Threads:
+ 0x00007fb00c838000 VMThread [stack: 0x00007000087b6000,0x00007000088b6000] [id=12803]
+ 0x00007fb00a01e800 WatcherThread [stack: 0x0000700009af2000,0x0000700009bf2000] [id=38915]
+
+VM state:not at safepoint (normal execution)
+
+VM Mutex/Monitor currently owned by a thread: None
+
+heap address: 0x00000006c0000000, size: 4096 MB, Compressed Oops mode: Zero based, Oop shift amount: 3
+Narrow klass base: 0x0000000000000000, Narrow klass shift: 3
+Compressed class space size: 1073741824 Address: 0x00000007c0000000
+
+Heap:
+ PSYoungGen total 76288K, used 14418K [0x000000076ab00000, 0x0000000770000000, 0x00000007c0000000)
+ eden space 65536K, 22% used [0x000000076ab00000,0x000000076b914af8,0x000000076eb00000)
+ from space 10752K, 0% used [0x000000076f580000,0x000000076f580000,0x0000000770000000)
+ to space 10752K, 0% used [0x000000076eb00000,0x000000076eb00000,0x000000076f580000)
+ ParOldGen total 175104K, used 0K [0x00000006c0000000, 0x00000006cab00000, 0x000000076ab00000)
+ object space 175104K, 0% used [0x00000006c0000000,0x00000006c0000000,0x00000006cab00000)
+ Metaspace used 5709K, capacity 5882K, committed 6144K, reserved 1056768K
+ class space used 636K, capacity 729K, committed 768K, reserved 1048576K
+
+Card table byte_map: [0x000000010d1ce000,0x000000010d9cf000] byte_map_base: 0x0000000109bce000
+
+Marking Bits: (ParMarkBitMap*) 0x000000010c729768
+ Begin Bits: [0x0000000120b8d000, 0x0000000124b8d000)
+ End Bits: [0x0000000124b8d000, 0x0000000128b8d000)
+
+Polling page: 0x0000000103d67000
+
+CodeCache: size=245760Kb used=3684Kb max_used=3684Kb free=242075Kb
+ bounds [0x0000000111b8d000, 0x0000000111f2d000, 0x0000000120b8d000]
+ total_blobs=715 nmethods=416 adapters=210
+ compilation: enabled
+
+Compilation events (10 events):
+Event: 0.438 Thread 0x00007fb00d04c000 409 3 java.lang.Integer::valueOf (32 bytes)
+Event: 0.438 Thread 0x00007fb00c020800 410 3 java.nio.Buffer::remaining (10 bytes)
+Event: 0.438 Thread 0x00007fb00c020800 nmethod 410 0x0000000111f231d0 code [0x0000000111f23320, 0x0000000111f23470]
+Event: 0.438 Thread 0x00007fb00d04c000 nmethod 409 0x0000000111f234d0 code [0x0000000111f23660, 0x0000000111f239b0]
+Event: 0.438 Thread 0x00007fb00c01f000 411 ! 3 java.util.zip.Inflater::inflate (113 bytes)
+Event: 0.438 Thread 0x00007fb00d04c000 413 s! 3 java.net.URLStreamHandler::getHostAddress (54 bytes)
+Event: 0.438 Thread 0x00007fb00c020800 414 3 java.io.UnixFileSystem::getBooleanAttributes (49 bytes)
+Event: 0.438 Thread 0x00007fb00c01f000 nmethod 411 0x0000000111f24250 code [0x0000000111f24420, 0x0000000111f24a98]
+Event: 0.438 Thread 0x00007fb00d04c000 nmethod 413 0x0000000111f24e10 code [0x0000000111f24fc0, 0x0000000111f25798]
+Event: 0.438 Thread 0x00007fb00c020800 nmethod 414 0x0000000111f25ad0 code [0x0000000111f25c80, 0x0000000111f26228]
+
+GC Heap History (0 events):
+No events
+
+Deoptimization events (0 events):
+No events
+
+Classes redefined (0 events):
+No events
+
+Internal exceptions (10 events):
+Event: 0.026 Thread 0x00007fb00d009000 Exception (0x000000076ab07cc0) thrown at [/jenkins/workspace/8-2-build-macosx-x86_64/jdk8u271/605/hotspot/src/s
+Event: 0.026 Thread 0x00007fb00d009000 Exception (0x000000076ab07fa8) thrown at [/jenkins/workspace/8-2-build-macosx-x86_64/jdk8u271/605/hotspot/src/share/vm/prims/jni.
+Event: 0.127 Thread 0x00007fb00d009000 Exception (0x000000076b2ba2b0) thrown at [/jenkins/workspace/8-2-build-macosx-x86_64/jdk8u271/605/hotspot/src/share/vm/prims/jvm.cpp, line 1512]
+Event: 0.127 Thread 0x00007fb00d009000 Exception (0x000000076b2ba4c0) thrown at [/jenkins/workspace/8-2-build-macosx-x86_64/jdk8u271/605/hotspot/src/share/vm/prims/jvm.cpp, line 1512]
+Event: 0.127 Thread 0x00007fb00d009000 Exception (0x000000076b2bd9d8) thrown at [/jenkins/workspace/8-2-build-macosx-x86_64/jdk8u271/605/hotspot/src/share/vm/prims/jvm.cpp, line 1512]
+Event: 0.127 Thread 0x00007fb00d009000 Exception (0x000000076b2bdbe8) thrown at [/jenkins/workspace/8-2-build-macosx-x86_64/jdk8u271/605/hotspot/src/share/vm/prims/jvm.cpp, line 1512]
+Event: 0.163 Thread 0x00007fb00d009000 Exception (0x000000076b543b70) thrown at [/jenkins/workspace/8-2-build-macosx-x86_64/jdk8u271/605/hotspot/src/share/vm/prims/methodHandles.cpp, line 1169]
+Event: 0.164 Thread 0x00007fb00d009000 Exception (0x000000076b551b30) thrown at [/jenkins/workspace/8-2-build-macosx-x86_64/jdk8u271/605/hotspot/src/share/vm/prims/methodHandles.cpp, line 1169]
+Event: 0.382 Thread 0x00007fb00d009000 Exception (0x000000076b5f6d58) thrown at [/jenkins/workspace/8-2-build-macosx-x86_64/jdk8u271/605/hotspot/src/share/vm/prims/jni.cpp, line 710]
+Event: 0.383 Thread 0x00007fb00d009000 Exception (0x000000076b5f78e0) thrown at [/jenkins/workspace/8-2-build-macosx-x86_64/jdk8u271/605/hotspot/src/share/vm/prims/jni.cpp, line 710]
+
+Events (10 events):
+Event: 0.438 loading class org/lwjgl/opengl/ContextImplementation
+Event: 0.438 loading class org/lwjgl/opengl/ContextImplementation done
+Event: 0.439 loading class org/lwjgl/opengl/MacOSXContextImplementation
+Event: 0.439 loading class org/lwjgl/opengl/MacOSXContextImplementation done
+Event: 0.439 loading class org/lwjgl/opengl/GLContext
+Event: 0.439 loading class org/lwjgl/opengl/GLContext done
+Event: 0.439 loading class java/lang/NumberFormatException
+Event: 0.439 loading class java/lang/NumberFormatException done
+Event: 0.440 loading class org/lwjgl/opengl/GLContext$CapabilitiesCacheEntry
+Event: 0.440 loading class org/lwjgl/opengl/GLContext$CapabilitiesCacheEntry done
+
+
+Dynamic libraries:
+0x00007fff34f1d000 /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa
+0x00007fff22262000 /System/Library/Frameworks/Security.framework/Versions/A/Security
+0x00007fff33125000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices
+0x00007fff2a4e4000 /usr/lib/libz.1.dylib
+0x00007fff2a5ac000 /usr/lib/libSystem.B.dylib
+0x00007fff2044b000 /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
+0x00007fff211fa000 /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation
+0x00007fff2026b000 /usr/lib/libobjc.A.dylib
+0x00007fff22c93000 /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit
+0x00007fff25b57000 /System/Library/Frameworks/CoreData.framework/Versions/A/CoreData
+0x00007fff239df000 /System/Library/PrivateFrameworks/UIFoundation.framework/Versions/A/UIFoundation
+0x00007fff2fbdf000 /System/Library/PrivateFrameworks/RemoteViewServices.framework/Versions/A/RemoteViewServices
+0x00007fff289f0000 /System/Library/PrivateFrameworks/XCTTargetBootstrap.framework/Versions/A/XCTTargetBootstrap
+0x00007fff2b6d5000 /usr/lib/libspindump.dylib
+0x00007fff23c2e000 /System/Library/Frameworks/UniformTypeIdentifiers.framework/Versions/A/UniformTypeIdentifiers
+0x00007fff271f4000 /usr/lib/libapp_launch_measurement.dylib
+0x00007fff271f7000 /System/Library/PrivateFrameworks/CoreAutoLayout.framework/Versions/A/CoreAutoLayout
+0x00007fff28357000 /System/Library/Frameworks/Metal.framework/Versions/A/Metal
+0x00007fff2904d000 /usr/lib/liblangid.dylib
+0x00007fff289f4000 /System/Library/PrivateFrameworks/CoreSVG.framework/Versions/A/CoreSVG
+0x00007fff24c6e000 /System/Library/PrivateFrameworks/SkyLight.framework/Versions/A/SkyLight
+0x00007fff24fd4000 /System/Library/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics
+0x00007fff30106000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Accelerate
+0x00007fff2b113000 /System/Library/PrivateFrameworks/IconServices.framework/Versions/A/IconServices
+0x00007fff2833b000 /System/Library/Frameworks/IOSurface.framework/Versions/A/IOSurface
+0x00007fff264df000 /usr/lib/libDiagnosticMessagesClient.dylib
+0x00007fff289dc000 /System/Library/PrivateFrameworks/DFRFoundation.framework/Versions/A/DFRFoundation
+0x00007fff225ba000 /usr/lib/libicucore.A.dylib
+0x00007fff2cc1e000 /System/Library/Frameworks/AudioToolbox.framework/Versions/A/AudioToolbox
+0x00007fff2bea6000 /System/Library/PrivateFrameworks/DataDetectorsCore.framework/Versions/A/DataDetectorsCore
+0x00007fff24be1000 /usr/lib/libMobileGestalt.dylib
+0x00007fff286e0000 /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox
+0x00007fff26c39000 /System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore
+0x00007fff2fc17000 /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/SpeechRecognition.framework/Versions/A/SpeechRecognition
+0x00007fff26f59000 /System/Library/PrivateFrameworks/CoreUI.framework/Versions/A/CoreUI
+0x00007fff21bd0000 /System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio
+0x00007fff265ca000 /System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration
+0x00007fff2baa3000 /System/Library/PrivateFrameworks/MultitouchSupport.framework/Versions/A/MultitouchSupport
+0x00007fff2be9d000 /System/Library/PrivateFrameworks/InternationalSupport.framework/Versions/A/InternationalSupport
+0x00007fff24be0000 /usr/lib/libenergytrace.dylib
+0x00007fff22b8a000 /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit
+0x00007fff2ff4a000 /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices
+0x00007fff27186000 /System/Library/PrivateFrameworks/PerformanceAnalysis.framework/Versions/A/PerformanceAnalysis
+0x00007fff6bab5000 /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL
+0x00007fff2bf21000 /System/Library/PrivateFrameworks/UserActivity.framework/Versions/A/UserActivity
+0x00007fff2565e000 /System/Library/Frameworks/ColorSync.framework/Versions/A/ColorSync
+0x00007fff28c5b000 /System/Library/Frameworks/CoreImage.framework/Versions/A/CoreImage
+0x00007fff219ea000 /System/Library/Frameworks/CoreText.framework/Versions/A/CoreText
+0x00007fff28a1e000 /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
+0x00007fff2a5b2000 /System/Library/PrivateFrameworks/SoftLinking.framework/Versions/A/SoftLinking
+0x00007fff2723f000 /usr/lib/libxml2.2.dylib
+0x00007fff20331000 /usr/lib/libc++.1.dylib
+0x00007fff2a823000 /usr/lib/libcompression.dylib
+0x00007fff2bdcf000 /System/Library/PrivateFrameworks/TextureIO.framework/Versions/A/TextureIO
+0x00007fff2ae52000 /usr/lib/libate.dylib
+0x00007fff2a5a6000 /usr/lib/system/libcache.dylib
+0x00007fff2a562000 /usr/lib/system/libcommonCrypto.dylib
+0x00007fff2a58c000 /usr/lib/system/libcompiler_rt.dylib
+0x00007fff2a581000 /usr/lib/system/libcopyfile.dylib
+0x00007fff2015b000 /usr/lib/system/libcorecrypto.dylib
+0x00007fff20226000 /usr/lib/system/libdispatch.dylib
+0x00007fff203d9000 /usr/lib/system/libdyld.dylib
+0x00007fff2a59d000 /usr/lib/system/libkeymgr.dylib
+0x00007fff2d9b5000 /usr/lib/system/liblaunch.dylib
+0x00007fff2a540000 /usr/lib/system/libmacho.dylib
+0x00007fff29d38000 /usr/lib/system/libquarantine.dylib
+0x00007fff2a59a000 /usr/lib/system/libremovefile.dylib
+0x00007fff24c3e000 /usr/lib/system/libsystem_asl.dylib
+0x00007fff2010b000 /usr/lib/system/libsystem_blocks.dylib
+0x00007fff202a8000 /usr/lib/system/libsystem_c.dylib
+0x00007fff2a594000 /usr/lib/system/libsystem_collections.dylib
+0x00007fff2903e000 /usr/lib/system/libsystem_configuration.dylib
+0x00007fff2832a000 /usr/lib/system/libsystem_containermanager.dylib
+0x00007fff2a2e3000 /usr/lib/system/libsystem_coreservices.dylib
+0x00007fff2281a000 /usr/lib/system/libsystem_darwin.dylib
+0x00007fff2a59e000 /usr/lib/system/libsystem_dnssd.dylib
+0x00007fff202a5000 /usr/lib/system/libsystem_featureflags.dylib
+0x00007fff2041f000 /usr/lib/system/libsystem_info.dylib
+0x00007fff2a4f7000 /usr/lib/system/libsystem_m.dylib
+0x00007fff201f9000 /usr/lib/system/libsystem_malloc.dylib
+0x00007fff24bd1000 /usr/lib/system/libsystem_networkextension.dylib
+0x00007fff22c39000 /usr/lib/system/libsystem_notify.dylib
+0x00007fff2fe4c000 /usr/lib/system/libsystem_product_info_filter.dylib
+0x00007fff29042000 /usr/lib/system/libsystem_sandbox.dylib
+0x00007fff2a597000 /usr/lib/system/libsystem_secinit.dylib
+0x00007fff2039d000 /usr/lib/system/libsystem_kernel.dylib
+0x00007fff20415000 /usr/lib/system/libsystem_platform.dylib
+0x00007fff203cd000 /usr/lib/system/libsystem_pthread.dylib
+0x00007fff2631b000 /usr/lib/system/libsystem_symptoms.dylib
+0x00007fff20143000 /usr/lib/system/libsystem_trace.dylib
+0x00007fff2a56e000 /usr/lib/system/libunwind.dylib
+0x00007fff2010d000 /usr/lib/system/libxpc.dylib
+0x00007fff20387000 /usr/lib/libc++abi.dylib
+0x00007fff2a579000 /usr/lib/liboah.dylib
+0x00007fff2ac37000 /usr/lib/liblzma.5.dylib
+0x00007fff20f0e000 /System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration
+0x00007fff2a5ae000 /usr/lib/libfakelink.dylib
+0x00007fff24732000 /System/Library/Frameworks/CFNetwork.framework/Versions/A/CFNetwork
+0x00007fff2a6ee000 /usr/lib/libarchive.2.dylib
+0x00007fff20f8c000 /usr/lib/libCRFSuite.dylib
+0x00007fff29d5f000 /usr/lib/libbsm.0.dylib
+0x00007fff240ab000 /usr/lib/libnetwork.dylib
+0x00007fff2a5b3000 /usr/lib/libpcap.A.dylib
+0x00007fff26314000 /usr/lib/libdns_services.dylib
+0x00007fff2ac50000 /usr/lib/libcoretls_cfhelpers.dylib
+0x00007fff2a7ed000 /usr/lib/libapple_nghttp2.dylib
+0x00007fff2a546000 /usr/lib/system/libkxld.dylib
+0x00007fff25f8d000 /usr/lib/libsqlite3.dylib
+0x00007fff2a2c6000 /System/Library/PrivateFrameworks/AppleFSCompression.framework/Versions/A/AppleFSCompression
+0x00007fff29d47000 /usr/lib/libcoretls.dylib
+0x00007fff2a81e000 /usr/lib/libpam.2.dylib
+0x00007fff2ad4e000 /usr/lib/libxar.1.dylib
+0x00007fff29049000 /System/Library/PrivateFrameworks/AppleSystemInfo.framework/Versions/A/AppleSystemInfo
+0x00007fff29989000 /System/Library/PrivateFrameworks/IOMobileFramebuffer.framework/Versions/A/IOMobileFramebuffer
+0x00007fff2a2d6000 /usr/lib/libbz2.1.0.dylib
+0x00007fff2a5eb000 /usr/lib/libiconv.2.dylib
+0x00007fff2a53f000 /usr/lib/libcharset.1.dylib
+0x00007fff271c2000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/FSEvents.framework/Versions/A/FSEvents
+0x00007fff22824000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/CarbonCore
+0x00007fff2652f000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadata.framework/Versions/A/Metadata
+0x00007fff2a2e8000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/OSServices.framework/Versions/A/OSServices
+0x00007fff2a760000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SearchKit.framework/Versions/A/SearchKit
+0x00007fff2629f000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/AE.framework/Versions/A/AE
+0x00007fff208e9000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/LaunchServices
+0x00007fff2abe7000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/DictionaryServices.framework/Versions/A/DictionaryServices
+0x00007fff271cf000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SharedFileList.framework/Versions/A/SharedFileList
+0x00007fff29d3b000 /usr/lib/libCheckFix.dylib
+0x00007fff24c55000 /System/Library/PrivateFrameworks/TCC.framework/Versions/A/TCC
+0x00007fff2904f000 /System/Library/PrivateFrameworks/CoreNLP.framework/Versions/A/CoreNLP
+0x00007fff264e2000 /System/Library/PrivateFrameworks/MetadataUtilities.framework/Versions/A/MetadataUtilities
+0x00007fff20fc1000 /usr/lib/libmecabra.dylib
+0x00007fff2a045000 /System/Library/Frameworks/MLCompute.framework/Versions/A/MLCompute
+0x00007fff29d70000 /usr/lib/libmecab.dylib
+0x00007fff29dba000 /usr/lib/libgermantok.dylib
+0x00007fff2a7c8000 /usr/lib/libThaiTokenizer.dylib
+0x00007fff2ad89000 /usr/lib/libChineseTokenizer.dylib
+0x00007fff2a81c000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/MetalPerformanceShaders
+0x00007fff265d1000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vImage.framework/Versions/A/vImage
+0x00007fff2ff24000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/vecLib
+0x00007fff2ad94000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvMisc.dylib
+0x00007fff297a4000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvDSP.dylib
+0x00007fff20bf4000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
+0x00007fff2a849000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLAPACK.dylib
+0x00007fff29dc0000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLinearAlgebra.dylib
+0x00007fff2a805000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libSparseBLAS.dylib
+0x00007fff2a843000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libQuadrature.dylib
+0x00007fff290fb000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBNNS.dylib
+0x00007fff20e9f000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libSparse.dylib
+0x00007fff28fd7000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSCore.framework/Versions/A/MPSCore
+0x00007fff2a235000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSImage.framework/Versions/A/MPSImage
+0x00007fff29dd6000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSNeuralNetwork.framework/Versions/A/MPSNeuralNetwork
+0x00007fff2a1a7000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSMatrix.framework/Versions/A/MPSMatrix
+0x00007fff29ff5000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSRayIntersector.framework/Versions/A/MPSRayIntersector
+0x00007fff2a1de000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSNDArray.framework/Versions/A/MPSNDArray
+0x00007fff20b1f000 /System/Library/PrivateFrameworks/MetalTools.framework/Versions/A/MetalTools
+0x00007fff29047000 /System/Library/PrivateFrameworks/AggregateDictionary.framework/Versions/A/AggregateDictionary
+0x00007fff264af000 /System/Library/PrivateFrameworks/CoreAnalytics.framework/Versions/A/CoreAnalytics
+0x00007fff2a7ca000 /System/Library/PrivateFrameworks/AppleSauce.framework/Versions/A/AppleSauce
+0x00007fff2834d000 /System/Library/PrivateFrameworks/IOAccelerator.framework/Versions/A/IOAccelerator
+0x00007fff6baa9000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libCoreFSCache.dylib
+0x00007fff21559000 /System/Library/PrivateFrameworks/LanguageModeling.framework/Versions/A/LanguageModeling
+0x00007fff29977000 /System/Library/PrivateFrameworks/CoreEmoji.framework/Versions/A/CoreEmoji
+0x00007fff290f4000 /System/Library/PrivateFrameworks/LinguisticData.framework/Versions/A/LinguisticData
+0x00007fff20e51000 /System/Library/PrivateFrameworks/Lexicon.framework/Versions/A/Lexicon
+0x00007fff2a6dc000 /usr/lib/libcmph.dylib
+0x00007fff271a2000 /System/Library/Frameworks/OpenDirectory.framework/Versions/A/Frameworks/CFOpenDirectory.framework/Versions/A/CFOpenDirectory
+0x00007fff27192000 /System/Library/Frameworks/OpenDirectory.framework/Versions/A/OpenDirectory
+0x00007fff2ac52000 /System/Library/PrivateFrameworks/APFS.framework/Versions/A/APFS
+0x00007fff29c9d000 /System/Library/Frameworks/SecurityFoundation.framework/Versions/A/SecurityFoundation
+0x00007fff2ad5c000 /usr/lib/libutil.dylib
+0x00007fff22b4f000 /System/Library/PrivateFrameworks/CoreServicesStore.framework/Versions/A/CoreServicesStore
+0x00007fff29d33000 /System/Library/Frameworks/ServiceManagement.framework/Versions/A/ServiceManagement
+0x00007fff2ad60000 /usr/lib/libxslt.1.dylib
+0x00007fff29d29000 /System/Library/PrivateFrameworks/BackgroundTaskManagement.framework/Versions/A/BackgroundTaskManagement
+0x00007fff2bd19000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libRadiance.dylib
+0x00007fff2bd23000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libJPEG.dylib
+0x00007fff2bc6d000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libPng.dylib
+0x00007fff2bc94000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libTIFF.dylib
+0x00007fff2bd78000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libGIF.dylib
+0x00007fff2b9bf000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libJP2.dylib
+0x00007fff2b0db000 /usr/lib/libexpat.1.dylib
+0x00007fff2b975000 /System/Library/PrivateFrameworks/AppleJPEG.framework/Versions/A/AppleJPEG
+0x00007fff28583000 /System/Library/PrivateFrameworks/FontServices.framework/libFontParser.dylib
+0x00007fff26256000 /System/Library/PrivateFrameworks/RunningBoardServices.framework/Versions/A/RunningBoardServices
+0x00007fff2ba9f000 /System/Library/PrivateFrameworks/WatchdogClient.framework/Versions/A/WatchdogClient
+0x00007fff21642000 /System/Library/Frameworks/CoreDisplay.framework/Versions/A/CoreDisplay
+0x00007fff28498000 /System/Library/Frameworks/CoreMedia.framework/Versions/A/CoreMedia
+0x00007fff27322000 /System/Library/Frameworks/CoreVideo.framework/Versions/A/CoreVideo
+0x00007fff2bada000 /System/Library/Frameworks/VideoToolbox.framework/Versions/A/VideoToolbox
+0x00007fff261d6000 /System/Library/PrivateFrameworks/BaseBoard.framework/Versions/A/BaseBoard
+0x00007fff2b21f000 /System/Library/PrivateFrameworks/PersistentConnection.framework/Versions/A/PersistentConnection
+0x00007fff25f77000 /System/Library/PrivateFrameworks/ProtocolBuffer.framework/Versions/A/ProtocolBuffer
+0x00007fff261be000 /System/Library/PrivateFrameworks/CommonUtilities.framework/Versions/A/CommonUtilities
+0x00007fff2b938000 /System/Library/PrivateFrameworks/Bom.framework/Versions/A/Bom
+0x00007fff2bd11000 /System/Library/PrivateFrameworks/GPUWrangler.framework/Versions/A/GPUWrangler
+0x00007fff2bcf4000 /System/Library/PrivateFrameworks/IOPresentment.framework/Versions/A/IOPresentment
+0x00007fff2bd1d000 /System/Library/PrivateFrameworks/DSExternalDisplay.framework/Versions/A/DSExternalDisplay
+0x00007fff2bd7d000 /System/Library/PrivateFrameworks/CMCaptureCore.framework/Versions/A/CMCaptureCore
+0x00007fff2b6bb000 /System/Library/PrivateFrameworks/AppServerSupport.framework/Versions/A/AppServerSupport
+0x00007fff2d758000 /System/Library/PrivateFrameworks/perfdata.framework/Versions/A/perfdata
+0x00007fff29c8c000 /System/Library/PrivateFrameworks/AssertionServices.framework/Versions/A/AssertionServices
+0x00007fff21779000 /System/Library/PrivateFrameworks/AudioToolboxCore.framework/Versions/A/AudioToolboxCore
+0x00007fff2847b000 /System/Library/PrivateFrameworks/caulk.framework/Versions/A/caulk
+0x00007fff3cc04000 /System/Library/PrivateFrameworks/SystemPolicy.framework/Versions/A/SystemPolicy
+0x00007fff2aeea000 /usr/lib/libIOReport.dylib
+0x00007fff2cf94000 /usr/lib/libSMC.dylib
+0x00007fff2bc39000 /usr/lib/libAudioToolboxUtility.dylib
+0x00007fff3d561000 /usr/lib/libmis.dylib
+0x00007fff6bb05000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLU.dylib
+0x00007fff6bac8000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGFXShared.dylib
+0x00007fff6bcd6000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib
+0x00007fff6bad1000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLImage.dylib
+0x00007fff6bac5000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libCVMSPluginSupport.dylib
+0x00007fff6bab0000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libCoreVMClient.dylib
+0x00007fff6d120000 /System/Library/Frameworks/OpenCL.framework/Versions/A/OpenCL
+0x00007fff2b248000 /System/Library/PrivateFrameworks/GraphVisualizer.framework/Versions/A/GraphVisualizer
+0x00007fff2b257000 /System/Library/PrivateFrameworks/FaceCore.framework/Versions/A/FaceCore
+0x00007fff2b673000 /System/Library/PrivateFrameworks/OTSVG.framework/Versions/A/OTSVG
+0x00007fff26f17000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/Resources/libFontRegistry.dylib
+0x00007fff2b6c2000 /System/Library/PrivateFrameworks/FontServices.framework/libhvf.dylib
+0x00007fff2b087000 /System/Library/PrivateFrameworks/AppleVA.framework/Versions/A/AppleVA
+0x00007fff2cddc000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/ATS
+0x00007fff2d0ef000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ColorSyncLegacy.framework/Versions/A/ColorSyncLegacy
+0x00007fff25755000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/HIServices.framework/Versions/A/HIServices
+0x00007fff2d0d4000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/LangAnalysis.framework/Versions/A/LangAnalysis
+0x00007fff2bd87000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/PrintCore.framework/Versions/A/PrintCore
+0x00007fff2d0f7000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/QD.framework/Versions/A/QD
+0x00007fff2cdcc000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/SpeechSynthesis.framework/Versions/A/SpeechSynthesis
+0x00007fff2bd48000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATSUI.framework/Versions/A/ATSUI
+0x00007fff2d074000 /usr/lib/libcups.2.dylib
+0x00007fff2d0e4000 /System/Library/PrivateFrameworks/NetAuth.framework/Versions/A/NetAuth
+0x00007fff2d773000 /System/Library/Frameworks/Kerberos.framework/Versions/A/Kerberos
+0x00007fff2d783000 /System/Library/Frameworks/GSS.framework/Versions/A/GSS
+0x00007fff2ce49000 /usr/lib/libresolv.9.dylib
+0x00007fff2b6d8000 /System/Library/PrivateFrameworks/Heimdal.framework/Versions/A/Heimdal
+0x00007fff3343a000 /System/Library/Frameworks/Kerberos.framework/Versions/A/Libraries/libHeimdalProxy.dylib
+0x00007fff26323000 /System/Library/Frameworks/Network.framework/Versions/A/Network
+0x00007fff2b0f4000 /usr/lib/libheimdal-asn1.dylib
+0x00007fff2d7d4000 /System/Library/PrivateFrameworks/CommonAuth.framework/Versions/A/CommonAuth
+0x00007fff27370000 /System/Library/PrivateFrameworks/login.framework/Versions/A/Frameworks/loginsupport.framework/Versions/A/loginsupport
+0x00007fff2cd53000 /System/Library/PrivateFrameworks/AudioSession.framework/Versions/A/AudioSession
+0x00007fff2cdb9000 /usr/lib/libAudioStatistics.dylib
+0x00007fff2b180000 /System/Library/PrivateFrameworks/MediaExperience.framework/Versions/A/MediaExperience
+0x00007fff2cbec000 /System/Library/PrivateFrameworks/AudioSession.framework/libSessionUtility.dylib
+0x00007fff2d764000 /usr/lib/libperfcheck.dylib
+0x00007fff2d103000 /System/Library/PrivateFrameworks/AudioResourceArbitration.framework/Versions/A/AudioResourceArbitration
+0x00007fff2b0fe000 /System/Library/PrivateFrameworks/IconFoundation.framework/Versions/A/IconFoundation
+0x00007fff2fc07000 /System/Library/PrivateFrameworks/SpeechRecognitionCore.framework/Versions/A/SpeechRecognitionCore
+0x000000010c000000 /Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home/jre/lib/server/libjvm.dylib
+0x0000000103d23000 /Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home/jre/lib/libverify.dylib
+0x0000000103d34000 /Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home/jre/lib/libjava.dylib
+0x0000000103d68000 /Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home/jre/lib/libinstrument.dylib
+0x0000000103dd7000 /Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home/jre/lib/libzip.dylib
+0x0000000103fd9000 /Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home/jre/lib/libnet.dylib
+0x0000000110ffe000 /Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home/jre/lib/libawt.dylib
+0x000000011109e000 /Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home/jre/lib/libmlib_image.dylib
+0x00007fff6ea55000 /System/Library/Frameworks/JavaNativeFoundation.framework/Versions/A/JavaNativeFoundation
+0x00007fff6ea61000 /System/Library/Frameworks/JavaRuntimeSupport.framework/Versions/A/JavaRuntimeSupport
+0x00007fff3c94e000 /System/Library/Frameworks/Carbon.framework/Versions/A/Carbon
+0x00007fff31a78000 /System/Library/PrivateFrameworks/CoreSymbolication.framework/Versions/A/CoreSymbolication
+0x00007fff363e5000 /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/CommonPanels.framework/Versions/A/CommonPanels
+0x00007fff32ecf000 /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Help.framework/Versions/A/Help
+0x00007fff363e9000 /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/ImageCapture.framework/Versions/A/ImageCapture
+0x00007fff363b9000 /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/OpenScripting.framework/Versions/A/OpenScripting
+0x00007fff363e1000 /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Ink.framework/Versions/A/Ink
+0x00007fff3c94a000 /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Print.framework/Versions/A/Print
+0x00007fff363dd000 /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/SecurityHI.framework/Versions/A/SecurityHI
+0x00007fff31a3c000 /System/Library/PrivateFrameworks/DebugSymbols.framework/Versions/A/DebugSymbols
+0x000000011115d000 /Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home/jre/lib/libawt_lwawt.dylib
+0x000000011120c000 /Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home/jre/lib/libosxapp.dylib
+0x00007fff3bf65000 /System/Library/Frameworks/ExceptionHandling.framework/Versions/A/ExceptionHandling
+0x00007fff22b10000 /System/Library/PrivateFrameworks/CoreServicesInternal.framework/Versions/A/CoreServicesInternal
+0x00007fff30f8e000 /System/Library/Frameworks/FileProvider.framework/Versions/A/FileProvider
+0x00007fff26141000 /System/Library/Frameworks/Accounts.framework/Versions/A/Accounts
+0x00007fff310de000 /System/Library/PrivateFrameworks/GenerationalStorage.framework/Versions/A/GenerationalStorage
+0x00007fff309ae000 /System/Library/PrivateFrameworks/SymptomDiagnosticReporter.framework/Versions/A/SymptomDiagnosticReporter
+0x00007fff23c41000 /System/Library/PrivateFrameworks/DesktopServicesPriv.framework/Versions/A/DesktopServicesPriv
+0x00007fff22c45000 /usr/lib/libsandbox.1.dylib
+0x00007fff2739b000 /System/Library/PrivateFrameworks/UserManagement.framework/Versions/A/UserManagement
+0x00007fff29c69000 /System/Library/PrivateFrameworks/MobileKeyBag.framework/Versions/A/MobileKeyBag
+0x00007fff344bd000 /System/Library/PrivateFrameworks/ChunkingLibrary.framework/Versions/A/ChunkingLibrary
+0x00007fff2e197000 /System/Library/PrivateFrameworks/Sharing.framework/Versions/A/Sharing
+0x00007fff32a3c000 /System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Apple80211
+0x00007fff2a316000 /System/Library/PrivateFrameworks/AuthKit.framework/Versions/A/AuthKit
+0x00007fff29a67000 /System/Library/PrivateFrameworks/CoreUtils.framework/Versions/A/CoreUtils
+0x00007fff29994000 /System/Library/Frameworks/CoreWLAN.framework/Versions/A/CoreWLAN
+0x00007fff2e2e3000 /System/Library/Frameworks/IOBluetooth.framework/Versions/A/IOBluetooth
+0x00007fff32aa0000 /System/Library/PrivateFrameworks/CoreWiFi.framework/Versions/A/CoreWiFi
+0x00007fff2d85a000 /System/Library/PrivateFrameworks/CorePhoneNumbers.framework/Versions/A/CorePhoneNumbers
+0x00007fff30ab5000 /System/Library/PrivateFrameworks/DiskManagement.framework/Versions/A/DiskManagement
+0x00007fff309cb000 /System/Library/PrivateFrameworks/AppleIDAuthSupport.framework/Versions/A/AppleIDAuthSupport
+0x00007fff2d83a000 /System/Library/PrivateFrameworks/KeychainCircle.framework/Versions/A/KeychainCircle
+0x00007fff30a81000 /System/Library/PrivateFrameworks/MediaKit.framework/Versions/A/MediaKit
+0x00007fff309d8000 /System/Library/Frameworks/DiscRecording.framework/Versions/A/DiscRecording
+0x00007fff2affb000 /usr/lib/libCoreStorage.dylib
+0x00007fff32edb000 /usr/lib/libcsfde.dylib
+0x00007fff2e41e000 /System/Library/PrivateFrameworks/ProtectedCloudStorage.framework/Versions/A/ProtectedCloudStorage
+0x00007fff32ed3000 /System/Library/PrivateFrameworks/EFILogin.framework/Versions/A/EFILogin
+0x00007fff334ed000 /System/Library/Frameworks/AudioUnit.framework/Versions/A/AudioUnit
+0x00007fff30948000 /System/Library/Frameworks/CoreBluetooth.framework/Versions/A/CoreBluetooth
+0x00007fff2aff3000 /usr/lib/libMatch.1.dylib
+0x00007fff437d5000 /System/Library/CoreServices/RawCamera.bundle/Contents/MacOS/RawCamera
+0x00007fff2d7e5000 /System/Library/PrivateFrameworks/MobileAsset.framework/Versions/A/MobileAsset
+0x00007fff33511000 /System/Library/PrivateFrameworks/StreamingZip.framework/Versions/A/StreamingZip
+0x00007fff2bf7f000 /System/Library/Frameworks/MediaToolbox.framework/Versions/A/MediaToolbox
+0x00007fff30f60000 /System/Library/PrivateFrameworks/CoreAVCHD.framework/Versions/A/CoreAVCHD
+0x00007fff30147000 /System/Library/Frameworks/MediaAccessibility.framework/Versions/A/MediaAccessibility
+0x00007fff30f5c000 /System/Library/PrivateFrameworks/Mangrove.framework/Versions/A/Mangrove
+0x00007fff30153000 /System/Library/PrivateFrameworks/AlgosScoreFramework.framework/Versions/A/AlgosScoreFramework
+0x00007fff3194a000 /System/Library/PrivateFrameworks/AppleVPA.framework/Versions/A/AppleVPA
+0x00007fff30ba1000 /System/Library/PrivateFrameworks/CoreAUC.framework/Versions/A/CoreAUC
+0x00007fff41228000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vImage.framework/Versions/A/Libraries/libCGInterfaces.dylib
+0x00000001119c3000 /usr/lib/libobjc-trampolines.dylib
+0x00007fff2709a000 /System/Library/PrivateFrameworks/ViewBridge.framework/Versions/A/ViewBridge
+0x00007fff2b799000 /System/Library/PrivateFrameworks/login.framework/Versions/A/login
+0x00007fff77954000 /usr/lib/libRosetta.dylib
+0x000000012d525000 /Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home/jre/lib/libfontmanager.dylib
+0x000000012d586000 /Users/yuyangwang/Desktop/Programs_In_BDIC/Stage 3 Semester 1/Computer Graphic/project1/liblwjgl.dylib
+0x0000000111a5d000 /Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home/jre/lib/libjawt.dylib
+0x00007fff6bce1000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Resources/GLEngine.bundle/GLEngine
+0x00007fff6bb42000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLProgrammability.dylib
+0x00007fff5eec5000 /System/Library/Extensions/AppleIntelKBLGraphicsGLDriver.bundle/Contents/MacOS/AppleIntelKBLGraphicsGLDriver
+0x00007fff4631b000 /System/Library/PrivateFrameworks/GPUSupport.framework/Versions/A/Libraries/libGPUSupportMercury.dylib
+0x000000012d608000 /System/Library/Extensions/AMDRadeonX4000GLDriver.bundle/Contents/MacOS/AMDRadeonX4000GLDriver
+0x00007fff6e022000 /System/Library/Extensions/AMDRadeonX4000GLDriver.bundle/Contents/MacOS/ATIRadeonX4000SCLib.dylib
+0x00007fff5e12d000 /System/Library/Extensions/AMDShared.bundle/Contents/PlugIns/libSC.dylib
+0x00007fff6be5f000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Resources/GLRendererFloat.bundle/GLRendererFloat
+
+VM Arguments:
+jvm_args: -Dvisualvm.id=6509053298218 -javaagent:/Applications/IntelliJ IDEA.app/Contents/lib/idea_rt.jar=53892:/Applications/IntelliJ IDEA.app/Contents/bin -Dfile.encoding=UTF-8
+java_command: main.Main
+java_class_path (initial): /Users/yuyangwang/Desktop/Programs_In_BDIC/Stage 3 Semester 1/Computer Graphic/project1/bin:/Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home/jre/lib/deploy.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home/jre/lib/ext/cldrdata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home/jre/lib/ext/dnsns.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home/jre/lib/ext/jaccess.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home/jre/lib/ext/jfxrt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home/jre/lib/ext/localedata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home/jre/lib/ext/nashorn.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home/jre/lib/ext/sunec.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home/jre/lib/ext/sunjce_provider.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home/jre/lib/ext/sunpkcs11.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home/jre/lib/ext/zipfs.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home/jre/lib/javaws.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home/jre/lib/jce.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home/jre/lib/jfr.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home/jre/lib/jfxswt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home/jre/lib/jsse.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home/jre/lib/management-agent.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home/jre/lib/plugin.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home/jre/lib/resources.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home/jre/lib/rt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Conte
+Launcher Type: SUN_STANDARD
+
+Environment Variables:
+JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home
+PATH=/opt/MonkeyDev/bin:/Users/yuyangwang/opt/anaconda3/bin:/Users/yuyangwang/opt/anaconda3/condabin:/Users/yuyangwang/.autojump/bin:/Users/yuyangwang/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/VMware Fusion.app/Contents/Public:/Library/TeX/texbin:/usr/local/share/dotnet:/opt/X11/bin:~/.dotnet/tools:/Library/Apple/usr/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Applications/Wireshark.app/Contents/MacOS:/Users/yuyangwang/flutter/bin
+SHELL=/bin/zsh
+
+Signal Handlers:
+SIGSEGV: [libjvm.dylib+0x5a0dcb], sa_mask[0]=11111111011111110111111111111111, sa_flags=SA_ONSTACK|SA_RESTART|SA_SIGINFO
+SIGBUS: [libjvm.dylib+0x5a0dcb], sa_mask[0]=11111111011111110111111111111111, sa_flags=SA_RESTART|SA_SIGINFO
+SIGFPE: [libjvm.dylib+0x491731], sa_mask[0]=11111111011111110111111111111111, sa_flags=SA_RESTART|SA_SIGINFO
+SIGPIPE: [libjvm.dylib+0x491731], sa_mask[0]=11111111011111110111111111111111, sa_flags=SA_RESTART|SA_SIGINFO
+SIGXFSZ: [libjvm.dylib+0x491731], sa_mask[0]=11111111011111110111111111111111, sa_flags=SA_RESTART|SA_SIGINFO
+SIGILL: [libjvm.dylib+0x491731], sa_mask[0]=11111111011111110111111111111111, sa_flags=SA_RESTART|SA_SIGINFO
+SIGUSR1: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
+SIGUSR2: [libjvm.dylib+0x49202a], sa_mask[0]=00100000000000000000000000000000, sa_flags=SA_RESTART|SA_SIGINFO
+SIGHUP: [libjvm.dylib+0x490239], sa_mask[0]=11111111011111110111111111111111, sa_flags=SA_RESTART|SA_SIGINFO
+SIGINT: [libjvm.dylib+0x490239], sa_mask[0]=11111111011111110111111111111111, sa_flags=SA_RESTART|SA_SIGINFO
+SIGTERM: [libjvm.dylib+0x490239], sa_mask[0]=11111111011111110111111111111111, sa_flags=SA_RESTART|SA_SIGINFO
+SIGQUIT: [libjvm.dylib+0x490239], sa_mask[0]=11111111011111110111111111111111, sa_flags=SA_RESTART|SA_SIGINFO
+
+
+--------------- S Y S T E M ---------------
+
+OS:Bsduname:Darwin 20.6.0 Darwin Kernel Version 20.6.0: Wed Jun 23 00:26:31 PDT 2021; root:xnu-7195.141.2~5/RELEASE_X86_64 x86_64
+rlimit: STACK 8192k, CORE 0k, NPROC 2784, NOFILE 10240, AS infinity
+load average:2.50 2.21 1.97
+
+CPU:total 16 (initial active 16) (8 cores per cpu, 2 threads per core) family 6 model 158 stepping 13, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, avx, avx2, aes, clmul, erms, 3dnowpref, lzcnt, ht, tsc, tscinvbit, bmi1, bmi2, adx
+
+Memory: 4k page, physical 16777216k(393524k free)
+
+/proc/meminfo:
+
+
+vm_info: Java HotSpot(TM) 64-Bit Server VM (25.271-b09) for bsd-amd64 JRE (1.8.0_271-b09), built on Sep 16 2020 16:54:38 by "java_re" with gcc 4.2.1 Compatible Apple LLVM 10.0.0 (clang-1000.11.45.5)
+
+time: Thu Nov 4 21:50:32 2021
+timezone: CST
+elapsed time: 0.451916 seconds (0d 0h 0m 0s)
+
diff --git a/hs_err_pid87864.log b/hs_err_pid87864.log
index 2a8d231..af7377c 100644
--- a/hs_err_pid87864.log
+++ b/hs_err_pid87864.log
@@ -106,8 +106,8 @@ j org.lwjgl.opengl.Display.makeCurrentAndSetSwapInterval()V+0
j org.lwjgl.opengl.Display.create(Lorg/lwjgl/opengl/PixelFormat;Lorg/lwjgl/opengl/Drawable;Lorg/lwjgl/opengl/ContextAttribs;)V+108
j org.lwjgl.opengl.Display.create(Lorg/lwjgl/opengl/PixelFormat;)V+12
j org.lwjgl.opengl.Display.create()V+7
-j MainWindow.start()V+24
-j MainWindow.main([Ljava/lang/String;)V+9
+j main.MainWindow.start()V+24
+j main.MainWindow.main([Ljava/lang/String;)V+9
v ~StubRoutines::call_stub
V [libjvm.dylib+0x2d4795] JavaCalls::call_helper(JavaValue*, methodHandle*, JavaCallArguments*, Thread*)+0x771
V [libjvm.dylib+0x30582b] jni_invoke_static(JNIEnv_*, JavaValue*, _jobject*, JNICallType, _jmethodID*, JNI_ArgumentPusher*, Thread*)+0x279
@@ -127,8 +127,8 @@ j org.lwjgl.opengl.Display.makeCurrentAndSetSwapInterval()V+0
j org.lwjgl.opengl.Display.create(Lorg/lwjgl/opengl/PixelFormat;Lorg/lwjgl/opengl/Drawable;Lorg/lwjgl/opengl/ContextAttribs;)V+108
j org.lwjgl.opengl.Display.create(Lorg/lwjgl/opengl/PixelFormat;)V+12
j org.lwjgl.opengl.Display.create()V+7
-j MainWindow.start()V+24
-j MainWindow.main([Ljava/lang/String;)V+9
+j main.MainWindow.start()V+24
+j main.MainWindow.main([Ljava/lang/String;)V+9
v ~StubRoutines::call_stub
--------------- P R O C E S S ---------------
@@ -567,7 +567,7 @@ Dynamic libraries:
VM Arguments:
jvm_args: -javaagent:/Applications/IntelliJ IDEA.app/Contents/lib/idea_rt.jar=62805:/Applications/IntelliJ IDEA.app/Contents/bin -Dfile.encoding=UTF-8
-java_command: MainWindow
+java_command: main.MainWindow
java_class_path (initial): /Users/yuyangwang/Desktop/Programs_In_BDIC/Stage 3 Semester 1/Computer Graphic/Assignment3/bin:/Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home/jre/lib/deploy.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home/jre/lib/ext/cldrdata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home/jre/lib/ext/dnsns.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home/jre/lib/ext/jaccess.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home/jre/lib/ext/jfxrt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home/jre/lib/ext/localedata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home/jre/lib/ext/nashorn.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home/jre/lib/ext/sunec.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home/jre/lib/ext/sunjce_provider.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home/jre/lib/ext/sunpkcs11.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home/jre/lib/ext/zipfs.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home/jre/lib/javaws.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home/jre/lib/jce.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home/jre/lib/jfr.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home/jre/lib/jfxswt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home/jre/lib/jsse.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home/jre/lib/management-agent.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home/jre/lib/plugin.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home/jre/lib/resources.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home/jre/lib/rt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Co
Launcher Type: SUN_STANDARD
diff --git a/src/META-INF/MANIFEST.MF b/src/META-INF/MANIFEST.MF
deleted file mode 100644
index c2184f5..0000000
--- a/src/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,3 +0,0 @@
-Manifest-Version: 1.0
-Main-Class: MainWindow
-
diff --git a/src/Scene/Objects/Ground.java b/src/Scene/Objects/Ground.java
new file mode 100644
index 0000000..3eaffcf
--- /dev/null
+++ b/src/Scene/Objects/Ground.java
@@ -0,0 +1,54 @@
+package Scene.Objects;
+
+import base.GraphicsObjects.Point4f;
+import base.GraphicsObjects.Vector4f;
+import Scene.base.SceneObject;
+import base.objects3D.TexCube;
+import org.lwjgl.opengl.GL11;
+import org.newdawn.slick.Color;
+import org.newdawn.slick.opengl.Texture;
+
+import java.util.HashMap;
+
+/**
+ * @Author: WangYuyang
+ * @Date: 2021/11/2-16:01
+ * @Project: Assignment3
+ * @Package: Scene.Objects
+ * @Description:
+ **/
+public class Ground extends SceneObject {
+ private TexCube MyGrid = new TexCube();
+
+ public Ground(Point4f origin, Point4f position, Vector4f scale) {
+ super(origin, position, scale);
+ }
+
+ public Ground(Point4f origin, Point4f position, Vector4f scale, HashMap textures) {
+ super(origin, position, scale, textures);
+ }
+
+ public Ground(Point4f origin, Point4f position, Vector4f scale, Vector4f rotation, HashMap textures) {
+ super(origin, position, scale, rotation, textures);
+ }
+
+
+ @Override
+ public void draw() {
+
+ GL11.glTexParameteri(
+ GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T,
+ GL11.GL_REPEAT);
+ GL11.glTexParameteri(
+ GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S,
+ GL11.GL_REPEAT);
+ Color.white.bind();
+ //bind texture
+ getTextures().get("default_dirt").bind();
+ GL11.glEnable(GL11.GL_TEXTURE_2D);
+ GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST);
+ MyGrid.DrawTexCube(10f);
+ GL11.glDisable(GL11.GL_TEXTURE_2D);
+
+ }
+}
diff --git a/src/objects3D/Human.java b/src/Scene/Objects/Human.java
similarity index 84%
rename from src/objects3D/Human.java
rename to src/Scene/Objects/Human.java
index 98c3a06..2f2144b 100644
--- a/src/objects3D/Human.java
+++ b/src/Scene/Objects/Human.java
@@ -1,13 +1,21 @@
-package objects3D;
-
-import GraphicsObjects.Utils;
+package Scene.Objects;
+
+import Scene.base.SceneObject;
+import base.GraphicsObjects.Point4f;
+import base.GraphicsObjects.Utils;
+import base.GraphicsObjects.Vector4f;
+import base.objects3D.Cylinder;
+import base.objects3D.Sphere;
+import base.objects3D.TexSphere;
+import main.Engine;
import org.lwjgl.opengl.GL11;
import org.newdawn.slick.Color;
import org.newdawn.slick.opengl.Texture;
import java.util.HashMap;
-public class Human {
+public class Human extends SceneObject {
+
// basic colours
static float black[] = {0.0f, 0.0f, 0.0f, 1.0f};
@@ -32,20 +40,71 @@ public class Human {
static float dkgreen[] = {0.0f, 0.5f, 0.0f, 1.0f, 1.0f};
static float pink[] = {1.0f, 0.6f, 0.6f, 1.0f, 1.0f};
- private HashMap textures;
+ private float delta;
+ private Boolean isWalking = false;
+ private long walkStartTime;
+ private int stopCount = 0;
+ private float angle;
+
+ public Human(Point4f origin, Point4f position, Vector4f scale) {
+ super(origin, position, scale);
+ }
+
+ public Human(Point4f origin, Point4f position, Vector4f scale, HashMap textures) {
+ super(origin, position, scale, textures);
+ }
+
- public Human(HashMap textures) {
- this.textures = textures;
+ public float getDelta() {
+ return delta;
+ }
+
+ public void setDelta(float delta) {
+ this.delta = delta;
+ }
+
+ public void walk() {
+ stopCount = 0;
+ if (isWalking == false) {
+ isWalking = true;
+ walkStartTime = Engine.getTimePassed();
+// System.out.println(walkStartTime);
+ }
+ if (isWalking) {
+ this.delta = (Engine.getTimePassed() - walkStartTime)/10000f;
+ }
}
- // Implement using notes in Animation lecture
- public void DrawHuman(float delta, boolean GoodAnimation) {
+ public void stop() {
+ if(stopCount > 5) {
+ isWalking = false;
+ this.delta = 0;
+ stopCount = 0;
+ }
+ stopCount++;
+ }
+
+ public void setAngle(float angle) {
+ this.angle = angle;
+ }
+
+ @Override
+ public void draw() {
+
+
+ Boolean GoodAnimation = true;
+ float theta_face = (float) (delta * 2 * Math.PI);
+// float angle = -(float) (180 * (theta_face) / Math.PI);
+
+ GL11.glRotatef(angle + 180, 0, 1, 0);
+
+
float theta = (float) (delta * 2 * Math.PI) * 8;
//a variable for anim sync
float LimbRotation;
//two animation
if (GoodAnimation) {
- LimbRotation = (float) Math.cos(theta) * 60;
+ LimbRotation = (float) Math.sin(theta) * 60;
} else {
LimbRotation = 0;
}
@@ -68,12 +127,13 @@ public class Human {
GL11.GL_REPEAT);
//bind a color texture
Color.white.bind();
- textures.get("wool_pink").bind();
+
+ getTextures().get("wool_pink").bind();
//Enable TEXTURE
GL11.glEnable(GL11.GL_TEXTURE_2D);
//set texture Parameters
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST);
- texSphere.DrawTexSphere(0.5f, 32, 32, textures.get("wool_pink"));
+ texSphere.DrawTexSphere(0.5f, 32, 32, getTextures().get("wool_pink"));
//Draw finish Disable TEXTURE
GL11.glDisable(GL11.GL_TEXTURE_2D);
@@ -91,11 +151,11 @@ public class Human {
GL11.GL_REPEAT);
Color.white.bind(); //bind color
//bind texture
- textures.get("tnt_side").bind(); //set texture
+ getTextures().get("tnt_side").bind(); //set texture
//Enable TEXTURE
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST);
- texSphere.DrawTexSphere(0.5f, 32, 32, textures.get("tnt_side"));
+ texSphere.DrawTexSphere(0.5f, 32, 32, getTextures().get("tnt_side"));
GL11.glDisable(GL11.GL_TEXTURE_2D); //disable texture
@@ -125,10 +185,10 @@ public class Human {
GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T,
GL11.GL_REPEAT);
Color.white.bind();
- textures.get("awesomeface").bind(); //set texture
+ getTextures().get("awesomeface").bind(); //set texture
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST);
- texSphere.DrawTexSphere(0.5f, 32, 32, textures.get("awesomeface"));
+ texSphere.DrawTexSphere(0.5f, 32, 32, getTextures().get("awesomeface"));
GL11.glDisable(GL11.GL_TEXTURE_2D);
@@ -151,10 +211,10 @@ public class Human {
GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T,
GL11.GL_REPEAT);
Color.white.bind();
- textures.get("default_stone").bind(); //set texture
+ getTextures().get("default_stone").bind(); //set texture
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST);
- texSphere.DrawTexSphere(0.25f, 32, 32, textures.get("default_stone"));
+ texSphere.DrawTexSphere(0.25f, 32, 32, getTextures().get("default_stone"));
GL11.glDisable(GL11.GL_TEXTURE_2D);
// sphere.DrawSphere(0.25f, 32, 32);
@@ -185,10 +245,10 @@ public class Human {
GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T,
GL11.GL_REPEAT);
Color.white.bind();
- textures.get("default_stone").bind();
+ getTextures().get("default_stone").bind();
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST);
- texSphere.DrawTexSphere(0.2f, 32, 32, textures.get("default_stone"));
+ texSphere.DrawTexSphere(0.2f, 32, 32, getTextures().get("default_stone"));
GL11.glDisable(GL11.GL_TEXTURE_2D);
// sphere.DrawSphere(0.2f, 32, 32);
@@ -212,10 +272,10 @@ public class Human {
GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T,
GL11.GL_REPEAT);
Color.white.bind();
- textures.get("default_stone").bind();
+ getTextures().get("default_stone").bind();
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST);
- texSphere.DrawTexSphere(0.2f, 32, 32, textures.get("default_stone"));
+ texSphere.DrawTexSphere(0.2f, 32, 32, getTextures().get("default_stone"));
GL11.glDisable(GL11.GL_TEXTURE_2D);
// sphere.DrawSphere(0.2f, 32, 32);
@@ -244,10 +304,10 @@ public class Human {
GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T,
GL11.GL_REPEAT);
Color.white.bind();
- textures.get("default_stone").bind();
+ getTextures().get("default_stone").bind();
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST);
- texSphere.DrawTexSphere(0.25f, 32, 32, textures.get("default_stone"));
+ texSphere.DrawTexSphere(0.25f, 32, 32, getTextures().get("default_stone"));
GL11.glDisable(GL11.GL_TEXTURE_2D);
// sphere.DrawSphere(0.25f, 32, 32);
@@ -278,10 +338,10 @@ public class Human {
GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T,
GL11.GL_REPEAT);
Color.white.bind();
- textures.get("default_stone").bind();
+ getTextures().get("default_stone").bind();
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST);
- texSphere.DrawTexSphere(0.2f, 32, 32, textures.get("default_stone"));
+ texSphere.DrawTexSphere(0.2f, 32, 32, getTextures().get("default_stone"));
GL11.glDisable(GL11.GL_TEXTURE_2D);
// sphere.DrawSphere(0.2f, 32, 32);
@@ -305,10 +365,10 @@ public class Human {
GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T,
GL11.GL_REPEAT);
Color.white.bind();
- textures.get("default_stone").bind();
+ getTextures().get("default_stone").bind();
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST);
- texSphere.DrawTexSphere(0.2f, 32, 32, textures.get("default_stone"));
+ texSphere.DrawTexSphere(0.2f, 32, 32, getTextures().get("default_stone"));
GL11.glDisable(GL11.GL_TEXTURE_2D);
// sphere.DrawSphere(0.2f, 32, 32);
@@ -344,10 +404,10 @@ public class Human {
GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T,
GL11.GL_REPEAT);
Color.white.bind();
- textures.get("default_cobble").bind();
+ getTextures().get("default_cobble").bind();
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST);
- texSphere.DrawTexSphere(0.25f, 32, 32, textures.get("default_cobble"));
+ texSphere.DrawTexSphere(0.25f, 32, 32, getTextures().get("default_cobble"));
GL11.glDisable(GL11.GL_TEXTURE_2D);
// sphere.DrawSphere(0.25f, 32, 32);
@@ -377,10 +437,10 @@ public class Human {
GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T,
GL11.GL_REPEAT);
Color.white.bind();
- textures.get("default_cobble").bind();
+ getTextures().get("default_cobble").bind();
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST);
- texSphere.DrawTexSphere(0.25f, 32, 32, textures.get("default_cobble"));
+ texSphere.DrawTexSphere(0.25f, 32, 32, getTextures().get("default_cobble"));
GL11.glDisable(GL11.GL_TEXTURE_2D);
// sphere.DrawSphere(0.25f, 32, 32);
@@ -404,10 +464,10 @@ public class Human {
GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T,
GL11.GL_REPEAT);
Color.white.bind();
- textures.get("default_cobble").bind();
+ getTextures().get("default_cobble").bind();
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST);
- texSphere.DrawTexSphere(0.3f, 32, 32, textures.get("default_cobble"));
+ texSphere.DrawTexSphere(0.3f, 32, 32, getTextures().get("default_cobble"));
GL11.glDisable(GL11.GL_TEXTURE_2D);
// sphere.DrawSphere(0.3f, 32, 32);
@@ -434,10 +494,10 @@ public class Human {
GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T,
GL11.GL_REPEAT);
Color.white.bind();
- textures.get("default_cobble").bind();
+ getTextures().get("default_cobble").bind();
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST);
- texSphere.DrawTexSphere(0.25f, 32, 32, textures.get("default_cobble"));
+ texSphere.DrawTexSphere(0.25f, 32, 32, getTextures().get("default_cobble"));
GL11.glDisable(GL11.GL_TEXTURE_2D);
// sphere.DrawSphere(0.25f, 32, 32);
@@ -468,10 +528,10 @@ public class Human {
GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T,
GL11.GL_REPEAT);
Color.white.bind();
- textures.get("default_cobble").bind();
+ getTextures().get("default_cobble").bind();
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST);
- texSphere.DrawTexSphere(0.25f, 32, 32, textures.get("default_cobble"));
+ texSphere.DrawTexSphere(0.25f, 32, 32, getTextures().get("default_cobble"));
GL11.glDisable(GL11.GL_TEXTURE_2D);
// sphere.DrawSphere(0.25f, 32, 32);
@@ -495,10 +555,10 @@ public class Human {
GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T,
GL11.GL_REPEAT);
Color.white.bind();
- textures.get("default_cobble").bind();
+ getTextures().get("default_cobble").bind();
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST);
- texSphere.DrawTexSphere(0.3f, 32, 32, textures.get("default_cobble"));
+ texSphere.DrawTexSphere(0.3f, 32, 32, getTextures().get("default_cobble"));
GL11.glDisable(GL11.GL_TEXTURE_2D);
// sphere.DrawSphere(0.3f, 32, 32);
@@ -517,8 +577,6 @@ public class Human {
GL11.glPopMatrix();
}
-
-
}
diff --git a/src/Scene/Objects/LAVA_Door.java b/src/Scene/Objects/LAVA_Door.java
new file mode 100644
index 0000000..66849bf
--- /dev/null
+++ b/src/Scene/Objects/LAVA_Door.java
@@ -0,0 +1,113 @@
+package Scene.Objects;
+
+import base.GraphicsObjects.Point4f;
+import base.GraphicsObjects.Vector4f;
+import Scene.base.SceneObject;
+import base.objects3D.TexCube;
+import org.lwjgl.opengl.GL11;
+import org.newdawn.slick.Color;
+import org.newdawn.slick.opengl.Texture;
+
+import java.util.HashMap;
+
+/**
+ * @Author: WangYuyang
+ * @Date: 2021/11/2-16:34
+ * @Project: Assignment3
+ * @Package: Scene.Objects
+ * @Description:
+ **/
+public class LAVA_Door extends SceneObject {
+ TexCube cube = new TexCube();
+ public LAVA_Door(Point4f origin, Point4f position, Vector4f scale) {
+ super(origin, position, scale);
+ }
+
+ public LAVA_Door(Point4f origin, Point4f position, Vector4f scale, HashMap textures) {
+ super(origin, position, scale, textures);
+ }
+
+ @Override
+ public void draw() {
+
+ Color.white.bind();
+ getTextures().get("default_lava").bind();
+ GL11.glEnable(GL11.GL_TEXTURE_2D);
+ GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST);
+ GL11.glTranslatef(-2f, 0f, 0);
+ cube.DrawTexCube();
+ //LAVA
+ GL11.glPushMatrix();
+ {
+ //Go UP
+ GL11.glTranslatef(0f, 2f, 0);
+ cube.DrawTexCube();
+ GL11.glPushMatrix();
+ {
+ GL11.glTranslatef(0f, 2f, 0);
+ cube.DrawTexCube();
+ GL11.glPushMatrix();
+ {
+ GL11.glTranslatef(0f, 2f, 0);
+ cube.DrawTexCube();
+ GL11.glPushMatrix();
+ {
+ GL11.glTranslatef(0f, 2f, 0);
+ cube.DrawTexCube();
+ GL11.glPushMatrix();
+ {
+ //go left (TOP lava)
+ GL11.glTranslatef(-2f, 0f, 0);
+ cube.DrawTexCube();
+ GL11.glPushMatrix();
+ {
+ GL11.glTranslatef(-2f, 0f, 0);
+ cube.DrawTexCube();
+ GL11.glPushMatrix();
+ {
+ GL11.glTranslatef(-2f, 0f, 0);
+ cube.DrawTexCube();
+ GL11.glPushMatrix();
+ {
+ //Go DOWN
+ GL11.glTranslatef(0f, -2f, 0);
+ cube.DrawTexCube();
+ GL11.glPushMatrix();
+ {
+ GL11.glTranslatef(0f, -2f, 0);
+ cube.DrawTexCube();
+ GL11.glPushMatrix();
+ {
+ GL11.glTranslatef(0f, -2f, 0);
+ cube.DrawTexCube();
+ GL11.glPushMatrix();
+ {
+ GL11.glTranslatef(0f, -2f, 0);
+ cube.DrawTexCube();
+ }
+ GL11.glPopMatrix();
+ }
+ GL11.glPopMatrix();
+ }
+ GL11.glPopMatrix();
+ }
+ GL11.glPopMatrix();
+ }
+ GL11.glPopMatrix();
+ }
+ GL11.glPopMatrix();
+ }
+ GL11.glPopMatrix();
+ }
+ GL11.glPopMatrix();
+ }
+ GL11.glPopMatrix();
+
+ }
+ GL11.glPopMatrix();
+
+ }
+ GL11.glPopMatrix();
+ GL11.glDisable(GL11.GL_TEXTURE_2D);
+ }
+}
diff --git a/src/Scene/Objects/TNT_Door.java b/src/Scene/Objects/TNT_Door.java
new file mode 100644
index 0000000..2cd26fb
--- /dev/null
+++ b/src/Scene/Objects/TNT_Door.java
@@ -0,0 +1,119 @@
+package Scene.Objects;
+
+import base.GraphicsObjects.Point4f;
+import base.GraphicsObjects.Vector4f;
+import Scene.base.SceneObject;
+import base.objects3D.TexCube;
+import org.lwjgl.opengl.GL11;
+import org.newdawn.slick.Color;
+import org.newdawn.slick.opengl.Texture;
+
+import java.util.HashMap;
+
+/**
+ * @Author: WangYuyang
+ * @Date: 2021/11/2-15:06
+ * @Project: Assignment3
+ * @Package: Scene
+ * @Description:
+ **/
+public class TNT_Door extends SceneObject {
+ TexCube cube1 = new TexCube();
+
+ public TNT_Door(Point4f origin, Point4f position, Vector4f scale) {
+ super(origin, position, scale);
+ }
+
+ public TNT_Door(Point4f origin, Point4f position, Vector4f scale, HashMap textures) {
+ super(origin, position, scale, textures);
+ }
+
+
+ @Override
+ public void draw() {
+
+ Color.white.bind();
+ getTextures().get("tnt_side").bind();
+ GL11.glEnable(GL11.GL_TEXTURE_2D);
+ GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST);
+ cube1.DrawTexCube();
+ //TNT
+ GL11.glPushMatrix();
+ {
+ //go up
+ GL11.glTranslatef(0, 2f, 0);
+ cube1.DrawTexCube();
+ GL11.glPushMatrix();
+ {
+ GL11.glTranslatef(0, 2f, 0);
+ cube1.DrawTexCube();
+ GL11.glPushMatrix();
+ {
+ GL11.glTranslatef(0, 2f, 0);
+ cube1.DrawTexCube();
+ GL11.glPushMatrix();
+ {
+ GL11.glTranslatef(0, 2f, 0);
+ cube1.DrawTexCube();
+ GL11.glPushMatrix();
+ {
+ //right(top TNTs)
+ GL11.glTranslatef(2f, 0f, 0);
+ cube1.DrawTexCube();
+ GL11.glPushMatrix();
+ {
+ GL11.glTranslatef(2f, 0f, 0);
+ cube1.DrawTexCube();
+ GL11.glPushMatrix();
+ {
+ GL11.glTranslatef(2f, 0f, 0);
+ cube1.DrawTexCube();
+ GL11.glPushMatrix();
+ {
+ GL11.glTranslatef(2f, 0f, 0);
+ cube1.DrawTexCube();
+ GL11.glPushMatrix();
+ {
+ //go down
+ GL11.glTranslatef(0f, -2f, 0);
+ cube1.DrawTexCube();
+ GL11.glPushMatrix();
+ {
+ GL11.glTranslatef(0f, -2f, 0);
+ cube1.DrawTexCube();
+ GL11.glPushMatrix();
+ {
+ GL11.glTranslatef(0f, -2f, 0);
+ cube1.DrawTexCube();
+ GL11.glPushMatrix();
+ {
+ GL11.glTranslatef(0f, -2f, 0);
+ cube1.DrawTexCube();
+ }
+ GL11.glPopMatrix();
+ }
+ GL11.glPopMatrix();
+ }
+ GL11.glPopMatrix();
+ }
+ GL11.glPopMatrix();
+ }
+ GL11.glPopMatrix();
+ }
+ GL11.glPopMatrix();
+ }
+ GL11.glPopMatrix();
+ }
+ }
+ GL11.glPopMatrix();
+ }
+ GL11.glPopMatrix();
+ }
+ GL11.glPopMatrix();
+ }
+ GL11.glPopMatrix();
+ GL11.glPopMatrix();
+ GL11.glDisable(GL11.GL_TEXTURE_2D);
+
+ }
+}
diff --git a/src/Scene/Objects/Wall.java b/src/Scene/Objects/Wall.java
new file mode 100644
index 0000000..2c56f68
--- /dev/null
+++ b/src/Scene/Objects/Wall.java
@@ -0,0 +1,54 @@
+package Scene.Objects;
+
+import Scene.base.SceneObject;
+import base.GraphicsObjects.Point4f;
+import base.GraphicsObjects.Vector4f;
+import base.objects3D.TexCube;
+import org.lwjgl.opengl.GL11;
+import org.newdawn.slick.Color;
+import org.newdawn.slick.opengl.Texture;
+
+import java.util.HashMap;
+
+/**
+ * @Author: WangYuyang
+ * @Date: 2021/11/2-16:01
+ * @Project: Assignment3
+ * @Package: Scene.Objects
+ * @Description:
+ **/
+public class Wall extends SceneObject {
+ private TexCube MyGrid = new TexCube();
+
+ public Wall(Point4f origin, Point4f position, Vector4f scale) {
+ super(origin, position, scale);
+ }
+
+ public Wall(Point4f origin, Point4f position, Vector4f scale, HashMap textures) {
+ super(origin, position, scale, textures);
+ }
+
+ public Wall(Point4f origin, Point4f position, Vector4f scale, Vector4f rotation, HashMap textures) {
+ super(origin, position, scale, rotation, textures);
+ }
+
+
+ @Override
+ public void draw() {
+
+ GL11.glTexParameteri(
+ GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T,
+ GL11.GL_REPEAT);
+ GL11.glTexParameteri(
+ GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S,
+ GL11.GL_REPEAT);
+ Color.white.bind();
+ //bind texture
+ getTextures().get("default_dirt").bind();
+ GL11.glEnable(GL11.GL_TEXTURE_2D);
+ GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST);
+ MyGrid.DrawTexCube(10f);
+ GL11.glDisable(GL11.GL_TEXTURE_2D);
+
+ }
+}
diff --git a/src/Scene/Scene.java b/src/Scene/Scene.java
new file mode 100644
index 0000000..77859d7
--- /dev/null
+++ b/src/Scene/Scene.java
@@ -0,0 +1,175 @@
+package Scene;
+
+import Scene.Objects.*;
+import Scene.base.IDrawListener;
+import Scene.base.SceneManager;
+import Scene.base.SceneObject;
+import base.GraphicsObjects.Point4f;
+import base.GraphicsObjects.Vector4f;
+import main.Camera;
+import main.Util;
+import org.lwjgl.input.Keyboard;
+import org.lwjgl.opengl.GL11;
+
+import java.util.HashMap;
+
+/**
+ * @Author: WangYuyang
+ * @Date: 2021/11/4-16:28
+ * @Project: Assignment3
+ * @Package: main
+ * @Description:
+ **/
+public class Scene {
+
+
+ public static void initScene(SceneManager sceneManager, HashMap textures) {
+
+ Human human = new Human(
+ new Point4f(0, 130, 0, 0),
+ new Point4f(0, 0, 0, 0),
+ new Vector4f(90, 90, 90, 0),
+ textures
+ );
+ sceneManager.addSceneObject(human);
+ sceneManager.addSceneObject(new Ground(
+ new Point4f(0, 0, 0, 0),
+ new Point4f(0, 0, 0, 0),
+ new Vector4f(2000f, 1f, 2000f, 0),
+ textures
+ ));
+ sceneManager.addSceneObject(new Ground(
+ new Point4f(0, 2000, 0, 0),
+ new Point4f(0, 0, 0, 0),
+ new Vector4f(2000f, 1f, 2000f, 0),
+ textures
+ ));
+ sceneManager.addSceneObject(new Wall(
+ new Point4f(0, 1000f, 2000, 0),
+ new Point4f(0, 0, 0, 0),
+ new Vector4f(2000f, 1f, 1000f, 0),
+ new Vector4f(1, 0, 0, 90),
+ textures
+ ));
+
+ sceneManager.addSceneObject(new Wall(
+ new Point4f(0, 1000f, -2000, 0),
+ new Point4f(0, 0, 0, 0),
+ new Vector4f(2000f, 1f, 1000f, 0),
+ new Vector4f(1, 0, 0, 90),
+ textures
+ ));
+
+ sceneManager.addSceneObject(new TNT_Door(
+ new Point4f(0, 50f, 200, 0),
+ new Point4f(0, 0, 0, 0),
+ new Vector4f(50f, 50f, 50f, 0),
+ textures
+ ));
+
+ sceneManager.addSceneObject(new LAVA_Door(
+ new Point4f(0, 50f, 200, 0),
+ new Point4f(0, 0, 0, 0),
+ new Vector4f(50f, 50f, 50f, 0),
+ textures
+ ));
+
+ }
+
+ public static void drawAll(SceneManager sceneManager, Integer delta) {
+
+ Boolean KEY_W = Keyboard.isKeyDown(Keyboard.KEY_W);
+ Boolean KEY_A = Keyboard.isKeyDown(Keyboard.KEY_A);
+ Boolean KEY_S = Keyboard.isKeyDown(Keyboard.KEY_S);
+ Boolean KEY_D = Keyboard.isKeyDown(Keyboard.KEY_D);
+
+ sceneManager.drawAll(new IDrawListener() {
+ @Override
+ public void beforeEachDraw(SceneObject object) {
+ GL11.glPushMatrix();
+ if (object instanceof Human) {
+ Human human = (Human) object;
+ Integer speed = 10;
+ float speedX = speed / human.getScale().x;
+ float speedY = speed / human.getScale().y;
+ float speedZ = speed / human.getScale().z;
+ Boolean hasKeyDown = false;
+ Vector4f move = new Vector4f();
+ if (KEY_W) {
+ Vector4f tmp = new Vector4f();
+ tmp = tmp.PlusVector(new Vector4f(0, 0, speedZ, 0));
+ hasKeyDown = true;
+ float angle = Camera.rotation.y - 180;
+ float new_x = (float) (tmp.length() * Math.sin(Math.toRadians(angle)));
+ float new_z = (float) (tmp.length() * Math.cos(Math.toRadians(angle)));
+ tmp.x = -new_x;
+ tmp.z = new_z;
+ System.out.println(tmp);
+ move = tmp.PlusVector(move);
+ human.setAngle(-angle);
+ }
+ if (KEY_D) {
+ Vector4f tmp = new Vector4f();
+ tmp = tmp.PlusVector(new Vector4f(-speedX, 0, 0, 0));
+// System.out.println(tmp.length());
+ hasKeyDown = true;
+ float angle = 180 - Camera.rotation.y - 90;
+ float new_x = (float) (tmp.length() * Math.sin(Math.toRadians(angle)));
+ float new_z = (float) (tmp.length() * Math.cos(Math.toRadians(angle)));
+ tmp.x = new_x;
+ tmp.z = new_z;
+// System.out.println(tmp);
+ move = tmp.PlusVector(move);
+ human.setAngle(angle);
+ }
+ if (KEY_S) {
+ Vector4f tmp = new Vector4f();
+ tmp = tmp.PlusVector(new Vector4f(0, 0, -speedZ, 0));
+ hasKeyDown = true;
+ float angle = Camera.rotation.y - 180;
+ float new_x = (float) (tmp.length() * Math.sin(Math.toRadians(angle)));
+ float new_z = (float) (tmp.length() * Math.cos(Math.toRadians(angle)));
+ tmp.x = new_x;
+ tmp.z = -new_z;
+// System.out.println(tmp);
+ move = tmp.PlusVector(move);
+ human.setAngle(-angle);
+ }
+ if (KEY_A) {
+ Vector4f tmp = new Vector4f();
+ tmp = tmp.PlusVector(new Vector4f(speedX, 0, 0, 0));
+ hasKeyDown = true;
+ float angle = 180 - Camera.rotation.y + 90;
+ float new_x = (float) (tmp.length() * Math.sin(Math.toRadians(angle)));
+ float new_z = (float) (tmp.length() * Math.cos(Math.toRadians(angle)));
+ tmp.x = new_x;
+ tmp.z = new_z;
+ move = tmp.PlusVector(move);
+ human.setAngle(angle);
+ }
+ if (Keyboard.isKeyDown(Keyboard.KEY_SPACE)) {
+ move = move.PlusVector(new Vector4f(0, speedY, 0, 0));
+ }
+ if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
+ move = move.PlusVector(new Vector4f(0, -speedY, 0, 0));
+ }
+ human.move(move);
+// human.setPosition(new Point4f(posn_x * 3.0f, 0.0f, posn_y * 3.0f, 0));
+ if (hasKeyDown) {
+ human.walk();
+
+ }
+ {
+ human.stop();
+ }
+ }
+ }
+
+ @Override
+ public void afterEachDraw(SceneObject object) {
+ GL11.glPopMatrix();
+ }
+ });
+ }
+
+}
diff --git a/src/Scene/base/IDrawListener.java b/src/Scene/base/IDrawListener.java
new file mode 100644
index 0000000..0ae9076
--- /dev/null
+++ b/src/Scene/base/IDrawListener.java
@@ -0,0 +1,13 @@
+package Scene.base;
+
+/**
+ * @Author: WangYuyang
+ * @Date: 2021/11/2-15:46
+ * @Project: Assignment3
+ * @Package: Scene
+ * @Description:
+ **/
+public interface IDrawListener {
+ void beforeEachDraw(SceneObject object);
+ void afterEachDraw(SceneObject object);
+}
diff --git a/src/Scene/base/IDrawable.java b/src/Scene/base/IDrawable.java
new file mode 100644
index 0000000..be65ac5
--- /dev/null
+++ b/src/Scene/base/IDrawable.java
@@ -0,0 +1,13 @@
+package Scene.base;
+
+/**
+ * @Author: WangYuyang
+ * @Date: 2021/11/2-15:06
+ * @Project: Assignment3
+ * @Package: Scene
+ * @Description:
+ **/
+public interface IDrawable {
+ void draw(IDrawListener listener);
+ void draw();
+}
diff --git a/src/Scene/base/IMovable.java b/src/Scene/base/IMovable.java
new file mode 100644
index 0000000..ce83a5f
--- /dev/null
+++ b/src/Scene/base/IMovable.java
@@ -0,0 +1,16 @@
+package Scene.base;
+
+import base.GraphicsObjects.Point4f;
+import base.GraphicsObjects.Vector4f;
+
+/**
+ * @Author: WangYuyang
+ * @Date: 2021/11/2-15:42
+ * @Project: Assignment3
+ * @Package: Scene
+ * @Description:
+ **/
+public interface IMovable {
+ void setPosition(Point4f point);
+ void move(Vector4f vector);
+}
diff --git a/src/Scene/base/IScalable.java b/src/Scene/base/IScalable.java
new file mode 100644
index 0000000..a7e323d
--- /dev/null
+++ b/src/Scene/base/IScalable.java
@@ -0,0 +1,15 @@
+package Scene.base;
+
+import base.GraphicsObjects.Vector4f;
+
+/**
+ * @Author: WangYuyang
+ * @Date: 2021/11/2-16:23
+ * @Project: Assignment3
+ * @Package: Scene
+ * @Description:
+ **/
+public interface IScalable {
+ void setScale(Vector4f scale);
+
+}
diff --git a/src/Scene/base/SceneManager.java b/src/Scene/base/SceneManager.java
new file mode 100644
index 0000000..f52cd10
--- /dev/null
+++ b/src/Scene/base/SceneManager.java
@@ -0,0 +1,32 @@
+package Scene.base;
+
+import java.util.ArrayList;
+
+/**
+ * @Author: WangYuyang
+ * @Date: 2021/11/2-15:39
+ * @Project: Assignment3
+ * @Package: Scene
+ * @Description:
+ **/
+public class SceneManager {
+ private ArrayList sceneObjects = new ArrayList<>();
+
+ public void drawAll(IDrawListener listener){
+ for(int i = 0; i < sceneObjects.size(); i++){
+ sceneObjects.get(i).draw(listener);
+ }
+ }
+
+ public void addSceneObject(SceneObject sceneObject) {
+ sceneObjects.add(sceneObject);
+ }
+
+ public ArrayList getSceneObjects() {
+ return sceneObjects;
+ }
+
+ public void setSceneObjects(ArrayList sceneObjects) {
+ this.sceneObjects = sceneObjects;
+ }
+}
diff --git a/src/Scene/base/SceneObject.java b/src/Scene/base/SceneObject.java
new file mode 100644
index 0000000..33549b2
--- /dev/null
+++ b/src/Scene/base/SceneObject.java
@@ -0,0 +1,123 @@
+package Scene.base;
+
+import base.GraphicsObjects.Point4f;
+import base.GraphicsObjects.Vector4f;
+import org.lwjgl.opengl.GL11;
+import org.newdawn.slick.opengl.Texture;
+
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+
+/**
+ * @Author: WangYuyang
+ * @Date: 2021/11/2-15:07
+ * @Project: Assignment3
+ * @Package: Scene
+ * @Description:
+ **/
+public abstract class SceneObject implements IDrawable, IMovable, IScalable {
+ private Point4f origin = new Point4f();
+ private Point4f position = new Point4f();
+ private Vector4f scale = new Vector4f();
+ private Vector4f rotation = new Vector4f();
+ private HashMap textures = new LinkedHashMap<>();
+
+ public SceneObject(Point4f origin, Point4f position, Vector4f scale) {
+ this.origin = new Point4f(origin.x, origin.y, origin.z, 0);
+ this.position = new Point4f(position.x, position.y, position.z, 0);
+ this.scale = new Vector4f(scale.x, scale.y, scale.z, 0);
+ }
+
+ public SceneObject(Point4f origin, Point4f position, Vector4f scale, HashMap textures) {
+ this.origin = new Point4f(origin.x, origin.y, origin.z, 0);
+ this.position = new Point4f(position.x, position.y, position.z, 0);
+ this.textures = new LinkedHashMap<>(textures);
+ this.scale = new Vector4f(scale.x, scale.y, scale.z, 0);
+ }
+
+ public SceneObject(Point4f origin, Point4f position, Vector4f scale, Vector4f rotation, HashMap textures) {
+ this.origin = origin;
+ this.position = position;
+ this.scale = scale;
+ this.rotation = rotation;
+ this.textures = textures;
+ }
+
+ @Override
+ public void setScale(Vector4f scale) {
+ scale = new Vector4f(
+ scale.x,
+ scale.y,
+ scale.z,
+ 0
+ );
+ }
+
+ @Override
+ public void move(Vector4f vector) {
+ this.position = position.PlusVector(vector);
+
+// GL11.glTranslatef(getOrigin().x, getOrigin().y, getOrigin().z);
+// GL11.glScalef(90f, 90f, 90f);
+// GL11.glTranslatef(getPosition().x , getPosition().y, getPosition().z);
+ }
+
+ @Override
+ public void draw(IDrawListener listener) {
+ //move object to correct position
+ listener.beforeEachDraw(this);
+ GL11.glTranslatef(origin.x, origin.y, origin.z);
+ GL11.glRotatef(rotation.a, rotation.x, rotation.y, rotation.z);
+ GL11.glScalef(scale.x, scale.y, scale.z);
+ GL11.glTranslatef(position.x, position.y, position.z);
+ this.draw();
+ listener.afterEachDraw(this);
+
+ }
+
+ public Point4f getWorldPosition(){
+ Point4f point4f = new Point4f();
+ point4f.x = getOrigin().x + position.x * scale.x;
+ point4f.y = getOrigin().y + position.y * scale.y;
+ point4f.z = getOrigin().z + position.z * scale.z;
+
+ return point4f;
+ }
+
+ public Point4f getOrigin() {
+ return origin;
+ }
+
+ public void setOrigin(Point4f origin) {
+ this.origin = origin;
+ }
+
+ public Point4f getPosition() {
+ return position;
+ }
+
+ @Override
+ public void setPosition(Point4f point) {
+ this.position = new Point4f(
+ point.x,
+ point.y,
+ point.z,
+ 0
+ );
+// GL11.glTranslatef(getOrigin().x, getOrigin().y, getOrigin().z);
+// GL11.glScalef(90f, 90f, 90f);
+// GL11.glTranslatef(getPosition().x , getPosition().y, getPosition().z);
+ }
+
+ public HashMap getTextures() {
+ return textures;
+ }
+
+ public void setTextures(HashMap textures) {
+ this.textures = textures;
+ }
+
+ public Vector4f getScale() {
+ return scale;
+ }
+}
diff --git a/src/GraphicsObjects/Arcball.java b/src/base/GraphicsObjects/Arcball.java
similarity index 94%
rename from src/GraphicsObjects/Arcball.java
rename to src/base/GraphicsObjects/Arcball.java
index 0006d42..36e147d 100644
--- a/src/GraphicsObjects/Arcball.java
+++ b/src/base/GraphicsObjects/Arcball.java
@@ -1,4 +1,4 @@
-package GraphicsObjects;
+package base.GraphicsObjects;
import java.nio.FloatBuffer;
diff --git a/src/GraphicsObjects/Point4f.java b/src/base/GraphicsObjects/Point4f.java
similarity index 97%
rename from src/GraphicsObjects/Point4f.java
rename to src/base/GraphicsObjects/Point4f.java
index 3202c03..e320a9a 100644
--- a/src/GraphicsObjects/Point4f.java
+++ b/src/base/GraphicsObjects/Point4f.java
@@ -1,4 +1,4 @@
-package GraphicsObjects;
+package base.GraphicsObjects;
public class Point4f {
diff --git a/src/GraphicsObjects/Utils.java b/src/base/GraphicsObjects/Utils.java
similarity index 88%
rename from src/GraphicsObjects/Utils.java
rename to src/base/GraphicsObjects/Utils.java
index baa958b..9ef3bdc 100644
--- a/src/GraphicsObjects/Utils.java
+++ b/src/base/GraphicsObjects/Utils.java
@@ -1,4 +1,4 @@
-package GraphicsObjects;
+package base.GraphicsObjects;
import java.nio.FloatBuffer;
import org.lwjgl.BufferUtils;
diff --git a/src/GraphicsObjects/Vector4f.java b/src/base/GraphicsObjects/Vector4f.java
similarity index 93%
rename from src/GraphicsObjects/Vector4f.java
rename to src/base/GraphicsObjects/Vector4f.java
index 45f130a..1a3b1d9 100644
--- a/src/GraphicsObjects/Vector4f.java
+++ b/src/base/GraphicsObjects/Vector4f.java
@@ -1,4 +1,4 @@
-package GraphicsObjects;
+package base.GraphicsObjects;
public class Vector4f {
@@ -136,6 +136,15 @@ public class Vector4f {
return new Vector4f(u0, u1, u2, u3);
}
+ @Override
+ public String toString() {
+ return "Vector4f{" +
+ "x=" + x +
+ ", y=" + y +
+ ", z=" + z +
+ ", a=" + a +
+ '}';
+ }
}
diff --git a/src/GraphicsObjects/quat.java b/src/base/GraphicsObjects/quat.java
similarity index 94%
rename from src/GraphicsObjects/quat.java
rename to src/base/GraphicsObjects/quat.java
index b1c94fa..e465b66 100644
--- a/src/GraphicsObjects/quat.java
+++ b/src/base/GraphicsObjects/quat.java
@@ -1,9 +1,7 @@
-package GraphicsObjects;
+package base.GraphicsObjects;
import java.nio.FloatBuffer;
-import org.lwjgl.BufferUtils;
-
/*
* Created by Owen Grogan on 06/05/2010.
* Copyright 2010 School of Computer Science and Informatics. All rights reserved.
diff --git a/src/base/RenderProgramStatement.java b/src/base/RenderProgramStatement.java
new file mode 100644
index 0000000..0200c39
--- /dev/null
+++ b/src/base/RenderProgramStatement.java
@@ -0,0 +1,12 @@
+package base;
+
+/**
+ * @Author: WangYuyang
+ * @Date: 2021/11/4-16:18
+ * @Project: Assignment3
+ * @Package: base
+ * @Description:
+ **/
+public interface RenderProgramStatement {
+ void render(int delta);
+}
diff --git a/src/objects3D/Cube.java b/src/base/objects3D/Cube.java
similarity index 93%
rename from src/objects3D/Cube.java
rename to src/base/objects3D/Cube.java
index 81dc991..35c18d4 100644
--- a/src/objects3D/Cube.java
+++ b/src/base/objects3D/Cube.java
@@ -1,7 +1,7 @@
-package objects3D;
+package base.objects3D;
-import GraphicsObjects.Point4f;
-import GraphicsObjects.Vector4f;
+import base.GraphicsObjects.Point4f;
+import base.GraphicsObjects.Vector4f;
import org.lwjgl.opengl.GL11;
public class Cube {
diff --git a/src/objects3D/Cylinder.java b/src/base/objects3D/Cylinder.java
similarity index 94%
rename from src/objects3D/Cylinder.java
rename to src/base/objects3D/Cylinder.java
index 0ebc551..5c20ee6 100644
--- a/src/objects3D/Cylinder.java
+++ b/src/base/objects3D/Cylinder.java
@@ -1,6 +1,6 @@
-package objects3D;
+package base.objects3D;
-import GraphicsObjects.Vector4f;
+import base.GraphicsObjects.Vector4f;
import org.lwjgl.opengl.GL11;
public class Cylinder {
diff --git a/src/objects3D/Grid.java b/src/base/objects3D/Grid.java
similarity index 97%
rename from src/objects3D/Grid.java
rename to src/base/objects3D/Grid.java
index 6f9c4e2..d9629ad 100644
--- a/src/objects3D/Grid.java
+++ b/src/base/objects3D/Grid.java
@@ -1,10 +1,8 @@
-package objects3D;
+package base.objects3D;
import org.lwjgl.opengl.GL11;
-import GraphicsObjects.Point4f;
-import GraphicsObjects.Utils;
-import GraphicsObjects.Vector4f;
-
+import base.GraphicsObjects.Utils;
+
public class Grid {
diff --git a/src/objects3D/Sphere.java b/src/base/objects3D/Sphere.java
similarity index 96%
rename from src/objects3D/Sphere.java
rename to src/base/objects3D/Sphere.java
index 96245cf..ef54180 100644
--- a/src/objects3D/Sphere.java
+++ b/src/base/objects3D/Sphere.java
@@ -1,4 +1,4 @@
-package objects3D;
+package base.objects3D;
import org.lwjgl.opengl.GL11;
diff --git a/src/objects3D/TexCube.java b/src/base/objects3D/TexCube.java
similarity index 95%
rename from src/objects3D/TexCube.java
rename to src/base/objects3D/TexCube.java
index 08931dc..7c17d70 100644
--- a/src/objects3D/TexCube.java
+++ b/src/base/objects3D/TexCube.java
@@ -1,7 +1,7 @@
-package objects3D;
+package base.objects3D;
-import GraphicsObjects.Point4f;
-import GraphicsObjects.Vector4f;
+import base.GraphicsObjects.Point4f;
+import base.GraphicsObjects.Vector4f;
import org.lwjgl.opengl.GL11;
public class TexCube {
diff --git a/src/objects3D/TexSphere.java b/src/base/objects3D/TexSphere.java
similarity index 97%
rename from src/objects3D/TexSphere.java
rename to src/base/objects3D/TexSphere.java
index 3fdd562..8532420 100644
--- a/src/objects3D/TexSphere.java
+++ b/src/base/objects3D/TexSphere.java
@@ -1,4 +1,4 @@
-package objects3D;
+package base.objects3D;
import org.lwjgl.opengl.GL11;
import org.newdawn.slick.opengl.Texture;
diff --git a/src/main/Camera.java b/src/main/Camera.java
new file mode 100644
index 0000000..d9ebb6a
--- /dev/null
+++ b/src/main/Camera.java
@@ -0,0 +1,160 @@
+package main;
+
+import base.GraphicsObjects.Vector4f;
+import org.lwjgl.input.Keyboard;
+import org.lwjgl.input.Mouse;
+import org.lwjgl.util.vector.Vector3f;
+
+import static org.lwjgl.opengl.GL11.glRotatef;
+import static org.lwjgl.opengl.GL11.glTranslatef;
+
+/**
+ * @Author: WangYuyang
+ * @Date: 2021/11/4-16:56
+ * @Project: Assignment3
+ * @Package: main
+ * @Description:
+ **/
+public class Camera {
+ private static final int maxLookUp = 30;
+ private static final int maxLookDown = -20;
+ public static int OrthoNumber = 0; // using this for screen size, making a window of 1200 x 800 so aspect ratio 3:2
+ public static Vector3f rotation = new Vector3f(10, 180, 0);
+ private static int mouseSpeed = 1;
+ private static Vector4f inital_camera_position = new Vector4f();
+ private Vector4f position = new Vector4f(0, 0, 0, 0);
+ private float rotationX = -20;
+ private float rotationY = 0;
+ private float rotationZ = 0;
+ private boolean MouseOnepressed = true;
+ private boolean dragMode = false;
+
+
+ public Camera() {
+ }
+
+ public void setCamera(Vector4f v) {
+ inital_camera_position = v;
+// glRotatef(rotationX, 1, 0, 0);
+// glRotatef(rotationY, 0, 1, 0);
+// glRotatef(rotationZ, 0, 0, 1);
+ }
+
+ public void update() {
+ int WheelPosition = Mouse.getDWheel();
+ int MouseX = Mouse.getX();
+ int MouseY = Mouse.getY();
+ int MouseDX = Mouse.getDX();
+ int MouseDY = Mouse.getDY();
+ boolean MouseButtonPressed = Mouse.isButtonDown(0);
+ boolean isGrabbed = Mouse.isGrabbed();
+
+ glTranslatef(inital_camera_position.x, inital_camera_position.y, inital_camera_position.z);
+ if (WheelPosition > 0) {
+ OrthoNumber += 10;
+ }
+ if (WheelPosition < 0) {
+ OrthoNumber -= 10;
+ }
+
+ if (Keyboard.isKeyDown(Keyboard.KEY_W)) {
+ Vector4f move = new Vector4f();
+ move = move.PlusVector(new Vector4f(0, 0, -10, 0));
+// position.z -= 10f;
+ float angle = rotation.y - 180;
+ float new_x = (float) (move.length() * Math.sin(Math.toRadians(angle)));
+ float new_z = (float) (move.length() * Math.cos(Math.toRadians(angle)));
+ move.x = new_x;
+ move.z = -new_z;
+ position = position.PlusVector(move);
+ }
+ if (Keyboard.isKeyDown(Keyboard.KEY_D)) {
+// move = move.PlusVector(new Vector4f(10, 0, 0, 0));
+// position.x += 10f;
+ Vector4f move = new Vector4f();
+ move = move.PlusVector(new Vector4f(10, 0, 0, 0));
+// position.z -= 10f;
+ float angle = 180 - rotation.y + 90;
+ float new_x = (float) (move.length() * Math.sin(Math.toRadians(angle)));
+ float new_z = (float) (move.length() * Math.cos(Math.toRadians(angle)));
+ move.x = new_x;
+ move.z = new_z;
+ position = position.PlusVector(move);
+ }
+ if (Keyboard.isKeyDown(Keyboard.KEY_S)) {
+ Vector4f move = new Vector4f();
+ move = move.PlusVector(new Vector4f(0, 0, 10, 0));
+// position.z += 10f;
+ float angle = rotation.y - 180;
+ float new_x = (float) (move.length() * Math.sin(Math.toRadians(angle)));
+ float new_z = (float) (move.length() * Math.cos(Math.toRadians(angle)));
+ move.x = -new_x;
+ move.z = new_z;
+ position = position.PlusVector(move);
+ }
+ if (Keyboard.isKeyDown(Keyboard.KEY_A)) {
+// move = move.PlusVector(new Vector4f(-10, 0, 0, 0));
+ Vector4f move = new Vector4f();
+ move = move.PlusVector(new Vector4f(-10, 0, 0, 0));
+// position.z -= 10f;
+ float angle = 180 - rotation.y - 90;
+ float new_x = (float) (move.length() * Math.sin(Math.toRadians(angle)));
+ float new_z = (float) (move.length() * Math.cos(Math.toRadians(angle)));
+ move.x = new_x;
+ move.z = new_z;
+ position = position.PlusVector(move);
+ }
+
+
+ if (Keyboard.isKeyDown(Keyboard.KEY_SPACE)) {
+ position.y -= 10f;
+ }
+ if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
+ position.y += 10f;
+ }
+
+ while (Mouse.next()) {
+ if (Mouse.isButtonDown(0)) {
+ Mouse.setGrabbed(true);
+ }
+ if (Mouse.isButtonDown(1)) {
+ Mouse.setGrabbed(false);
+ }
+ }
+
+ if (Mouse.isGrabbed()) {
+ float mouseDX = MouseDX * mouseSpeed * 0.16f;
+ float mouseDY = MouseDY * mouseSpeed * 0.16f;
+ if (rotation.y + mouseDX >= 360) {
+ rotation.y = rotation.y + mouseDX - 360;
+ } else if (rotation.y + mouseDX < 0) {
+ rotation.y = 360 - rotation.y + mouseDX;
+ } else {
+ rotation.y += mouseDX;
+ }
+ if (rotation.x - mouseDY >= maxLookDown && rotation.x - mouseDY <= maxLookUp) {
+ rotation.x += -mouseDY;
+ } else if (rotation.x - mouseDY < maxLookDown) {
+ rotation.x = maxLookDown;
+ } else if (rotation.x - mouseDY > maxLookUp) {
+ rotation.x = maxLookUp;
+ }
+ }
+
+
+ glRotatef(rotation.x, 1, 0, 0);
+ glRotatef(rotation.y, 0, 1, 0);
+ glRotatef(-rotation.z, 0, 0, 1);
+ glTranslatef(position.x, position.y, position.z);
+
+ Main.engine.setOrtho(Camera.OrthoNumber);
+
+
+// GL11.glMatrixMode(GL11.GL_MODELVIEW);
+// FloatBuffer CurrentMatrix = BufferUtils.createFloatBuffer(16);
+// GL11.glGetFloat(GL11.GL_MODELVIEW_MATRIX, CurrentMatrix);
+// MyArcball.getMatrix(CurrentMatrix);
+// GL11.glMultMatrix(CurrentMatrix);
+
+ }
+}
diff --git a/src/main/Engine.java b/src/main/Engine.java
new file mode 100644
index 0000000..10ebe13
--- /dev/null
+++ b/src/main/Engine.java
@@ -0,0 +1,239 @@
+package main;
+
+import base.GraphicsObjects.Utils;
+import base.RenderProgramStatement;
+import org.lwjgl.BufferUtils;
+import org.lwjgl.LWJGLException;
+import org.lwjgl.Sys;
+import org.lwjgl.opengl.Display;
+import org.lwjgl.opengl.DisplayMode;
+import org.lwjgl.opengl.GL11;
+import org.newdawn.slick.opengl.Texture;
+import org.newdawn.slick.opengl.TextureLoader;
+import org.newdawn.slick.util.ResourceLoader;
+
+import java.io.IOException;
+import java.nio.FloatBuffer;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+
+import static org.lwjgl.opengl.GL11.*;
+import static org.lwjgl.util.glu.GLU.gluPerspective;
+
+/**
+ * @Author: WangYuyang
+ * @Date: 2021/11/4-15:58
+ * @Project: Assignment3
+ * @Package: PACKAGE_NAME
+ * @Description:
+ **/
+public class Engine {
+ private static final int FPS = 60;
+ public static HashMap textures = new LinkedHashMap();
+ // basic colours
+ static float black[] = {0.0f, 0.0f, 0.0f, 1.0f};
+ static float white[] = {1.0f, 1.0f, 1.0f, 1.0f};
+ static float grey[] = {0.5f, 0.5f, 0.5f, 1.0f};
+ static float spot[] = {0.1f, 0.1f, 0.1f, 0.5f};
+ // primary colours
+ static float red[] = {1.0f, 0.0f, 0.0f, 1.0f};
+ static float green[] = {0.0f, 1.0f, 0.0f, 1.0f};
+ static float blue[] = {0.0f, 0.0f, 1.0f, 1.0f};
+ // secondary colours
+ static float yellow[] = {1.0f, 1.0f, 0.0f, 1.0f};
+ static float magenta[] = {1.0f, 0.0f, 1.0f, 1.0f};
+ static float cyan[] = {0.0f, 1.0f, 1.0f, 1.0f};
+ // other colours
+ static float orange[] = {1.0f, 0.5f, 0.0f, 1.0f, 1.0f};
+ static float brown[] = {0.5f, 0.25f, 0.0f, 1.0f, 1.0f};
+ static float dkgreen[] = {0.0f, 0.5f, 0.0f, 1.0f, 1.0f};
+ static float pink[] = {1.0f, 0.6f, 0.6f, 1.0f, 1.0f};
+ private static long lastFrameTime;
+ private static long startTime;
+ private static long timePassed;
+ /**
+ * frames per second
+ */
+ int fps;
+ /**
+ * last fps time
+ */
+ long lastFPS;
+
+
+ public Engine(int WIDTH, int HEIGHT) {
+ try {
+ Display.setDisplayMode(new DisplayMode(WIDTH, HEIGHT));
+ Display.create();
+ Display.setTitle("CG Project 1");
+ } catch (LWJGLException e) {
+ e.printStackTrace();
+ }
+ }
+
+ public static HashMap getTextures() {
+ return textures;
+ }
+
+ public static long getStartTime() {
+ return startTime;
+ }
+
+ public static long getTimePassed() {
+ return timePassed;
+ }
+
+ public void init() {
+ Display.setVSyncEnabled(true);
+ loadTexture();
+
+ }
+
+ public void enterModelView() {
+ GL11.glMatrixMode(GL_MODELVIEW);
+ }
+
+ public void initTimer() {
+ lastFrameTime = getTime();
+ startTime = getTime();
+ lastFPS = getTime(); // call before loop to initialise fps timer
+ }
+
+ public void setLight() {
+ GL11.glMatrixMode(GL11.GL_MODELVIEW);
+ FloatBuffer lightPos = BufferUtils.createFloatBuffer(4);
+ lightPos.put(10000f).put(1000f).put(1000).put(0).flip();
+
+ FloatBuffer lightPos2 = BufferUtils.createFloatBuffer(4);
+ lightPos2.put(0f).put(1000f).put(0).put(-1000f).flip();
+
+ FloatBuffer lightPos3 = BufferUtils.createFloatBuffer(4);
+ lightPos3.put(-10000f).put(1000f).put(1000).put(0).flip();
+
+ FloatBuffer lightPos4 = BufferUtils.createFloatBuffer(4);
+ lightPos4.put(1000f).put(1000f).put(1000f).put(0).flip();
+
+ GL11.glLight(GL11.GL_LIGHT0, GL11.GL_POSITION, lightPos); // specify the
+ // position
+ // of the
+ // light
+// GL11.glEnable(GL11.GL_LIGHT0); // switch light #0 on // I've setup specific materials so in real light it will look abit strange
+
+ GL11.glLight(GL11.GL_LIGHT1, GL11.GL_POSITION, lightPos); // specify the
+ // position
+ // of the
+ // light
+ GL11.glEnable(GL11.GL_LIGHT1); // switch light #0 on
+ GL11.glLight(GL11.GL_LIGHT1, GL11.GL_DIFFUSE, Utils.ConvertForGL(spot));
+
+ GL11.glLight(GL11.GL_LIGHT2, GL11.GL_POSITION, lightPos3); // specify
+ // the
+ // position
+ // of the
+ // light
+ GL11.glEnable(GL11.GL_LIGHT2); // switch light #0 on
+ GL11.glLight(GL11.GL_LIGHT2, GL11.GL_DIFFUSE, Utils.ConvertForGL(grey));
+
+ GL11.glLight(GL11.GL_LIGHT3, GL11.GL_POSITION, lightPos4); // specify
+ // the
+ // position
+ // of the
+ // light
+ GL11.glEnable(GL11.GL_LIGHT3); // switch light #0 on
+ GL11.glLight(GL11.GL_LIGHT3, GL11.GL_DIFFUSE, Utils.ConvertForGL(grey));
+
+ GL11.glEnable(GL11.GL_LIGHTING); // switch lighting on
+ GL11.glEnable(GL11.GL_DEPTH_TEST); // make sure depth buffer is switched
+ // on
+ GL11.glEnable(GL11.GL_NORMALIZE); // normalize normal vectors for safety
+ GL11.glEnable(GL11.GL_COLOR_MATERIAL);
+
+ GL11.glEnable(GL11.GL_BLEND);
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
+ }
+
+ public void close() {
+ Display.destroy();
+ System.exit(0);
+ }
+
+ public void render(RenderProgramStatement renderProgram) {
+
+ glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);
+ GL11.glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
+ GL11.glColor3f(0.5f, 0.5f, 1.0f);
+
+ int delta = getDelta();
+ timePassed = getTime() - startTime;
+
+ updateFPS();
+ checkInput();
+ glPushMatrix();
+ renderProgram.render(delta);
+ glPopMatrix();
+
+ Display.update();
+ Display.sync(FPS);
+ }
+
+ private void checkInput() {
+
+ }
+
+ public void setOrtho(int OrthoNumber) {
+ if (600 + OrthoNumber > 0 && 700 + OrthoNumber * 0.66 > 0) {
+ GL11.glMatrixMode(GL11.GL_PROJECTION);
+ GL11.glLoadIdentity();
+ //Placing 0,0 at the center of the screen
+// GL11.glOrtho(1200 / 2 - OrthoNumber, OrthoNumber / 2, (800 / 2 - (OrthoNumber * 0.66f)), (OrthoNumber / 2 * 0.66f), 100000, -100000);
+// GL11.glOrtho(1200 - OrthoNumber, OrthoNumber, (800 - (OrthoNumber * 0.66f)), (OrthoNumber * 0.66f), 100000, -100000);F
+ gluPerspective((float) 60, Display.getWidth() / Display.getHeight(), 100f, 10000);
+
+// GL11.glOrtho(-600 - OrthoNumber, 600 + OrthoNumber, -100 - OrthoNumber * 0.66, 700 + OrthoNumber * 0.66, 100000, -100000);
+ enterModelView();
+ }
+
+ }
+
+ private long getTime() {
+ return (Sys.getTime() * 1000) / Sys.getTimerResolution();
+ }
+
+ private int getDelta() {
+ long currentTime = getTime();
+ int delta = (int) (currentTime - lastFrameTime);
+ lastFrameTime = getTime();
+ return delta;
+ }
+
+ private void loadTexture() {
+ //LOAD textures
+ try {
+ textures.put("awesomeface", TextureLoader.getTexture("PNG", ResourceLoader.getResourceAsStream("res/awesomeface.png")));
+
+ textures.put("default_dirt", TextureLoader.getTexture("PNG", ResourceLoader.getResourceAsStream("res/default_dirt.png")));
+ textures.put("earthspace", TextureLoader.getTexture("PNG", ResourceLoader.getResourceAsStream("res/earthspace.png")));
+ textures.put("tnt_side", TextureLoader.getTexture("PNG", ResourceLoader.getResourceAsStream("res/tnt_side.png")));
+ textures.put("farming_wheat_8", TextureLoader.getTexture("PNG", ResourceLoader.getResourceAsStream("res/farming_wheat_8.png")));
+ textures.put("wool_pink", TextureLoader.getTexture("PNG", ResourceLoader.getResourceAsStream("res/wool_pink.png")));
+ textures.put("default_lava", TextureLoader.getTexture("PNG", ResourceLoader.getResourceAsStream("res/default_lava.png")));
+ textures.put("default_stone", TextureLoader.getTexture("PNG", ResourceLoader.getResourceAsStream("res/default_stone.png")));
+ textures.put("default_cobble", TextureLoader.getTexture("PNG", ResourceLoader.getResourceAsStream("res/default_cobble.png")));
+// textures.put("awesomeface",TextureLoader.getTexture("PNG", ResourceLoader.getResourceAsStream("res/awesomeface.png")));
+// textures.put("awesomeface",TextureLoader.getTexture("PNG", ResourceLoader.getResourceAsStream("res/awesomeface.png")));
+
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ System.out.println("Texture loaded okay ");
+ }
+
+ public void updateFPS() {
+ if (getTime() - lastFPS > 1000) {
+ Display.setTitle("FPS: " + fps);
+ fps = 0;
+ lastFPS += 1000;
+ }
+ fps++;
+ }
+}
diff --git a/src/main/Main.java b/src/main/Main.java
new file mode 100644
index 0000000..94266a2
--- /dev/null
+++ b/src/main/Main.java
@@ -0,0 +1,78 @@
+package main;
+
+import Scene.Scene;
+import Scene.base.SceneManager;
+import base.GraphicsObjects.Vector4f;
+import base.RenderProgramStatement;
+import org.lwjgl.input.Keyboard;
+import org.lwjgl.opengl.Display;
+
+import static org.lwjgl.opengl.GL11.glPopMatrix;
+import static org.lwjgl.opengl.GL11.glPushMatrix;
+
+/**
+ * @Author: WangYuyang
+ * @Date: 2021/11/4-15:58
+ * @Project: Assignment3
+ * @Package: PACKAGE_NAME
+ * @Description:
+ **/
+public class Main {
+ public static final int WIDTH = 1200;
+ public static final int HEIGHT = 800;
+ private static final boolean DEBUG = false;
+ public static Engine engine;
+ private static SceneManager sceneManager = new SceneManager();
+ private static Camera camera = new Camera();
+ private static Boolean FPS_MODE = false;
+
+ public static void main(String[] args) {
+ engine = new Engine(WIDTH, HEIGHT);
+ engine.init();
+ engine.setOrtho(Camera.OrthoNumber);
+ engine.setLight();
+ engine.enterModelView();
+ engine.initTimer();
+
+
+ camera.setCamera(new Vector4f(
+ 0, -300, -600, 0
+ ));
+
+
+ Scene.initScene(sceneManager, Engine.getTextures());
+
+ while (!Display.isCloseRequested()) {
+ glPushMatrix();
+ engine.render(new RenderProgramStatement() {
+ @Override
+ public void render(int delta) {
+ camera.update();
+ Scene.drawAll(sceneManager, delta);
+
+ }
+ });
+ glPopMatrix();
+
+ if (Keyboard.isKeyDown(Keyboard.KEY_ESCAPE)) {
+ break;
+ }
+ if (Keyboard.isKeyDown(Keyboard.KEY_F)) {
+ FPS_MODE = FPS_MODE ? false : true;
+ }
+ if(FPS_MODE){
+ camera.setCamera(new Vector4f(
+ 0, -500, 0, 0
+ ));
+ }
+ else{
+ camera.setCamera(new Vector4f(
+ 0, -300, -600, 0
+ ));
+ }
+ }
+
+ engine.close();
+
+ }
+}
diff --git a/src/MainWindow.java b/src/main/MainWindow.java
similarity index 52%
rename from src/MainWindow.java
rename to src/main/MainWindow.java
index efc2d16..977b08f 100644
--- a/src/MainWindow.java
+++ b/src/main/MainWindow.java
@@ -1,9 +1,16 @@
-import GraphicsObjects.Arcball;
-import GraphicsObjects.Utils;
-import GraphicsObjects.Vector4f;
-import objects3D.Grid;
-import objects3D.Human;
-import objects3D.TexCube;
+package main;
+
+import base.GraphicsObjects.Arcball;
+import base.GraphicsObjects.Point4f;
+import base.GraphicsObjects.Utils;
+import base.GraphicsObjects.Vector4f;
+import Scene.base.IDrawListener;
+import Scene.Objects.Ground;
+import Scene.Objects.Human;
+import Scene.Objects.LAVA_Door;
+import Scene.Objects.TNT_Door;
+import Scene.base.SceneManager;
+import Scene.base.SceneObject;
import org.lwjgl.BufferUtils;
import org.lwjgl.LWJGLException;
import org.lwjgl.Sys;
@@ -12,18 +19,17 @@ import org.lwjgl.input.Mouse;
import org.lwjgl.opengl.Display;
import org.lwjgl.opengl.DisplayMode;
import org.lwjgl.opengl.GL11;
-import org.lwjgl.util.glu.GLU;
-import org.newdawn.slick.Color;
import org.newdawn.slick.opengl.Texture;
import org.newdawn.slick.opengl.TextureLoader;
import org.newdawn.slick.util.ResourceLoader;
+
import java.io.IOException;
import java.nio.FloatBuffer;
import java.util.HashMap;
import java.util.LinkedHashMap;
-//Main windows class controls and creates the 3D virtual world , please do not change this class but edit the other classes to complete the assignment.
-// Main window is built upon the standard Helloworld LWJGL class which I have heavily modified to use as your standard openGL environment.
+//main.Main windows class controls and creates the 3D virtual world , please do not change this class but edit the other classes to complete the assignment.
+// main.Main window is built upon the standard Helloworld LWJGL class which I have heavily modified to use as your standard openGL environment.
//
// Do not touch this class, I will be making a version of it for your 3rd Assignment
@@ -94,10 +100,14 @@ public class MainWindow {
private boolean Earth = false;
//mouse right button click record
- private int secMouseX = 700;
- private int secMouseY = 0;
+ private int secMouseX = 339;
+ private int secMouseY = 155;
//if mouse right button click
private Boolean secMousePressed = false;
+ private SceneManager sceneManager = new SceneManager();
+
+ private Human human;
+
public static void main(String[] argv) {
MainWindow hello = new MainWindow();
@@ -127,6 +137,8 @@ public class MainWindow {
//move camera away
OrthoNumber = 1440;
+ initScene();
+
while (!Display.isCloseRequested()) {
int delta = getDelta();
@@ -164,14 +176,9 @@ public class MainWindow {
//scene rotation
if (MouseButonPressed && !MouseOnepressed) {
MouseOnepressed = true;
-// System.out.println("Mouse drag mode");
MyArcball.startBall(MouseX, MouseY, 1200, 800);
-// System.out.println(MouseX + " " + MouseY);
- System.out.println(OrthoNumber);
dragMode = true;
} else if (!MouseButonPressed) {
-// if(MouseX != LastMouseX)
-// System.out.println(MouseX + " " + MouseY);
MouseOnepressed = false;
dragMode = false;
}
@@ -202,15 +209,15 @@ public class MainWindow {
/* bad animation can be turn on or off using A key)*/
- if (Keyboard.isKeyDown(Keyboard.KEY_A))
- BadAnimation = !BadAnimation;
- if (Keyboard.isKeyDown(Keyboard.KEY_D))
- x += 0.35f * delta;
-
- if (Keyboard.isKeyDown(Keyboard.KEY_W))
- y += 0.35f * delta;
- if (Keyboard.isKeyDown(Keyboard.KEY_S))
- y -= 0.35f * delta;
+// if (Keyboard.isKeyDown(Keyboard.KEY_A))
+// BadAnimation = !BadAnimation;
+// if (Keyboard.isKeyDown(Keyboard.KEY_D))
+// x += 0.35f * delta;
+//
+// if (Keyboard.isKeyDown(Keyboard.KEY_W))
+// y += 0.35f * delta;
+// if (Keyboard.isKeyDown(Keyboard.KEY_S))
+// y -= 0.35f * delta;
if (Keyboard.isKeyDown(Keyboard.KEY_Q))
rotation += 0.35f * delta;
@@ -361,7 +368,9 @@ public class MainWindow {
GL11.glMatrixMode(GL11.GL_PROJECTION);
GL11.glLoadIdentity();
- GL11.glOrtho(1200 - OrthoNumber, OrthoNumber, (800 - (OrthoNumber * 0.66f)), (OrthoNumber * 0.66f), 100000, -100000);
+ GL11.glOrtho(1200/2 - OrthoNumber, OrthoNumber/2, (800/2 - (OrthoNumber * 0.66f)), (OrthoNumber/2 * 0.66f), 100000, -100000);
+// GL11.glOrtho(1200 - OrthoNumber, OrthoNumber, (800 - (OrthoNumber * 0.66f)), (OrthoNumber * 0.66f), 100000, -100000);
+// GL11.glOrtho(-600, 600, -400, 400, 100000, -100000);
GL11.glMatrixMode(GL11.GL_MODELVIEW);
FloatBuffer CurrentMatrix = BufferUtils.createFloatBuffer(16);
@@ -371,7 +380,7 @@ public class MainWindow {
// {
MyArcball.getMatrix(CurrentMatrix);
- // }
+// }
GL11.glLoadMatrix(CurrentMatrix);
@@ -399,282 +408,149 @@ public class MainWindow {
float posn_y = (float) Math.sin(theta);
// OrthoNumber = (int) (1240 + posn_x * 200); //letting the OrthoNumber change when the scene change
-
- if (!BadAnimation) {
-// secMouseX = 600;
-// secMouseY = 100;
- GL11.glTranslatef(secMouseX, secMouseY, 0);
- GLU.gluLookAt(2f, -1f, -1f, 0f, 0f, 0f, 0f, 1f, 0f);
-
-// Vector4f v = new Vector4f(-posn_x, -0.5f, -posn_y, 0f);
-// GL11.glTranslatef(secMouseX, secMouseY, 0);
+// GL11.glTranslatef(secMouseX, secMouseY, 0);
+// System.out.println(secMouseX + " " + secMouseY);
+// Vector4f v1 = new Vector4f(human.getPosition().x, 0f, human.getPosition().z,0f);
+// Vector4f v2 = new Vector4f(0f, 1f, 0f,0f);
+// Vector4f v3 = v1.cross(v2);
+// v3 = new Vector4f(v3.x, v3.y - 1f, v3.z, 0f).Normal();
+
+// GLU.gluLookAt(
+// v3.x,
+// v3.y,
+// v3.z,
+//
+// 0,
+// 0,
+// 0,
+//
+// 0f,
+// 1f,
+// 0f); //change the look at position
+// GLU.gluLookAt(
+// 0,
+// -50,
+// 200,
+//
+// 0,
+// 0,
+// 0,
//
+// 0f,
+// 1f,
+// 0f); //change the look at position
+// if (!BadAnimation) {
+//// secMouseX = 600;
+//// secMouseY = 100;
+//
+//
+//// Vector4f v = new Vector4f(-posn_x, -0.5f, -posn_y, 0f);
+//// GL11.glTranslatef(secMouseX, secMouseY, 0);
+////
// Vector4f v1 = new Vector4f(posn_x, 0f, posn_y,0f);
// Vector4f v2 = new Vector4f(0f, 1f, 0f,0f);
// Vector4f v3 = v1.cross(v2);
// v3 = new Vector4f(v3.x, v3.y + 0.3f, v3.z, 0f).Normal();
//
// GLU.gluLookAt(-v3.x, -v3.y, -v3.z, 0f, 0f, 0f, 0f, 1f, 0f); //change the look at position
- } else {
-
- GL11.glTranslatef(secMouseX, secMouseY, 0);
- GLU.gluLookAt(2f, -1f, -1f, 0f, 0f, 0f, 0f, 1f, 0f);
- }
-
-
- //Draw a big plain
- GL11.glPushMatrix();
- TexCube MyGrid = new TexCube();
- GL11.glScalef(8000f, 1f, 8000f);
- GL11.glTexParameteri(
- GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T,
- GL11.GL_REPEAT);
- GL11.glTexParameteri(
- GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S,
- GL11.GL_REPEAT);
- Color.white.bind();
- //bind texture
- textures.get("default_dirt").bind();
- GL11.glEnable(GL11.GL_TEXTURE_2D);
- GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST);
- MyGrid.DrawTexCube(30f);
- GL11.glDisable(GL11.GL_TEXTURE_2D);
- GL11.glPopMatrix();
-
- GL11.glPushMatrix();
- //human obj
- Human MyHuman = new Human(textures); //init human with textures
-// GL11.glTranslatef(secMouseX,secMouseY,0);
- GL11.glTranslatef(0, 130, 0);
- GL11.glScalef(90f, 90f, 90f);
-
-
- if (!BadAnimation) {
- // insert your animation code to correct the postion for the human rotating
- GL11.glTranslatef(posn_x * 3.0f, 0.0f, posn_y * 3.0f);
- float angle = -(float) (180 * (theta) / Math.PI);
- GL11.glRotatef(180 + angle, 0, 1, 0);
-// System.out.println(theta);
-
- } else {
- //bad animation version
-// GL11.glTranslatef(posn_x * 3.0f, 0.0f, posn_y * 3.0f);
- GL11.glTranslatef(posn_x * 3.0f, 0.0f, posn_y * 3.0f);
- float angle = -(float) (180 * (theta) / Math.PI);
- GL11.glRotatef(180 + angle, 0, 1, 0);
- }
-
- MyHuman.DrawHuman(delta, true); // give a delta for the Human object ot be animated
-
- GL11.glPopMatrix();
-
+// } else {
+//
+// GL11.glTranslatef(secMouseX, secMouseY, 0);
+// GLU.gluLookAt(2f, -1f, -1f, 0f, 0f, 0f, 0f, 1f, 0f);
+// }
- // Draw TNTs
- GL11.glPushMatrix();
- TexCube cube1 = new TexCube();
-// GL11.glTranslatef(secMouseX,secMouseY,0);
- GL11.glTranslatef(0, 50f, 0);
- GL11.glScalef(50f, 50f, 50f);
- Color.white.bind();
- textures.get("tnt_side").bind();
- GL11.glEnable(GL11.GL_TEXTURE_2D);
- GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST);
- cube1.DrawTexCube();
- //TNT
- GL11.glPushMatrix();
- {
- //go up
- GL11.glTranslatef(0, 2f, 0);
- cube1.DrawTexCube();
- GL11.glPushMatrix();
- {
- GL11.glTranslatef(0, 2f, 0);
- cube1.DrawTexCube();
+ sceneManager.drawAll(new IDrawListener() {
+ @Override
+ public void beforeEachDraw(SceneObject object) {
GL11.glPushMatrix();
- {
- GL11.glTranslatef(0, 2f, 0);
- cube1.DrawTexCube();
- GL11.glPushMatrix();
- {
- GL11.glTranslatef(0, 2f, 0);
- cube1.DrawTexCube();
- GL11.glPushMatrix();
- {
- //right(top TNTs)
- GL11.glTranslatef(2f, 0f, 0);
- cube1.DrawTexCube();
- GL11.glPushMatrix();
- {
- GL11.glTranslatef(2f, 0f, 0);
- cube1.DrawTexCube();
- GL11.glPushMatrix();
- {
- GL11.glTranslatef(2f, 0f, 0);
- cube1.DrawTexCube();
- GL11.glPushMatrix();
- {
- GL11.glTranslatef(2f, 0f, 0);
- cube1.DrawTexCube();
- GL11.glPushMatrix();
- {
- //go down
- GL11.glTranslatef(0f, -2f, 0);
- cube1.DrawTexCube();
- GL11.glPushMatrix();
- {
- GL11.glTranslatef(0f, -2f, 0);
- cube1.DrawTexCube();
- GL11.glPushMatrix();
- {
- GL11.glTranslatef(0f, -2f, 0);
- cube1.DrawTexCube();
- GL11.glPushMatrix();
- {
- GL11.glTranslatef(0f, -2f, 0);
- cube1.DrawTexCube();
- }
- GL11.glPopMatrix();
- }
- GL11.glPopMatrix();
- }
- GL11.glPopMatrix();
- }
- GL11.glPopMatrix();
- }
- GL11.glPopMatrix();
- }
- GL11.glPopMatrix();
- }
- GL11.glPopMatrix();
- }
+ if (object instanceof Human) {
+ Human human = (Human) object;
+ Integer speed = 10;
+ float speedX = speed/human.getScale().x;
+ float speedY = speed/human.getScale().y;
+ float speedZ = speed/human.getScale().z;
+ if((Keyboard.isKeyDown(Keyboard.KEY_W))){
+ human.move(new Vector4f(0,0,speedZ,0));
}
- GL11.glPopMatrix();
- }
- GL11.glPopMatrix();
- }
- GL11.glPopMatrix();
- }
- GL11.glPopMatrix();
- GL11.glPopMatrix();
- GL11.glDisable(GL11.GL_TEXTURE_2D);
- GL11.glPopMatrix();
-
-
- //Draw lava
- GL11.glPushMatrix();
- TexCube cube2 = new TexCube();
-// GL11.glTranslatef(secMouseX,secMouseY,0);
- GL11.glTranslatef(0, 50f, 0);
-// GL11.glTranslatef(0, -2f, 0);
- GL11.glScalef(50f, 50f, 50f);
- Color.white.bind();
- textures.get("default_lava").bind();
- GL11.glEnable(GL11.GL_TEXTURE_2D);
- GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST);
- GL11.glTranslatef(-2f, 0f, 0);
- cube2.DrawTexCube();
- //LAVA
- GL11.glPushMatrix();
- {
- //Go UP
- GL11.glTranslatef(0f, 2f, 0);
- cube2.DrawTexCube();
- GL11.glPushMatrix();
- {
- GL11.glTranslatef(0f, 2f, 0);
- cube2.DrawTexCube();
- GL11.glPushMatrix();
- {
- GL11.glTranslatef(0f, 2f, 0);
- cube2.DrawTexCube();
- GL11.glPushMatrix();
- {
- GL11.glTranslatef(0f, 2f, 0);
- cube2.DrawTexCube();
- GL11.glPushMatrix();
- {
- //go left (TOP lava)
- GL11.glTranslatef(-2f, 0f, 0);
- cube2.DrawTexCube();
- GL11.glPushMatrix();
- {
- GL11.glTranslatef(-2f, 0f, 0);
- cube2.DrawTexCube();
- GL11.glPushMatrix();
- {
- GL11.glTranslatef(-2f, 0f, 0);
- cube2.DrawTexCube();
- GL11.glPushMatrix();
- {
- //Go DOWN
- GL11.glTranslatef(0f, -2f, 0);
- cube2.DrawTexCube();
- GL11.glPushMatrix();
- {
- GL11.glTranslatef(0f, -2f, 0);
- cube2.DrawTexCube();
- GL11.glPushMatrix();
- {
- GL11.glTranslatef(0f, -2f, 0);
- cube2.DrawTexCube();
- GL11.glPushMatrix();
- {
- GL11.glTranslatef(0f, -2f, 0);
- cube2.DrawTexCube();
- }
- GL11.glPopMatrix();
- }
- GL11.glPopMatrix();
- }
- GL11.glPopMatrix();
- }
- GL11.glPopMatrix();
- }
- GL11.glPopMatrix();
- }
- GL11.glPopMatrix();
- }
- GL11.glPopMatrix();
+ if((Keyboard.isKeyDown(Keyboard.KEY_A))){
+ human.move(new Vector4f(-speedX,0,0,0));
+ }
+ if((Keyboard.isKeyDown(Keyboard.KEY_S))){
+ human.move(new Vector4f(0,0,-speedZ,0));
+ }
+ if((Keyboard.isKeyDown(Keyboard.KEY_D))){
+ human.move(new Vector4f(speedX,0,0,0));
}
- GL11.glPopMatrix();
+// human.setPosition(new Point4f(posn_x * 3.0f, 0.0f, posn_y * 3.0f, 0));
+ human.setDelta(delta);
}
- GL11.glPopMatrix();
+ }
+ @Override
+ public void afterEachDraw(SceneObject object) {
+ GL11.glPopMatrix();
}
- GL11.glPopMatrix();
+ });
+
- }
- GL11.glPopMatrix();
- GL11.glDisable(GL11.GL_TEXTURE_2D);
- GL11.glPopMatrix();
/*
* This code puts the earth code in which is larger than the human so it appears to change the scene
*/
- if (Earth) {
- //Globe in the centre of the scene
- GL11.glPushMatrix();
-// TexSphere MyGlobe = new TexSphere();
- TexCube MyGlobe = new TexCube();
- GL11.glTranslatef(500, 500, 500);
- GL11.glScalef(140f, 140f, 140f);
-
- GL11.glTexParameteri(
- GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T,
- GL11.GL_CLAMP);
-
- Color.white.bind();
- texture.bind();
- GL11.glEnable(GL11.GL_TEXTURE_2D);
- GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST);
- GL11.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
-
-// MyGlobe.DrawTexSphere(8f, 100, 100, texture);
- MyGlobe.DrawTexCube();
- GL11.glPopMatrix();
- }
+// if (Earth) {
+// //Globe in the centre of the scene
+// GL11.glPushMatrix();
+//// TexSphere MyGlobe = new TexSphere();
+// TexCube MyGlobe = new TexCube();
+// GL11.glTranslatef(500, 500, 500);
+// GL11.glScalef(140f, 140f, 140f);
+//
+// GL11.glTexParameteri(
+// GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T,
+// GL11.GL_CLAMP);
+//
+// Color.white.bind();
+// texture.bind();
+// GL11.glEnable(GL11.GL_TEXTURE_2D);
+// GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST);
+// GL11.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
+//
+//// MyGlobe.DrawTexSphere(8f, 100, 100, texture);
+// MyGlobe.DrawTexCube();
+// GL11.glPopMatrix();
+// }
+
+ }
+ private void initScene() {
+ human = new Human(
+ new Point4f(0, 130, 0, 0),
+ new Point4f(0, 0, 0, 0),
+ new Vector4f(90, 90, 90, 0),
+ textures
+ );
+ sceneManager.addSceneObject(human);
+ sceneManager.addSceneObject(new Ground(
+ new Point4f(0, 0, 0, 0),
+ new Point4f(0, 0, 0, 0),
+ new Vector4f(8000f, 1f, 8000f, 0),
+ textures
+ ));
+
+ sceneManager.addSceneObject(new TNT_Door(
+ new Point4f(0, 50f, 0, 0),
+ new Point4f(0, 0, 0, 0),
+ new Vector4f(50f, 50f, 50f, 0),
+ textures
+ ));
+
+ sceneManager.addSceneObject(new LAVA_Door(
+ new Point4f(0, 50f, 0, 0),
+ new Point4f(0, 0, 0, 0),
+ new Vector4f(50f, 50f, 50f, 0),
+ textures
+ ));
}
/*
diff --git a/src/main/Util.java b/src/main/Util.java
new file mode 100644
index 0000000..0fd14d6
--- /dev/null
+++ b/src/main/Util.java
@@ -0,0 +1,23 @@
+package main;
+
+import base.GraphicsObjects.Vector4f;
+
+/**
+ * @Author: WangYuyang
+ * @Date: 2021/11/4-18:00
+ * @Project: Assignment3
+ * @Package: main
+ * @Description:
+ **/
+public class Util {
+ public static float angle(Vector4f a, Vector4f b) {
+ float dls = a.dot(b) / (a.length() * b.length());
+ if (dls < -1.0F) {
+ dls = -1.0F;
+ } else if (dls > 1.0F) {
+ dls = 1.0F;
+ }
+
+ return (float)Math.acos((double)dls);
+ }
+}