diff options
Diffstat (limited to 'demos/RonsDemos')
100 files changed, 21267 insertions, 0 deletions
diff --git a/demos/RonsDemos/DemoTex1.java b/demos/RonsDemos/DemoTex1.java new file mode 100644 index 0000000..60477f9 --- /dev/null +++ b/demos/RonsDemos/DemoTex1.java @@ -0,0 +1,4158 @@ +/**
+ * @(#) DemoTex1.java
+ * @(#) author: Ronald B. Cemer
+ * @(#) version: 1.0
+ */
+
+import java.io.*;
+import gl4java.GLEnum;
+
+public class DemoTex1 implements HardCodedTexture, GLEnum
+{
+ private static final int width = 64;
+ private static final int height = 64;
+ private static final byte bits[] =
+ {
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x18,(byte)0x08,(byte)0x08,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x10,(byte)0x08,(byte)0x08,
+ (byte)0x18,(byte)0x10,(byte)0x10,
+ (byte)0x20,(byte)0x18,(byte)0x18,
+ (byte)0x29,(byte)0x20,(byte)0x20,
+ (byte)0x18,(byte)0x18,(byte)0x18,
+ (byte)0x10,(byte)0x10,(byte)0x10,
+ (byte)0x08,(byte)0x08,(byte)0x08,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x10,(byte)0x00,(byte)0x00,
+ (byte)0x18,(byte)0x08,(byte)0x08,
+ (byte)0x20,(byte)0x10,(byte)0x10,
+ (byte)0x29,(byte)0x18,(byte)0x18,
+ (byte)0x20,(byte)0x18,(byte)0x18,
+ (byte)0x31,(byte)0x18,(byte)0x18,
+ (byte)0x10,(byte)0x08,(byte)0x08,
+ (byte)0x18,(byte)0x08,(byte)0x10,
+ (byte)0x4a,(byte)0x39,(byte)0x41,
+ (byte)0x5a,(byte)0x4a,(byte)0x52,
+ (byte)0x7b,(byte)0x62,(byte)0x62,
+ (byte)0x7b,(byte)0x62,(byte)0x62,
+ (byte)0x83,(byte)0x73,(byte)0x6a,
+ (byte)0x6a,(byte)0x62,(byte)0x52,
+ (byte)0x6a,(byte)0x62,(byte)0x5a,
+ (byte)0x5a,(byte)0x52,(byte)0x4a,
+ (byte)0x39,(byte)0x31,(byte)0x31,
+ (byte)0x10,(byte)0x10,(byte)0x10,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x18,(byte)0x08,(byte)0x00,
+ (byte)0x18,(byte)0x08,(byte)0x08,
+ (byte)0x10,(byte)0x08,(byte)0x08,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x10,(byte)0x10,(byte)0x08,
+ (byte)0x10,(byte)0x10,(byte)0x08,
+ (byte)0x20,(byte)0x20,(byte)0x20,
+ (byte)0x10,(byte)0x10,(byte)0x10,
+ (byte)0x08,(byte)0x08,(byte)0x08,
+ (byte)0x10,(byte)0x08,(byte)0x08,
+ (byte)0x5a,(byte)0x39,(byte)0x4a,
+ (byte)0x62,(byte)0x39,(byte)0x4a,
+ (byte)0x73,(byte)0x41,(byte)0x5a,
+ (byte)0x7b,(byte)0x41,(byte)0x52,
+ (byte)0x8b,(byte)0x41,(byte)0x5a,
+ (byte)0x83,(byte)0x39,(byte)0x4a,
+ (byte)0x73,(byte)0x41,(byte)0x41,
+ (byte)0x6a,(byte)0x52,(byte)0x41,
+ (byte)0x6a,(byte)0x5a,(byte)0x4a,
+ (byte)0x6a,(byte)0x62,(byte)0x4a,
+ (byte)0x39,(byte)0x39,(byte)0x29,
+ (byte)0x20,(byte)0x18,(byte)0x18,
+ (byte)0x10,(byte)0x10,(byte)0x10,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x10,(byte)0x08,(byte)0x08,
+ (byte)0x18,(byte)0x10,(byte)0x10,
+ (byte)0x20,(byte)0x18,(byte)0x18,
+ (byte)0x18,(byte)0x18,(byte)0x20,
+ (byte)0x31,(byte)0x31,(byte)0x39,
+ (byte)0x41,(byte)0x41,(byte)0x4a,
+ (byte)0x4a,(byte)0x41,(byte)0x4a,
+ (byte)0x31,(byte)0x31,(byte)0x39,
+ (byte)0x39,(byte)0x39,(byte)0x39,
+ (byte)0x4a,(byte)0x39,(byte)0x31,
+ (byte)0x5a,(byte)0x31,(byte)0x31,
+ (byte)0x5a,(byte)0x31,(byte)0x41,
+ (byte)0x62,(byte)0x20,(byte)0x39,
+ (byte)0x6a,(byte)0x18,(byte)0x39,
+ (byte)0x6a,(byte)0x31,(byte)0x41,
+ (byte)0x5a,(byte)0x29,(byte)0x39,
+ (byte)0x41,(byte)0x10,(byte)0x18,
+ (byte)0x4a,(byte)0x20,(byte)0x31,
+ (byte)0x4a,(byte)0x31,(byte)0x41,
+ (byte)0x52,(byte)0x31,(byte)0x41,
+ (byte)0x62,(byte)0x41,(byte)0x4a,
+ (byte)0x5a,(byte)0x29,(byte)0x31,
+ (byte)0x39,(byte)0x20,(byte)0x18,
+ (byte)0x39,(byte)0x39,(byte)0x29,
+ (byte)0x52,(byte)0x52,(byte)0x41,
+ (byte)0x41,(byte)0x39,(byte)0x39,
+ (byte)0x20,(byte)0x18,(byte)0x10,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x18,(byte)0x10,(byte)0x10,
+ (byte)0x31,(byte)0x29,(byte)0x39,
+ (byte)0x29,(byte)0x29,(byte)0x39,
+ (byte)0x18,(byte)0x18,(byte)0x20,
+ (byte)0x20,(byte)0x20,(byte)0x29,
+ (byte)0x4a,(byte)0x4a,(byte)0x52,
+ (byte)0x73,(byte)0x7b,(byte)0x8b,
+ (byte)0x4a,(byte)0x4a,(byte)0x52,
+ (byte)0x41,(byte)0x39,(byte)0x39,
+ (byte)0x29,(byte)0x20,(byte)0x18,
+ (byte)0x62,(byte)0x41,(byte)0x52,
+ (byte)0x94,(byte)0x62,(byte)0x83,
+ (byte)0x9c,(byte)0x62,(byte)0x83,
+ (byte)0x8b,(byte)0x5a,(byte)0x83,
+ (byte)0x8b,(byte)0x62,(byte)0x94,
+ (byte)0x9c,(byte)0x83,(byte)0xb4,
+ (byte)0x9c,(byte)0x8b,(byte)0xbd,
+ (byte)0x83,(byte)0x6a,(byte)0x94,
+ (byte)0x83,(byte)0x6a,(byte)0x83,
+ (byte)0x8b,(byte)0x62,(byte)0x8b,
+ (byte)0x7b,(byte)0x6a,(byte)0x94,
+ (byte)0x83,(byte)0x6a,(byte)0x94,
+ (byte)0x94,(byte)0x94,(byte)0xb4,
+ (byte)0xa4,(byte)0x7b,(byte)0xac,
+ (byte)0x83,(byte)0x41,(byte)0x73,
+ (byte)0x41,(byte)0x18,(byte)0x29,
+ (byte)0x31,(byte)0x29,(byte)0x20,
+ (byte)0x5a,(byte)0x52,(byte)0x4a,
+ (byte)0x39,(byte)0x31,(byte)0x29,
+ (byte)0x20,(byte)0x18,(byte)0x10,
+ (byte)0x10,(byte)0x10,(byte)0x08,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x10,(byte)0x08,(byte)0x08,
+ (byte)0x20,(byte)0x18,(byte)0x29,
+ (byte)0x31,(byte)0x31,(byte)0x39,
+ (byte)0x29,(byte)0x29,(byte)0x31,
+ (byte)0x10,(byte)0x10,(byte)0x18,
+ (byte)0x10,(byte)0x10,(byte)0x08,
+ (byte)0x08,(byte)0x08,(byte)0x00,
+ (byte)0x52,(byte)0x41,(byte)0x52,
+ (byte)0x7b,(byte)0x6a,(byte)0x8b,
+ (byte)0x6a,(byte)0x6a,(byte)0x73,
+ (byte)0x41,(byte)0x41,(byte)0x4a,
+ (byte)0x41,(byte)0x29,(byte)0x41,
+ (byte)0x41,(byte)0x31,(byte)0x4a,
+ (byte)0x73,(byte)0x62,(byte)0x8b,
+ (byte)0x9c,(byte)0x9c,(byte)0xde,
+ (byte)0x7b,(byte)0xa4,(byte)0xde,
+ (byte)0x6a,(byte)0xac,(byte)0xde,
+ (byte)0x6a,(byte)0xa4,(byte)0xde,
+ (byte)0x62,(byte)0xa4,(byte)0xde,
+ (byte)0x6a,(byte)0xa4,(byte)0xde,
+ (byte)0x73,(byte)0xac,(byte)0xe6,
+ (byte)0x73,(byte)0xa4,(byte)0xde,
+ (byte)0x73,(byte)0xa4,(byte)0xd5,
+ (byte)0x73,(byte)0x9c,(byte)0xcd,
+ (byte)0x7b,(byte)0xac,(byte)0xde,
+ (byte)0x83,(byte)0xb4,(byte)0xe6,
+ (byte)0x9c,(byte)0xac,(byte)0xde,
+ (byte)0x94,(byte)0x62,(byte)0x8b,
+ (byte)0x39,(byte)0x18,(byte)0x18,
+ (byte)0x10,(byte)0x08,(byte)0x08,
+ (byte)0x20,(byte)0x20,(byte)0x20,
+ (byte)0x20,(byte)0x18,(byte)0x10,
+ (byte)0x18,(byte)0x18,(byte)0x10,
+ (byte)0x29,(byte)0x20,(byte)0x18,
+ (byte)0x08,(byte)0x08,(byte)0x08,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x10,(byte)0x00,(byte)0x00,
+ (byte)0x31,(byte)0x20,(byte)0x29,
+ (byte)0x29,(byte)0x20,(byte)0x29,
+ (byte)0x20,(byte)0x18,(byte)0x18,
+ (byte)0x18,(byte)0x10,(byte)0x08,
+ (byte)0x20,(byte)0x18,(byte)0x08,
+ (byte)0x31,(byte)0x20,(byte)0x18,
+ (byte)0x6a,(byte)0x41,(byte)0x52,
+ (byte)0xac,(byte)0x94,(byte)0xbd,
+ (byte)0xbd,(byte)0xbd,(byte)0xee,
+ (byte)0xa4,(byte)0x8b,(byte)0xb4,
+ (byte)0x8b,(byte)0x73,(byte)0x94,
+ (byte)0xa4,(byte)0x8b,(byte)0xbd,
+ (byte)0x94,(byte)0x94,(byte)0xc5,
+ (byte)0x8b,(byte)0xa4,(byte)0xd5,
+ (byte)0x83,(byte)0xac,(byte)0xde,
+ (byte)0x73,(byte)0xa4,(byte)0xde,
+ (byte)0x6a,(byte)0x9c,(byte)0xd5,
+ (byte)0x62,(byte)0x94,(byte)0xd5,
+ (byte)0x52,(byte)0x8b,(byte)0xc5,
+ (byte)0x4a,(byte)0x83,(byte)0xc5,
+ (byte)0x4a,(byte)0x83,(byte)0xc5,
+ (byte)0x52,(byte)0x8b,(byte)0xc5,
+ (byte)0x52,(byte)0x8b,(byte)0xcd,
+ (byte)0x52,(byte)0x94,(byte)0xcd,
+ (byte)0x5a,(byte)0x94,(byte)0xcd,
+ (byte)0x62,(byte)0x9c,(byte)0xd5,
+ (byte)0x73,(byte)0xac,(byte)0xe6,
+ (byte)0x9c,(byte)0x94,(byte)0xcd,
+ (byte)0x7b,(byte)0x41,(byte)0x62,
+ (byte)0x5a,(byte)0x39,(byte)0x39,
+ (byte)0x39,(byte)0x39,(byte)0x29,
+ (byte)0x29,(byte)0x20,(byte)0x20,
+ (byte)0x10,(byte)0x10,(byte)0x10,
+ (byte)0x18,(byte)0x18,(byte)0x10,
+ (byte)0x29,(byte)0x29,(byte)0x20,
+ (byte)0x10,(byte)0x10,(byte)0x08,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x29,(byte)0x18,(byte)0x10,
+ (byte)0x39,(byte)0x29,(byte)0x29,
+ (byte)0x31,(byte)0x20,(byte)0x18,
+ (byte)0x18,(byte)0x18,(byte)0x08,
+ (byte)0x41,(byte)0x39,(byte)0x29,
+ (byte)0x94,(byte)0x73,(byte)0x8b,
+ (byte)0xbd,(byte)0xa4,(byte)0xcd,
+ (byte)0xcd,(byte)0xcd,(byte)0xf6,
+ (byte)0xcd,(byte)0xd5,(byte)0xff,
+ (byte)0xc5,(byte)0xcd,(byte)0xf6,
+ (byte)0xcd,(byte)0xc5,(byte)0xee,
+ (byte)0xc5,(byte)0xd5,(byte)0xff,
+ (byte)0xb4,(byte)0xcd,(byte)0xf6,
+ (byte)0xa4,(byte)0xc5,(byte)0xee,
+ (byte)0x94,(byte)0xbd,(byte)0xe6,
+ (byte)0x83,(byte)0xac,(byte)0xde,
+ (byte)0x7b,(byte)0xa4,(byte)0xde,
+ (byte)0x7b,(byte)0xa4,(byte)0xde,
+ (byte)0x62,(byte)0x94,(byte)0xcd,
+ (byte)0x5a,(byte)0x8b,(byte)0xc5,
+ (byte)0x52,(byte)0x83,(byte)0xc5,
+ (byte)0x4a,(byte)0x83,(byte)0xc5,
+ (byte)0x41,(byte)0x7b,(byte)0xbd,
+ (byte)0x41,(byte)0x7b,(byte)0xbd,
+ (byte)0x41,(byte)0x7b,(byte)0xbd,
+ (byte)0x4a,(byte)0x83,(byte)0xc5,
+ (byte)0x4a,(byte)0x83,(byte)0xc5,
+ (byte)0x52,(byte)0x8b,(byte)0xcd,
+ (byte)0x62,(byte)0x9c,(byte)0xd5,
+ (byte)0x7b,(byte)0x9c,(byte)0xd5,
+ (byte)0x94,(byte)0x5a,(byte)0x8b,
+ (byte)0x6a,(byte)0x31,(byte)0x31,
+ (byte)0x41,(byte)0x39,(byte)0x29,
+ (byte)0x39,(byte)0x31,(byte)0x31,
+ (byte)0x41,(byte)0x41,(byte)0x41,
+ (byte)0x18,(byte)0x18,(byte)0x10,
+ (byte)0x20,(byte)0x18,(byte)0x10,
+ (byte)0x20,(byte)0x18,(byte)0x10,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x10,(byte)0x08,(byte)0x00,
+ (byte)0x39,(byte)0x20,(byte)0x20,
+ (byte)0x41,(byte)0x31,(byte)0x31,
+ (byte)0x18,(byte)0x18,(byte)0x08,
+ (byte)0x29,(byte)0x20,(byte)0x10,
+ (byte)0x5a,(byte)0x41,(byte)0x41,
+ (byte)0x9c,(byte)0x73,(byte)0x9c,
+ (byte)0xac,(byte)0xa4,(byte)0xc5,
+ (byte)0xac,(byte)0xb4,(byte)0xd5,
+ (byte)0xbd,(byte)0xc5,(byte)0xee,
+ (byte)0xcd,(byte)0xd5,(byte)0xff,
+ (byte)0xcd,(byte)0xd5,(byte)0xf6,
+ (byte)0xc5,(byte)0xd5,(byte)0xf6,
+ (byte)0xb4,(byte)0xcd,(byte)0xf6,
+ (byte)0xac,(byte)0xc5,(byte)0xee,
+ (byte)0xac,(byte)0xc5,(byte)0xee,
+ (byte)0x9c,(byte)0xb4,(byte)0xe6,
+ (byte)0x8b,(byte)0xb4,(byte)0xde,
+ (byte)0x94,(byte)0xb4,(byte)0xe6,
+ (byte)0x83,(byte)0xa4,(byte)0xde,
+ (byte)0x6a,(byte)0x94,(byte)0xd5,
+ (byte)0x5a,(byte)0x8b,(byte)0xcd,
+ (byte)0x5a,(byte)0x8b,(byte)0xc5,
+ (byte)0x5a,(byte)0x83,(byte)0xc5,
+ (byte)0x41,(byte)0x73,(byte)0xbd,
+ (byte)0x39,(byte)0x6a,(byte)0xb4,
+ (byte)0x41,(byte)0x73,(byte)0xb4,
+ (byte)0x41,(byte)0x73,(byte)0xbd,
+ (byte)0x39,(byte)0x73,(byte)0xb4,
+ (byte)0x41,(byte)0x7b,(byte)0xbd,
+ (byte)0x4a,(byte)0x83,(byte)0xc5,
+ (byte)0x52,(byte)0x94,(byte)0xcd,
+ (byte)0x73,(byte)0xa4,(byte)0xde,
+ (byte)0x9c,(byte)0x62,(byte)0x9c,
+ (byte)0x7b,(byte)0x31,(byte)0x52,
+ (byte)0x5a,(byte)0x4a,(byte)0x52,
+ (byte)0x4a,(byte)0x4a,(byte)0x41,
+ (byte)0x41,(byte)0x39,(byte)0x39,
+ (byte)0x10,(byte)0x10,(byte)0x08,
+ (byte)0x18,(byte)0x10,(byte)0x08,
+ (byte)0x18,(byte)0x10,(byte)0x08,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x29,(byte)0x18,(byte)0x18,
+ (byte)0x39,(byte)0x20,(byte)0x20,
+ (byte)0x41,(byte)0x31,(byte)0x41,
+ (byte)0x31,(byte)0x31,(byte)0x20,
+ (byte)0x41,(byte)0x41,(byte)0x20,
+ (byte)0x5a,(byte)0x39,(byte)0x41,
+ (byte)0x9c,(byte)0x83,(byte)0xa4,
+ (byte)0xc5,(byte)0xcd,(byte)0xee,
+ (byte)0xac,(byte)0xac,(byte)0xcd,
+ (byte)0xbd,(byte)0xbd,(byte)0xde,
+ (byte)0xd5,(byte)0xd5,(byte)0xff,
+ (byte)0xcd,(byte)0xd5,(byte)0xff,
+ (byte)0xc5,(byte)0xcd,(byte)0xf6,
+ (byte)0xb4,(byte)0xcd,(byte)0xf6,
+ (byte)0xac,(byte)0xc5,(byte)0xee,
+ (byte)0xa4,(byte)0xc5,(byte)0xee,
+ (byte)0x94,(byte)0xb4,(byte)0xe6,
+ (byte)0x8b,(byte)0xac,(byte)0xde,
+ (byte)0x8b,(byte)0xac,(byte)0xde,
+ (byte)0x8b,(byte)0xac,(byte)0xde,
+ (byte)0x83,(byte)0xa4,(byte)0xde,
+ (byte)0x73,(byte)0x9c,(byte)0xd5,
+ (byte)0x6a,(byte)0x94,(byte)0xcd,
+ (byte)0x5a,(byte)0x83,(byte)0xc5,
+ (byte)0x5a,(byte)0x83,(byte)0xc5,
+ (byte)0x5a,(byte)0x8b,(byte)0xc5,
+ (byte)0x4a,(byte)0x7b,(byte)0xbd,
+ (byte)0x41,(byte)0x6a,(byte)0xb4,
+ (byte)0x39,(byte)0x73,(byte)0xb4,
+ (byte)0x39,(byte)0x6a,(byte)0xb4,
+ (byte)0x39,(byte)0x73,(byte)0xb4,
+ (byte)0x39,(byte)0x73,(byte)0xb4,
+ (byte)0x41,(byte)0x7b,(byte)0xbd,
+ (byte)0x52,(byte)0x8b,(byte)0xcd,
+ (byte)0x6a,(byte)0x94,(byte)0xd5,
+ (byte)0x8b,(byte)0x6a,(byte)0xa4,
+ (byte)0x7b,(byte)0x4a,(byte)0x73,
+ (byte)0x52,(byte)0x41,(byte)0x4a,
+ (byte)0x41,(byte)0x39,(byte)0x39,
+ (byte)0x29,(byte)0x29,(byte)0x20,
+ (byte)0x18,(byte)0x18,(byte)0x10,
+ (byte)0x39,(byte)0x29,(byte)0x20,
+ (byte)0x29,(byte)0x20,(byte)0x10,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x10,(byte)0x00,(byte)0x08,
+ (byte)0x29,(byte)0x10,(byte)0x10,
+ (byte)0x31,(byte)0x29,(byte)0x29,
+ (byte)0x4a,(byte)0x4a,(byte)0x41,
+ (byte)0x41,(byte)0x4a,(byte)0x4a,
+ (byte)0x4a,(byte)0x4a,(byte)0x5a,
+ (byte)0x41,(byte)0x41,(byte)0x62,
+ (byte)0xb4,(byte)0xbd,(byte)0xe6,
+ (byte)0xd5,(byte)0xde,(byte)0xff,
+ (byte)0xd5,(byte)0xde,(byte)0xff,
+ (byte)0xd5,(byte)0xde,(byte)0xff,
+ (byte)0xcd,(byte)0xd5,(byte)0xff,
+ (byte)0xcd,(byte)0xd5,(byte)0xf6,
+ (byte)0xc5,(byte)0xd5,(byte)0xf6,
+ (byte)0xc5,(byte)0xcd,(byte)0xf6,
+ (byte)0xb4,(byte)0xcd,(byte)0xf6,
+ (byte)0xac,(byte)0xc5,(byte)0xee,
+ (byte)0x9c,(byte)0xbd,(byte)0xe6,
+ (byte)0x9c,(byte)0xb4,(byte)0xe6,
+ (byte)0x94,(byte)0xb4,(byte)0xe6,
+ (byte)0x94,(byte)0xb4,(byte)0xe6,
+ (byte)0x83,(byte)0xac,(byte)0xde,
+ (byte)0x6a,(byte)0x94,(byte)0xd5,
+ (byte)0x5a,(byte)0x8b,(byte)0xcd,
+ (byte)0x5a,(byte)0x8b,(byte)0xc5,
+ (byte)0x5a,(byte)0x83,(byte)0xc5,
+ (byte)0x52,(byte)0x7b,(byte)0xbd,
+ (byte)0x4a,(byte)0x7b,(byte)0xbd,
+ (byte)0x41,(byte)0x6a,(byte)0xb4,
+ (byte)0x31,(byte)0x62,(byte)0xa4,
+ (byte)0x31,(byte)0x62,(byte)0xa4,
+ (byte)0x39,(byte)0x6a,(byte)0xb4,
+ (byte)0x39,(byte)0x6a,(byte)0xac,
+ (byte)0x31,(byte)0x6a,(byte)0xb4,
+ (byte)0x41,(byte)0x7b,(byte)0xbd,
+ (byte)0x4a,(byte)0x8b,(byte)0xcd,
+ (byte)0x62,(byte)0x9c,(byte)0xd5,
+ (byte)0x7b,(byte)0x83,(byte)0xb4,
+ (byte)0x7b,(byte)0x5a,(byte)0x7b,
+ (byte)0x29,(byte)0x18,(byte)0x20,
+ (byte)0x20,(byte)0x10,(byte)0x10,
+ (byte)0x10,(byte)0x08,(byte)0x08,
+ (byte)0x41,(byte)0x41,(byte)0x39,
+ (byte)0x39,(byte)0x31,(byte)0x31,
+ (byte)0x10,(byte)0x10,(byte)0x08,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x10,(byte)0x08,(byte)0x08,
+ (byte)0x20,(byte)0x18,(byte)0x10,
+ (byte)0x39,(byte)0x31,(byte)0x29,
+ (byte)0x5a,(byte)0x52,(byte)0x5a,
+ (byte)0x4a,(byte)0x52,(byte)0x6a,
+ (byte)0x31,(byte)0x39,(byte)0x62,
+ (byte)0x29,(byte)0x29,(byte)0x41,
+ (byte)0x6a,(byte)0x73,(byte)0x8b,
+ (byte)0xcd,(byte)0xd5,(byte)0xff,
+ (byte)0xcd,(byte)0xd5,(byte)0xf6,
+ (byte)0xcd,(byte)0xd5,(byte)0xf6,
+ (byte)0xcd,(byte)0xd5,(byte)0xff,
+ (byte)0xcd,(byte)0xd5,(byte)0xff,
+ (byte)0xcd,(byte)0xd5,(byte)0xf6,
+ (byte)0xcd,(byte)0xd5,(byte)0xf6,
+ (byte)0xc5,(byte)0xcd,(byte)0xf6,
+ (byte)0xac,(byte)0xc5,(byte)0xee,
+ (byte)0xac,(byte)0xc5,(byte)0xee,
+ (byte)0xb4,(byte)0xc5,(byte)0xee,
+ (byte)0xa4,(byte)0xc5,(byte)0xee,
+ (byte)0x8b,(byte)0xb4,(byte)0xde,
+ (byte)0x7b,(byte)0xa4,(byte)0xde,
+ (byte)0x73,(byte)0x9c,(byte)0xd5,
+ (byte)0x62,(byte)0x94,(byte)0xcd,
+ (byte)0x5a,(byte)0x8b,(byte)0xc5,
+ (byte)0x52,(byte)0x83,(byte)0xc5,
+ (byte)0x41,(byte)0x7b,(byte)0xbd,
+ (byte)0x39,(byte)0x6a,(byte)0xb4,
+ (byte)0x39,(byte)0x6a,(byte)0xb4,
+ (byte)0x41,(byte)0x73,(byte)0xb4,
+ (byte)0x39,(byte)0x6a,(byte)0xac,
+ (byte)0x31,(byte)0x62,(byte)0xa4,
+ (byte)0x39,(byte)0x6a,(byte)0xac,
+ (byte)0x39,(byte)0x6a,(byte)0xac,
+ (byte)0x31,(byte)0x62,(byte)0xac,
+ (byte)0x31,(byte)0x6a,(byte)0xb4,
+ (byte)0x41,(byte)0x7b,(byte)0xbd,
+ (byte)0x52,(byte)0x8b,(byte)0xcd,
+ (byte)0x6a,(byte)0xa4,(byte)0xde,
+ (byte)0x9c,(byte)0xb4,(byte)0xe6,
+ (byte)0x6a,(byte)0x5a,(byte)0x73,
+ (byte)0x20,(byte)0x20,(byte)0x29,
+ (byte)0x20,(byte)0x18,(byte)0x20,
+ (byte)0x18,(byte)0x10,(byte)0x10,
+ (byte)0x18,(byte)0x10,(byte)0x10,
+ (byte)0x18,(byte)0x10,(byte)0x08,
+ (byte)0x20,(byte)0x18,(byte)0x10,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x20,(byte)0x10,(byte)0x18,
+ (byte)0x29,(byte)0x20,(byte)0x20,
+ (byte)0x39,(byte)0x31,(byte)0x29,
+ (byte)0x52,(byte)0x41,(byte)0x39,
+ (byte)0x39,(byte)0x39,(byte)0x5a,
+ (byte)0x39,(byte)0x41,(byte)0x73,
+ (byte)0x31,(byte)0x39,(byte)0x5a,
+ (byte)0x29,(byte)0x29,(byte)0x41,
+ (byte)0x94,(byte)0xa4,(byte)0xc5,
+ (byte)0xd5,(byte)0xde,(byte)0xff,
+ (byte)0xcd,(byte)0xd5,(byte)0xf6,
+ (byte)0xcd,(byte)0xd5,(byte)0xf6,
+ (byte)0xcd,(byte)0xd5,(byte)0xff,
+ (byte)0xd5,(byte)0xde,(byte)0xff,
+ (byte)0xcd,(byte)0xd5,(byte)0xff,
+ (byte)0xcd,(byte)0xd5,(byte)0xff,
+ (byte)0xc5,(byte)0xcd,(byte)0xf6,
+ (byte)0xbd,(byte)0xcd,(byte)0xf6,
+ (byte)0xbd,(byte)0xcd,(byte)0xf6,
+ (byte)0xb4,(byte)0xcd,(byte)0xf6,
+ (byte)0x9c,(byte)0xbd,(byte)0xee,
+ (byte)0x8b,(byte)0xb4,(byte)0xe6,
+ (byte)0x7b,(byte)0xac,(byte)0xde,
+ (byte)0x73,(byte)0x9c,(byte)0xd5,
+ (byte)0x62,(byte)0x94,(byte)0xcd,
+ (byte)0x52,(byte)0x83,(byte)0xc5,
+ (byte)0x4a,(byte)0x83,(byte)0xc5,
+ (byte)0x41,(byte)0x7b,(byte)0xbd,
+ (byte)0x41,(byte)0x7b,(byte)0xbd,
+ (byte)0x41,(byte)0x7b,(byte)0xbd,
+ (byte)0x39,(byte)0x73,(byte)0xb4,
+ (byte)0x39,(byte)0x73,(byte)0xb4,
+ (byte)0x39,(byte)0x73,(byte)0xb4,
+ (byte)0x39,(byte)0x6a,(byte)0xb4,
+ (byte)0x31,(byte)0x6a,(byte)0xac,
+ (byte)0x31,(byte)0x62,(byte)0xac,
+ (byte)0x31,(byte)0x62,(byte)0xac,
+ (byte)0x31,(byte)0x6a,(byte)0xb4,
+ (byte)0x41,(byte)0x7b,(byte)0xbd,
+ (byte)0x5a,(byte)0x94,(byte)0xcd,
+ (byte)0x7b,(byte)0xac,(byte)0xde,
+ (byte)0x94,(byte)0xac,(byte)0xde,
+ (byte)0xa4,(byte)0xb4,(byte)0xde,
+ (byte)0x73,(byte)0x73,(byte)0x8b,
+ (byte)0x10,(byte)0x08,(byte)0x10,
+ (byte)0x18,(byte)0x10,(byte)0x10,
+ (byte)0x08,(byte)0x08,(byte)0x00,
+ (byte)0x10,(byte)0x08,(byte)0x00,
+ (byte)0x10,(byte)0x08,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x08,
+ (byte)0x20,(byte)0x10,(byte)0x10,
+ (byte)0x39,(byte)0x39,(byte)0x29,
+ (byte)0x4a,(byte)0x4a,(byte)0x39,
+ (byte)0x18,(byte)0x18,(byte)0x20,
+ (byte)0x20,(byte)0x20,(byte)0x39,
+ (byte)0x41,(byte)0x4a,(byte)0x73,
+ (byte)0x31,(byte)0x31,(byte)0x5a,
+ (byte)0x31,(byte)0x39,(byte)0x52,
+ (byte)0xb4,(byte)0xbd,(byte)0xe6,
+ (byte)0xcd,(byte)0xd5,(byte)0xff,
+ (byte)0xcd,(byte)0xd5,(byte)0xf6,
+ (byte)0xcd,(byte)0xd5,(byte)0xf6,
+ (byte)0xcd,(byte)0xd5,(byte)0xf6,
+ (byte)0xcd,(byte)0xd5,(byte)0xff,
+ (byte)0xcd,(byte)0xd5,(byte)0xff,
+ (byte)0xcd,(byte)0xd5,(byte)0xff,
+ (byte)0xcd,(byte)0xd5,(byte)0xff,
+ (byte)0xcd,(byte)0xd5,(byte)0xf6,
+ (byte)0xc5,(byte)0xd5,(byte)0xf6,
+ (byte)0xbd,(byte)0xcd,(byte)0xf6,
+ (byte)0xac,(byte)0xb4,(byte)0xe6,
+ (byte)0x94,(byte)0x9c,(byte)0xcd,
+ (byte)0x83,(byte)0x9c,(byte)0xd5,
+ (byte)0x62,(byte)0x9c,(byte)0xd5,
+ (byte)0x5a,(byte)0x94,(byte)0xcd,
+ (byte)0x52,(byte)0x8b,(byte)0xcd,
+ (byte)0x52,(byte)0x8b,(byte)0xcd,
+ (byte)0x52,(byte)0x8b,(byte)0xc5,
+ (byte)0x4a,(byte)0x83,(byte)0xc5,
+ (byte)0x41,(byte)0x83,(byte)0xc5,
+ (byte)0x41,(byte)0x7b,(byte)0xbd,
+ (byte)0x41,(byte)0x7b,(byte)0xbd,
+ (byte)0x39,(byte)0x73,(byte)0xb4,
+ (byte)0x31,(byte)0x6a,(byte)0xb4,
+ (byte)0x31,(byte)0x6a,(byte)0xac,
+ (byte)0x31,(byte)0x62,(byte)0xac,
+ (byte)0x31,(byte)0x62,(byte)0xac,
+ (byte)0x29,(byte)0x62,(byte)0xac,
+ (byte)0x39,(byte)0x73,(byte)0xb4,
+ (byte)0x4a,(byte)0x83,(byte)0xc5,
+ (byte)0x6a,(byte)0x9c,(byte)0xd5,
+ (byte)0x83,(byte)0xb4,(byte)0xe6,
+ (byte)0x9c,(byte)0xc5,(byte)0xee,
+ (byte)0xbd,(byte)0xc5,(byte)0xf6,
+ (byte)0x73,(byte)0x62,(byte)0x83,
+ (byte)0x20,(byte)0x10,(byte)0x18,
+ (byte)0x18,(byte)0x08,(byte)0x08,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x10,(byte)0x08,(byte)0x00,
+ (byte)0x08,(byte)0x08,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x18,(byte)0x08,(byte)0x08,
+ (byte)0x18,(byte)0x18,(byte)0x10,
+ (byte)0x4a,(byte)0x4a,(byte)0x41,
+ (byte)0x31,(byte)0x31,(byte)0x4a,
+ (byte)0x18,(byte)0x20,(byte)0x31,
+ (byte)0x18,(byte)0x18,(byte)0x29,
+ (byte)0x39,(byte)0x41,(byte)0x6a,
+ (byte)0x29,(byte)0x31,(byte)0x52,
+ (byte)0x4a,(byte)0x52,(byte)0x6a,
+ (byte)0xc5,(byte)0xcd,(byte)0xf6,
+ (byte)0xcd,(byte)0xd5,(byte)0xf6,
+ (byte)0xc5,(byte)0xd5,(byte)0xf6,
+ (byte)0xcd,(byte)0xd5,(byte)0xf6,
+ (byte)0xcd,(byte)0xd5,(byte)0xf6,
+ (byte)0xcd,(byte)0xd5,(byte)0xf6,
+ (byte)0xd5,(byte)0xd5,(byte)0xff,
+ (byte)0xd5,(byte)0xd5,(byte)0xff,
+ (byte)0xc5,(byte)0xcd,(byte)0xee,
+ (byte)0xcd,(byte)0xd5,(byte)0xff,
+ (byte)0xc5,(byte)0xac,(byte)0xde,
+ (byte)0x94,(byte)0x62,(byte)0x94,
+ (byte)0x6a,(byte)0x41,(byte)0x6a,
+ (byte)0x5a,(byte)0x39,(byte)0x5a,
+ (byte)0x83,(byte)0x94,(byte)0xcd,
+ (byte)0x7b,(byte)0xac,(byte)0xe6,
+ (byte)0x7b,(byte)0xac,(byte)0xde,
+ (byte)0x73,(byte)0xa4,(byte)0xde,
+ (byte)0x6a,(byte)0xa4,(byte)0xd5,
+ (byte)0x62,(byte)0x9c,(byte)0xd5,
+ (byte)0x52,(byte)0x94,(byte)0xcd,
+ (byte)0x52,(byte)0x8b,(byte)0xcd,
+ (byte)0x4a,(byte)0x8b,(byte)0xc5,
+ (byte)0x4a,(byte)0x83,(byte)0xc5,
+ (byte)0x41,(byte)0x83,(byte)0xbd,
+ (byte)0x41,(byte)0x7b,(byte)0xbd,
+ (byte)0x39,(byte)0x7b,(byte)0xbd,
+ (byte)0x39,(byte)0x73,(byte)0xb4,
+ (byte)0x31,(byte)0x6a,(byte)0xb4,
+ (byte)0x31,(byte)0x6a,(byte)0xac,
+ (byte)0x31,(byte)0x6a,(byte)0xb4,
+ (byte)0x41,(byte)0x83,(byte)0xbd,
+ (byte)0x5a,(byte)0x94,(byte)0xcd,
+ (byte)0x83,(byte)0xac,(byte)0xe6,
+ (byte)0x94,(byte)0xb4,(byte)0xe6,
+ (byte)0xb4,(byte)0xcd,(byte)0xf6,
+ (byte)0xbd,(byte)0xb4,(byte)0xe6,
+ (byte)0x52,(byte)0x41,(byte)0x4a,
+ (byte)0x29,(byte)0x10,(byte)0x10,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x10,(byte)0x10,(byte)0x08,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x18,(byte)0x08,(byte)0x08,
+ (byte)0x29,(byte)0x20,(byte)0x10,
+ (byte)0x4a,(byte)0x41,(byte)0x39,
+ (byte)0x31,(byte)0x31,(byte)0x4a,
+ (byte)0x20,(byte)0x29,(byte)0x4a,
+ (byte)0x20,(byte)0x29,(byte)0x41,
+ (byte)0x18,(byte)0x20,(byte)0x31,
+ (byte)0x29,(byte)0x31,(byte)0x52,
+ (byte)0x29,(byte)0x39,(byte)0x5a,
+ (byte)0x62,(byte)0x6a,(byte)0x83,
+ (byte)0xd5,(byte)0xde,(byte)0xff,
+ (byte)0xd5,(byte)0xde,(byte)0xff,
+ (byte)0xcd,(byte)0xd5,(byte)0xff,
+ (byte)0xd5,(byte)0xd5,(byte)0xff,
+ (byte)0xcd,(byte)0xd5,(byte)0xff,
+ (byte)0xcd,(byte)0xd5,(byte)0xff,
+ (byte)0xcd,(byte)0xd5,(byte)0xf6,
+ (byte)0xa4,(byte)0xa4,(byte)0xc5,
+ (byte)0xac,(byte)0xb4,(byte)0xd5,
+ (byte)0xcd,(byte)0xde,(byte)0xff,
+ (byte)0xbd,(byte)0xcd,(byte)0xf6,
+ (byte)0x7b,(byte)0x8b,(byte)0xa4,
+ (byte)0x29,(byte)0x29,(byte)0x29,
+ (byte)0x4a,(byte)0x4a,(byte)0x62,
+ (byte)0x94,(byte)0x83,(byte)0xb4,
+ (byte)0x8b,(byte)0x62,(byte)0x94,
+ (byte)0x9c,(byte)0x9c,(byte)0xcd,
+ (byte)0x94,(byte)0xa4,(byte)0xde,
+ (byte)0x83,(byte)0xa4,(byte)0xde,
+ (byte)0x73,(byte)0xac,(byte)0xde,
+ (byte)0x62,(byte)0x9c,(byte)0xd5,
+ (byte)0x62,(byte)0x9c,(byte)0xd5,
+ (byte)0x5a,(byte)0x94,(byte)0xd5,
+ (byte)0x5a,(byte)0x94,(byte)0xcd,
+ (byte)0x52,(byte)0x94,(byte)0xcd,
+ (byte)0x52,(byte)0x8b,(byte)0xcd,
+ (byte)0x4a,(byte)0x8b,(byte)0xc5,
+ (byte)0x4a,(byte)0x83,(byte)0xc5,
+ (byte)0x41,(byte)0x7b,(byte)0xbd,
+ (byte)0x41,(byte)0x7b,(byte)0xbd,
+ (byte)0x39,(byte)0x73,(byte)0xbd,
+ (byte)0x41,(byte)0x7b,(byte)0xbd,
+ (byte)0x52,(byte)0x8b,(byte)0xcd,
+ (byte)0x83,(byte)0xac,(byte)0xde,
+ (byte)0x8b,(byte)0xb4,(byte)0xe6,
+ (byte)0xa4,(byte)0xc5,(byte)0xee,
+ (byte)0xc5,(byte)0xd5,(byte)0xff,
+ (byte)0xb4,(byte)0x94,(byte)0xbd,
+ (byte)0x5a,(byte)0x41,(byte)0x4a,
+ (byte)0x18,(byte)0x08,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x10,(byte)0x08,(byte)0x08,
+ (byte)0x18,(byte)0x10,(byte)0x10,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x08,
+ (byte)0x18,(byte)0x10,(byte)0x08,
+ (byte)0x4a,(byte)0x4a,(byte)0x31,
+ (byte)0x62,(byte)0x4a,(byte)0x4a,
+ (byte)0x29,(byte)0x29,(byte)0x41,
+ (byte)0x29,(byte)0x29,(byte)0x41,
+ (byte)0x31,(byte)0x29,(byte)0x4a,
+ (byte)0x20,(byte)0x20,(byte)0x41,
+ (byte)0x18,(byte)0x20,(byte)0x31,
+ (byte)0x20,(byte)0x29,(byte)0x4a,
+ (byte)0x6a,(byte)0x6a,(byte)0x8b,
+ (byte)0xac,(byte)0xb4,(byte)0xd5,
+ (byte)0xa4,(byte)0xa4,(byte)0xc5,
+ (byte)0x9c,(byte)0xa4,(byte)0xcd,
+ (byte)0xa4,(byte)0xac,(byte)0xcd,
+ (byte)0xbd,(byte)0xc5,(byte)0xe6,
+ (byte)0xc5,(byte)0xcd,(byte)0xf6,
+ (byte)0xcd,(byte)0xd5,(byte)0xff,
+ (byte)0xa4,(byte)0xa4,(byte)0xc5,
+ (byte)0xc5,(byte)0xc5,(byte)0xee,
+ (byte)0xc5,(byte)0xb4,(byte)0xe6,
+ (byte)0xbd,(byte)0x9c,(byte)0xc5,
+ (byte)0x8b,(byte)0x7b,(byte)0x9c,
+ (byte)0x31,(byte)0x39,(byte)0x31,
+ (byte)0x5a,(byte)0x29,(byte)0x41,
+ (byte)0x8b,(byte)0x31,(byte)0x4a,
+ (byte)0x83,(byte)0x29,(byte)0x4a,
+ (byte)0x94,(byte)0x39,(byte)0x6a,
+ (byte)0x94,(byte)0x39,(byte)0x4a,
+ (byte)0x94,(byte)0x4a,(byte)0x6a,
+ (byte)0x8b,(byte)0x7b,(byte)0xac,
+ (byte)0x7b,(byte)0xac,(byte)0xde,
+ (byte)0x7b,(byte)0xa4,(byte)0xde,
+ (byte)0x7b,(byte)0xa4,(byte)0xde,
+ (byte)0x73,(byte)0x9c,(byte)0xde,
+ (byte)0x73,(byte)0x94,(byte)0xd5,
+ (byte)0x6a,(byte)0x9c,(byte)0xd5,
+ (byte)0x62,(byte)0x9c,(byte)0xd5,
+ (byte)0x62,(byte)0x94,(byte)0xd5,
+ (byte)0x5a,(byte)0x94,(byte)0xcd,
+ (byte)0x52,(byte)0x94,(byte)0xcd,
+ (byte)0x52,(byte)0x8b,(byte)0xcd,
+ (byte)0x4a,(byte)0x83,(byte)0xc5,
+ (byte)0x4a,(byte)0x8b,(byte)0xc5,
+ (byte)0x7b,(byte)0xac,(byte)0xde,
+ (byte)0x94,(byte)0xb4,(byte)0xe6,
+ (byte)0xa4,(byte)0xc5,(byte)0xee,
+ (byte)0xbd,(byte)0xcd,(byte)0xf6,
+ (byte)0xcd,(byte)0xcd,(byte)0xf6,
+ (byte)0xbd,(byte)0xac,(byte)0xcd,
+ (byte)0x52,(byte)0x39,(byte)0x41,
+ (byte)0x10,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x20,(byte)0x18,(byte)0x18,
+ (byte)0x08,(byte)0x08,(byte)0x08,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x20,(byte)0x08,(byte)0x10,
+ (byte)0x31,(byte)0x29,(byte)0x18,
+ (byte)0x6a,(byte)0x62,(byte)0x4a,
+ (byte)0x31,(byte)0x29,(byte)0x39,
+ (byte)0x08,(byte)0x08,(byte)0x10,
+ (byte)0x18,(byte)0x08,(byte)0x18,
+ (byte)0x29,(byte)0x29,(byte)0x4a,
+ (byte)0x20,(byte)0x29,(byte)0x41,
+ (byte)0x10,(byte)0x10,(byte)0x18,
+ (byte)0x18,(byte)0x18,(byte)0x29,
+ (byte)0x41,(byte)0x41,(byte)0x5a,
+ (byte)0x31,(byte)0x39,(byte)0x5a,
+ (byte)0x31,(byte)0x39,(byte)0x52,
+ (byte)0x29,(byte)0x31,(byte)0x4a,
+ (byte)0x31,(byte)0x39,(byte)0x52,
+ (byte)0x39,(byte)0x39,(byte)0x5a,
+ (byte)0x4a,(byte)0x52,(byte)0x6a,
+ (byte)0x73,(byte)0x73,(byte)0x8b,
+ (byte)0xac,(byte)0x83,(byte)0xac,
+ (byte)0xbd,(byte)0x8b,(byte)0xbd,
+ (byte)0x7b,(byte)0x41,(byte)0x5a,
+ (byte)0x4a,(byte)0x20,(byte)0x29,
+ (byte)0x5a,(byte)0x4a,(byte)0x62,
+ (byte)0x29,(byte)0x29,(byte)0x20,
+ (byte)0x41,(byte)0x31,(byte)0x29,
+ (byte)0x6a,(byte)0x4a,(byte)0x4a,
+ (byte)0x94,(byte)0x5a,(byte)0x7b,
+ (byte)0x73,(byte)0x29,(byte)0x41,
+ (byte)0x4a,(byte)0x20,(byte)0x29,
+ (byte)0x62,(byte)0x41,(byte)0x5a,
+ (byte)0x94,(byte)0x73,(byte)0xa4,
+ (byte)0x9c,(byte)0xbd,(byte)0xee,
+ (byte)0xa4,(byte)0xa4,(byte)0xcd,
+ (byte)0x9c,(byte)0x52,(byte)0x83,
+ (byte)0x9c,(byte)0x52,(byte)0x8b,
+ (byte)0x9c,(byte)0x4a,(byte)0x8b,
+ (byte)0x73,(byte)0x5a,(byte)0x8b,
+ (byte)0x7b,(byte)0xa4,(byte)0xde,
+ (byte)0x7b,(byte)0xac,(byte)0xde,
+ (byte)0x7b,(byte)0xac,(byte)0xde,
+ (byte)0x7b,(byte)0xac,(byte)0xde,
+ (byte)0x7b,(byte)0xa4,(byte)0xde,
+ (byte)0x73,(byte)0xa4,(byte)0xde,
+ (byte)0x62,(byte)0x94,(byte)0xcd,
+ (byte)0x73,(byte)0xa4,(byte)0xde,
+ (byte)0xa4,(byte)0xbd,(byte)0xee,
+ (byte)0xa4,(byte)0xc5,(byte)0xee,
+ (byte)0xbd,(byte)0xcd,(byte)0xf6,
+ (byte)0xcd,(byte)0xd5,(byte)0xf6,
+ (byte)0xde,(byte)0xde,(byte)0xff,
+ (byte)0x8b,(byte)0x7b,(byte)0x8b,
+ (byte)0x20,(byte)0x18,(byte)0x10,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x18,(byte)0x10,(byte)0x10,
+ (byte)0x20,(byte)0x18,(byte)0x10,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x20,(byte)0x10,(byte)0x10,
+ (byte)0x31,(byte)0x10,(byte)0x10,
+ (byte)0x41,(byte)0x39,(byte)0x20,
+ (byte)0x41,(byte)0x41,(byte)0x29,
+ (byte)0x08,(byte)0x08,(byte)0x10,
+ (byte)0x08,(byte)0x00,(byte)0x08,
+ (byte)0x29,(byte)0x20,(byte)0x39,
+ (byte)0x29,(byte)0x31,(byte)0x52,
+ (byte)0x20,(byte)0x20,(byte)0x39,
+ (byte)0x18,(byte)0x18,(byte)0x18,
+ (byte)0x10,(byte)0x08,(byte)0x10,
+ (byte)0x18,(byte)0x10,(byte)0x20,
+ (byte)0x20,(byte)0x29,(byte)0x41,
+ (byte)0x31,(byte)0x39,(byte)0x62,
+ (byte)0x31,(byte)0x41,(byte)0x62,
+ (byte)0x31,(byte)0x39,(byte)0x62,
+ (byte)0x29,(byte)0x31,(byte)0x52,
+ (byte)0x29,(byte)0x29,(byte)0x41,
+ (byte)0x4a,(byte)0x39,(byte)0x5a,
+ (byte)0x73,(byte)0x41,(byte)0x52,
+ (byte)0x52,(byte)0x41,(byte)0x39,
+ (byte)0x41,(byte)0x39,(byte)0x20,
+ (byte)0x10,(byte)0x10,(byte)0x08,
+ (byte)0x39,(byte)0x41,(byte)0x4a,
+ (byte)0x62,(byte)0x5a,(byte)0x73,
+ (byte)0x39,(byte)0x31,(byte)0x31,
+ (byte)0x39,(byte)0x31,(byte)0x29,
+ (byte)0x31,(byte)0x18,(byte)0x18,
+ (byte)0x4a,(byte)0x41,(byte)0x41,
+ (byte)0x52,(byte)0x4a,(byte)0x5a,
+ (byte)0x41,(byte)0x41,(byte)0x4a,
+ (byte)0x7b,(byte)0x6a,(byte)0x83,
+ (byte)0x94,(byte)0x6a,(byte)0x9c,
+ (byte)0x8b,(byte)0x52,(byte)0x73,
+ (byte)0x73,(byte)0x4a,(byte)0x4a,
+ (byte)0x5a,(byte)0x29,(byte)0x31,
+ (byte)0x8b,(byte)0x41,(byte)0x6a,
+ (byte)0x7b,(byte)0x52,(byte)0x73,
+ (byte)0x9c,(byte)0x83,(byte)0xb4,
+ (byte)0x94,(byte)0xac,(byte)0xd5,
+ (byte)0x8b,(byte)0xb4,(byte)0xe6,
+ (byte)0x8b,(byte)0xb4,(byte)0xe6,
+ (byte)0x8b,(byte)0xb4,(byte)0xe6,
+ (byte)0x94,(byte)0xb4,(byte)0xe6,
+ (byte)0x9c,(byte)0xbd,(byte)0xe6,
+ (byte)0x94,(byte)0xb4,(byte)0xe6,
+ (byte)0xac,(byte)0xbd,(byte)0xee,
+ (byte)0xac,(byte)0xc5,(byte)0xee,
+ (byte)0xc5,(byte)0xcd,(byte)0xf6,
+ (byte)0xc5,(byte)0xcd,(byte)0xf6,
+ (byte)0xde,(byte)0xde,(byte)0xff,
+ (byte)0xb4,(byte)0xac,(byte)0xc5,
+ (byte)0x4a,(byte)0x41,(byte)0x41,
+ (byte)0x18,(byte)0x10,(byte)0x08,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x10,(byte)0x08,(byte)0x08,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x39,(byte)0x20,(byte)0x29,
+ (byte)0x4a,(byte)0x29,(byte)0x29,
+ (byte)0x4a,(byte)0x41,(byte)0x31,
+ (byte)0x10,(byte)0x08,(byte)0x08,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x29,(byte)0x10,(byte)0x29,
+ (byte)0x31,(byte)0x31,(byte)0x52,
+ (byte)0x20,(byte)0x29,(byte)0x41,
+ (byte)0x31,(byte)0x31,(byte)0x41,
+ (byte)0x41,(byte)0x39,(byte)0x41,
+ (byte)0x20,(byte)0x20,(byte)0x29,
+ (byte)0x08,(byte)0x10,(byte)0x18,
+ (byte)0x18,(byte)0x18,(byte)0x31,
+ (byte)0x18,(byte)0x20,(byte)0x31,
+ (byte)0x29,(byte)0x31,(byte)0x4a,
+ (byte)0x39,(byte)0x41,(byte)0x6a,
+ (byte)0x39,(byte)0x4a,(byte)0x6a,
+ (byte)0x39,(byte)0x41,(byte)0x6a,
+ (byte)0x52,(byte)0x52,(byte)0x5a,
+ (byte)0x39,(byte)0x41,(byte)0x20,
+ (byte)0x20,(byte)0x20,(byte)0x10,
+ (byte)0x20,(byte)0x20,(byte)0x10,
+ (byte)0x10,(byte)0x10,(byte)0x08,
+ (byte)0x18,(byte)0x18,(byte)0x18,
+ (byte)0x73,(byte)0x73,(byte)0x83,
+ (byte)0x4a,(byte)0x41,(byte)0x52,
+ (byte)0x20,(byte)0x20,(byte)0x29,
+ (byte)0x10,(byte)0x00,(byte)0x00,
+ (byte)0x62,(byte)0x41,(byte)0x52,
+ (byte)0x94,(byte)0x52,(byte)0x73,
+ (byte)0x62,(byte)0x39,(byte)0x4a,
+ (byte)0x94,(byte)0x62,(byte)0x8b,
+ (byte)0x83,(byte)0x41,(byte)0x6a,
+ (byte)0x39,(byte)0x10,(byte)0x10,
+ (byte)0x4a,(byte)0x39,(byte)0x31,
+ (byte)0x4a,(byte)0x41,(byte)0x39,
+ (byte)0x62,(byte)0x5a,(byte)0x62,
+ (byte)0x31,(byte)0x29,(byte)0x31,
+ (byte)0x4a,(byte)0x39,(byte)0x4a,
+ (byte)0x9c,(byte)0xac,(byte)0xd5,
+ (byte)0xa4,(byte)0xc5,(byte)0xee,
+ (byte)0x9c,(byte)0xbd,(byte)0xee,
+ (byte)0x9c,(byte)0xbd,(byte)0xee,
+ (byte)0x9c,(byte)0xbd,(byte)0xe6,
+ (byte)0x9c,(byte)0xbd,(byte)0xee,
+ (byte)0xac,(byte)0xc5,(byte)0xee,
+ (byte)0xb4,(byte)0xc5,(byte)0xee,
+ (byte)0xb4,(byte)0xc5,(byte)0xee,
+ (byte)0xc5,(byte)0xcd,(byte)0xf6,
+ (byte)0xc5,(byte)0xd5,(byte)0xf6,
+ (byte)0xde,(byte)0xd5,(byte)0xf6,
+ (byte)0xcd,(byte)0xc5,(byte)0xde,
+ (byte)0x8b,(byte)0x8b,(byte)0x9c,
+ (byte)0x41,(byte)0x41,(byte)0x39,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x08,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x10,(byte)0x08,(byte)0x10,
+ (byte)0x62,(byte)0x29,(byte)0x41,
+ (byte)0x73,(byte)0x4a,(byte)0x52,
+ (byte)0x20,(byte)0x18,(byte)0x10,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x18,(byte)0x10,(byte)0x18,
+ (byte)0x31,(byte)0x29,(byte)0x4a,
+ (byte)0x20,(byte)0x29,(byte)0x4a,
+ (byte)0x29,(byte)0x31,(byte)0x4a,
+ (byte)0x20,(byte)0x29,(byte)0x41,
+ (byte)0x20,(byte)0x29,(byte)0x31,
+ (byte)0x29,(byte)0x31,(byte)0x41,
+ (byte)0x18,(byte)0x20,(byte)0x39,
+ (byte)0x20,(byte)0x29,(byte)0x41,
+ (byte)0x29,(byte)0x29,(byte)0x4a,
+ (byte)0x20,(byte)0x29,(byte)0x41,
+ (byte)0x18,(byte)0x20,(byte)0x31,
+ (byte)0x29,(byte)0x29,(byte)0x41,
+ (byte)0x39,(byte)0x41,(byte)0x6a,
+ (byte)0x4a,(byte)0x52,(byte)0x5a,
+ (byte)0x29,(byte)0x31,(byte)0x20,
+ (byte)0x31,(byte)0x29,(byte)0x10,
+ (byte)0x29,(byte)0x20,(byte)0x10,
+ (byte)0x10,(byte)0x08,(byte)0x08,
+ (byte)0x29,(byte)0x18,(byte)0x20,
+ (byte)0x4a,(byte)0x4a,(byte)0x52,
+ (byte)0x18,(byte)0x10,(byte)0x10,
+ (byte)0x10,(byte)0x10,(byte)0x08,
+ (byte)0x41,(byte)0x20,(byte)0x31,
+ (byte)0x94,(byte)0x31,(byte)0x5a,
+ (byte)0x7b,(byte)0x08,(byte)0x20,
+ (byte)0x6a,(byte)0x29,(byte)0x39,
+ (byte)0x62,(byte)0x29,(byte)0x41,
+ (byte)0x31,(byte)0x18,(byte)0x20,
+ (byte)0x18,(byte)0x18,(byte)0x18,
+ (byte)0x20,(byte)0x20,(byte)0x18,
+ (byte)0x39,(byte)0x31,(byte)0x29,
+ (byte)0x41,(byte)0x31,(byte)0x31,
+ (byte)0x18,(byte)0x18,(byte)0x20,
+ (byte)0x41,(byte)0x41,(byte)0x4a,
+ (byte)0xbd,(byte)0xc5,(byte)0xee,
+ (byte)0xbd,(byte)0xcd,(byte)0xf6,
+ (byte)0xb4,(byte)0xcd,(byte)0xf6,
+ (byte)0xbd,(byte)0xcd,(byte)0xf6,
+ (byte)0xbd,(byte)0xcd,(byte)0xf6,
+ (byte)0xbd,(byte)0xcd,(byte)0xf6,
+ (byte)0xb4,(byte)0xcd,(byte)0xee,
+ (byte)0xbd,(byte)0xcd,(byte)0xee,
+ (byte)0xbd,(byte)0xcd,(byte)0xee,
+ (byte)0xcd,(byte)0xd5,(byte)0xf6,
+ (byte)0xcd,(byte)0xd5,(byte)0xf6,
+ (byte)0xde,(byte)0xd5,(byte)0xf6,
+ (byte)0xd5,(byte)0xcd,(byte)0xee,
+ (byte)0x9c,(byte)0x9c,(byte)0xac,
+ (byte)0x5a,(byte)0x5a,(byte)0x5a,
+ (byte)0x10,(byte)0x10,(byte)0x08,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x4a,(byte)0x20,(byte)0x39,
+ (byte)0x9c,(byte)0x4a,(byte)0x73,
+ (byte)0x4a,(byte)0x39,(byte)0x29,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x08,(byte)0x10,
+ (byte)0x29,(byte)0x20,(byte)0x39,
+ (byte)0x29,(byte)0x29,(byte)0x4a,
+ (byte)0x29,(byte)0x29,(byte)0x41,
+ (byte)0x29,(byte)0x31,(byte)0x4a,
+ (byte)0x08,(byte)0x18,(byte)0x29,
+ (byte)0x18,(byte)0x20,(byte)0x39,
+ (byte)0x29,(byte)0x31,(byte)0x41,
+ (byte)0x29,(byte)0x29,(byte)0x4a,
+ (byte)0x31,(byte)0x31,(byte)0x5a,
+ (byte)0x31,(byte)0x20,(byte)0x39,
+ (byte)0x31,(byte)0x29,(byte)0x4a,
+ (byte)0x20,(byte)0x29,(byte)0x41,
+ (byte)0x18,(byte)0x18,(byte)0x31,
+ (byte)0x18,(byte)0x18,(byte)0x29,
+ (byte)0x52,(byte)0x4a,(byte)0x62,
+ (byte)0x52,(byte)0x4a,(byte)0x39,
+ (byte)0x31,(byte)0x29,(byte)0x29,
+ (byte)0x29,(byte)0x18,(byte)0x18,
+ (byte)0x20,(byte)0x10,(byte)0x18,
+ (byte)0x10,(byte)0x10,(byte)0x18,
+ (byte)0x18,(byte)0x18,(byte)0x29,
+ (byte)0x10,(byte)0x10,(byte)0x18,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x20,(byte)0x18,(byte)0x10,
+ (byte)0x73,(byte)0x41,(byte)0x4a,
+ (byte)0x83,(byte)0x4a,(byte)0x4a,
+ (byte)0x39,(byte)0x29,(byte)0x18,
+ (byte)0x10,(byte)0x08,(byte)0x00,
+ (byte)0x20,(byte)0x18,(byte)0x18,
+ (byte)0x31,(byte)0x31,(byte)0x29,
+ (byte)0x62,(byte)0x62,(byte)0x5a,
+ (byte)0x41,(byte)0x41,(byte)0x39,
+ (byte)0x29,(byte)0x20,(byte)0x20,
+ (byte)0x10,(byte)0x10,(byte)0x10,
+ (byte)0x31,(byte)0x29,(byte)0x31,
+ (byte)0x8b,(byte)0x62,(byte)0x8b,
+ (byte)0xbd,(byte)0xac,(byte)0xde,
+ (byte)0xcd,(byte)0xd5,(byte)0xf6,
+ (byte)0xc5,(byte)0xcd,(byte)0xf6,
+ (byte)0xbd,(byte)0xcd,(byte)0xf6,
+ (byte)0xc5,(byte)0xcd,(byte)0xf6,
+ (byte)0xc5,(byte)0xd5,(byte)0xf6,
+ (byte)0xcd,(byte)0xd5,(byte)0xf6,
+ (byte)0xcd,(byte)0xcd,(byte)0xf6,
+ (byte)0xcd,(byte)0xd5,(byte)0xf6,
+ (byte)0xcd,(byte)0xd5,(byte)0xf6,
+ (byte)0xde,(byte)0xd5,(byte)0xf6,
+ (byte)0xd5,(byte)0xd5,(byte)0xf6,
+ (byte)0xac,(byte)0xac,(byte)0xbd,
+ (byte)0x73,(byte)0x73,(byte)0x62,
+ (byte)0x20,(byte)0x20,(byte)0x18,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x6a,(byte)0x29,(byte)0x52,
+ (byte)0xac,(byte)0x62,(byte)0x8b,
+ (byte)0x29,(byte)0x20,(byte)0x10,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x18,(byte)0x10,(byte)0x20,
+ (byte)0x29,(byte)0x29,(byte)0x41,
+ (byte)0x31,(byte)0x39,(byte)0x52,
+ (byte)0x18,(byte)0x20,(byte)0x31,
+ (byte)0x08,(byte)0x18,(byte)0x31,
+ (byte)0x29,(byte)0x31,(byte)0x4a,
+ (byte)0x29,(byte)0x29,(byte)0x41,
+ (byte)0x29,(byte)0x31,(byte)0x52,
+ (byte)0x39,(byte)0x29,(byte)0x4a,
+ (byte)0x18,(byte)0x08,(byte)0x10,
+ (byte)0x10,(byte)0x10,(byte)0x18,
+ (byte)0x20,(byte)0x29,(byte)0x41,
+ (byte)0x29,(byte)0x29,(byte)0x4a,
+ (byte)0x29,(byte)0x29,(byte)0x39,
+ (byte)0x62,(byte)0x52,(byte)0x41,
+ (byte)0x52,(byte)0x4a,(byte)0x41,
+ (byte)0x31,(byte)0x29,(byte)0x39,
+ (byte)0x4a,(byte)0x39,(byte)0x41,
+ (byte)0x31,(byte)0x20,(byte)0x20,
+ (byte)0x31,(byte)0x31,(byte)0x39,
+ (byte)0x18,(byte)0x18,(byte)0x29,
+ (byte)0x10,(byte)0x08,(byte)0x08,
+ (byte)0x10,(byte)0x08,(byte)0x08,
+ (byte)0x20,(byte)0x18,(byte)0x20,
+ (byte)0x73,(byte)0x6a,(byte)0x6a,
+ (byte)0x83,(byte)0x7b,(byte)0x73,
+ (byte)0x6a,(byte)0x5a,(byte)0x4a,
+ (byte)0x52,(byte)0x4a,(byte)0x39,
+ (byte)0x31,(byte)0x29,(byte)0x20,
+ (byte)0x18,(byte)0x18,(byte)0x10,
+ (byte)0x41,(byte)0x41,(byte)0x39,
+ (byte)0x18,(byte)0x18,(byte)0x10,
+ (byte)0x20,(byte)0x18,(byte)0x18,
+ (byte)0x18,(byte)0x08,(byte)0x10,
+ (byte)0x10,(byte)0x08,(byte)0x10,
+ (byte)0x52,(byte)0x41,(byte)0x41,
+ (byte)0xb4,(byte)0x8b,(byte)0xb4,
+ (byte)0xd5,(byte)0xd5,(byte)0xf6,
+ (byte)0xd5,(byte)0xd5,(byte)0xf6,
+ (byte)0xd5,(byte)0xd5,(byte)0xf6,
+ (byte)0xcd,(byte)0xd5,(byte)0xf6,
+ (byte)0xc5,(byte)0xcd,(byte)0xf6,
+ (byte)0xc5,(byte)0xd5,(byte)0xf6,
+ (byte)0xcd,(byte)0xd5,(byte)0xf6,
+ (byte)0xcd,(byte)0xd5,(byte)0xf6,
+ (byte)0xd5,(byte)0xd5,(byte)0xf6,
+ (byte)0xde,(byte)0xd5,(byte)0xee,
+ (byte)0xd5,(byte)0xd5,(byte)0xf6,
+ (byte)0xac,(byte)0xac,(byte)0xbd,
+ (byte)0xa4,(byte)0x9c,(byte)0x94,
+ (byte)0x39,(byte)0x29,(byte)0x20,
+ (byte)0x10,(byte)0x10,(byte)0x08,
+ (byte)0x08,(byte)0x08,(byte)0x00,
+ (byte)0x10,(byte)0x08,(byte)0x08,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x08,
+ (byte)0x8b,(byte)0x39,(byte)0x6a,
+ (byte)0x9c,(byte)0x5a,(byte)0x8b,
+ (byte)0x10,(byte)0x08,(byte)0x08,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x08,
+ (byte)0x20,(byte)0x10,(byte)0x18,
+ (byte)0x31,(byte)0x31,(byte)0x4a,
+ (byte)0x31,(byte)0x31,(byte)0x41,
+ (byte)0x18,(byte)0x20,(byte)0x31,
+ (byte)0x18,(byte)0x18,(byte)0x31,
+ (byte)0x31,(byte)0x31,(byte)0x4a,
+ (byte)0x20,(byte)0x29,(byte)0x41,
+ (byte)0x29,(byte)0x31,(byte)0x52,
+ (byte)0x31,(byte)0x20,(byte)0x39,
+ (byte)0x10,(byte)0x00,(byte)0x08,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x18,(byte)0x20,(byte)0x29,
+ (byte)0x39,(byte)0x31,(byte)0x5a,
+ (byte)0x41,(byte)0x39,(byte)0x4a,
+ (byte)0x5a,(byte)0x5a,(byte)0x41,
+ (byte)0x41,(byte)0x39,(byte)0x31,
+ (byte)0x18,(byte)0x18,(byte)0x10,
+ (byte)0x31,(byte)0x20,(byte)0x20,
+ (byte)0x41,(byte)0x29,(byte)0x20,
+ (byte)0x39,(byte)0x29,(byte)0x31,
+ (byte)0x29,(byte)0x20,(byte)0x29,
+ (byte)0x10,(byte)0x08,(byte)0x00,
+ (byte)0x10,(byte)0x08,(byte)0x10,
+ (byte)0x18,(byte)0x10,(byte)0x10,
+ (byte)0x52,(byte)0x41,(byte)0x39,
+ (byte)0x73,(byte)0x6a,(byte)0x62,
+ (byte)0x7b,(byte)0x73,(byte)0x62,
+ (byte)0x4a,(byte)0x41,(byte)0x31,
+ (byte)0x08,(byte)0x08,(byte)0x00,
+ (byte)0x10,(byte)0x08,(byte)0x00,
+ (byte)0x18,(byte)0x10,(byte)0x08,
+ (byte)0x20,(byte)0x18,(byte)0x10,
+ (byte)0x20,(byte)0x18,(byte)0x18,
+ (byte)0x29,(byte)0x10,(byte)0x18,
+ (byte)0x31,(byte)0x08,(byte)0x10,
+ (byte)0x4a,(byte)0x39,(byte)0x39,
+ (byte)0xa4,(byte)0x94,(byte)0xa4,
+ (byte)0xc5,(byte)0xc5,(byte)0xe6,
+ (byte)0xde,(byte)0xd5,(byte)0xf6,
+ (byte)0xde,(byte)0xd5,(byte)0xf6,
+ (byte)0xde,(byte)0xd5,(byte)0xf6,
+ (byte)0xd5,(byte)0xd5,(byte)0xf6,
+ (byte)0xd5,(byte)0xd5,(byte)0xf6,
+ (byte)0xcd,(byte)0xd5,(byte)0xf6,
+ (byte)0xcd,(byte)0xd5,(byte)0xf6,
+ (byte)0xd5,(byte)0xd5,(byte)0xee,
+ (byte)0xde,(byte)0xd5,(byte)0xf6,
+ (byte)0xde,(byte)0xd5,(byte)0xf6,
+ (byte)0xac,(byte)0xac,(byte)0xbd,
+ (byte)0xb4,(byte)0xac,(byte)0xb4,
+ (byte)0x6a,(byte)0x52,(byte)0x4a,
+ (byte)0x08,(byte)0x08,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x10,(byte)0x08,(byte)0x08,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x20,(byte)0x08,(byte)0x18,
+ (byte)0x9c,(byte)0x39,(byte)0x73,
+ (byte)0x6a,(byte)0x39,(byte)0x5a,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x08,(byte)0x08,
+ (byte)0x08,(byte)0x08,(byte)0x10,
+ (byte)0x18,(byte)0x08,(byte)0x18,
+ (byte)0x31,(byte)0x29,(byte)0x39,
+ (byte)0x29,(byte)0x29,(byte)0x29,
+ (byte)0x18,(byte)0x18,(byte)0x29,
+ (byte)0x29,(byte)0x29,(byte)0x31,
+ (byte)0x31,(byte)0x39,(byte)0x4a,
+ (byte)0x29,(byte)0x29,(byte)0x41,
+ (byte)0x31,(byte)0x29,(byte)0x41,
+ (byte)0x20,(byte)0x20,(byte)0x31,
+ (byte)0x10,(byte)0x08,(byte)0x18,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x08,(byte)0x18,
+ (byte)0x39,(byte)0x29,(byte)0x31,
+ (byte)0x62,(byte)0x52,(byte)0x39,
+ (byte)0x62,(byte)0x62,(byte)0x4a,
+ (byte)0x20,(byte)0x20,(byte)0x20,
+ (byte)0x10,(byte)0x10,(byte)0x10,
+ (byte)0x31,(byte)0x18,(byte)0x10,
+ (byte)0x31,(byte)0x18,(byte)0x10,
+ (byte)0x31,(byte)0x29,(byte)0x29,
+ (byte)0x39,(byte)0x39,(byte)0x52,
+ (byte)0x20,(byte)0x18,(byte)0x18,
+ (byte)0x10,(byte)0x10,(byte)0x10,
+ (byte)0x29,(byte)0x20,(byte)0x20,
+ (byte)0x83,(byte)0x7b,(byte)0x73,
+ (byte)0x8b,(byte)0x83,(byte)0x7b,
+ (byte)0x41,(byte)0x39,(byte)0x31,
+ (byte)0x41,(byte)0x41,(byte)0x31,
+ (byte)0x10,(byte)0x10,(byte)0x08,
+ (byte)0x20,(byte)0x10,(byte)0x10,
+ (byte)0x29,(byte)0x20,(byte)0x18,
+ (byte)0x10,(byte)0x10,(byte)0x08,
+ (byte)0x08,(byte)0x08,(byte)0x08,
+ (byte)0x08,(byte)0x08,(byte)0x08,
+ (byte)0x31,(byte)0x10,(byte)0x10,
+ (byte)0x39,(byte)0x20,(byte)0x20,
+ (byte)0x62,(byte)0x52,(byte)0x62,
+ (byte)0x94,(byte)0x94,(byte)0xac,
+ (byte)0xb4,(byte)0xb4,(byte)0xcd,
+ (byte)0xd5,(byte)0xcd,(byte)0xee,
+ (byte)0xde,(byte)0xde,(byte)0xf6,
+ (byte)0xde,(byte)0xd5,(byte)0xf6,
+ (byte)0xde,(byte)0xd5,(byte)0xee,
+ (byte)0xde,(byte)0xd5,(byte)0xee,
+ (byte)0xd5,(byte)0xcd,(byte)0xee,
+ (byte)0xde,(byte)0xd5,(byte)0xee,
+ (byte)0xde,(byte)0xde,(byte)0xf6,
+ (byte)0xd5,(byte)0xd5,(byte)0xee,
+ (byte)0xb4,(byte)0xac,(byte)0xbd,
+ (byte)0xbd,(byte)0xb4,(byte)0xc5,
+ (byte)0xac,(byte)0x9c,(byte)0xac,
+ (byte)0x29,(byte)0x20,(byte)0x18,
+ (byte)0x08,(byte)0x08,(byte)0x08,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x31,(byte)0x08,(byte)0x18,
+ (byte)0x94,(byte)0x29,(byte)0x5a,
+ (byte)0x4a,(byte)0x29,(byte)0x41,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x10,(byte)0x10,(byte)0x29,
+ (byte)0x08,(byte)0x10,(byte)0x18,
+ (byte)0x18,(byte)0x08,(byte)0x18,
+ (byte)0x39,(byte)0x20,(byte)0x29,
+ (byte)0x31,(byte)0x31,(byte)0x29,
+ (byte)0x20,(byte)0x18,(byte)0x18,
+ (byte)0x31,(byte)0x29,(byte)0x29,
+ (byte)0x31,(byte)0x29,(byte)0x4a,
+ (byte)0x31,(byte)0x18,(byte)0x31,
+ (byte)0x18,(byte)0x08,(byte)0x18,
+ (byte)0x00,(byte)0x00,(byte)0x08,
+ (byte)0x10,(byte)0x10,(byte)0x18,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x41,(byte)0x41,(byte)0x31,
+ (byte)0x62,(byte)0x5a,(byte)0x39,
+ (byte)0x52,(byte)0x52,(byte)0x39,
+ (byte)0x29,(byte)0x29,(byte)0x18,
+ (byte)0x10,(byte)0x10,(byte)0x08,
+ (byte)0x39,(byte)0x20,(byte)0x20,
+ (byte)0x52,(byte)0x39,(byte)0x39,
+ (byte)0x18,(byte)0x10,(byte)0x10,
+ (byte)0x10,(byte)0x10,(byte)0x18,
+ (byte)0x29,(byte)0x18,(byte)0x20,
+ (byte)0x31,(byte)0x18,(byte)0x18,
+ (byte)0x4a,(byte)0x29,(byte)0x20,
+ (byte)0x7b,(byte)0x62,(byte)0x5a,
+ (byte)0x73,(byte)0x6a,(byte)0x52,
+ (byte)0x4a,(byte)0x4a,(byte)0x39,
+ (byte)0x4a,(byte)0x41,(byte)0x39,
+ (byte)0x29,(byte)0x20,(byte)0x18,
+ (byte)0x39,(byte)0x29,(byte)0x20,
+ (byte)0x10,(byte)0x08,(byte)0x08,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x20,(byte)0x20,(byte)0x18,
+ (byte)0x41,(byte)0x41,(byte)0x31,
+ (byte)0x62,(byte)0x6a,(byte)0x6a,
+ (byte)0x94,(byte)0x94,(byte)0x9c,
+ (byte)0xa4,(byte)0xa4,(byte)0xa4,
+ (byte)0xac,(byte)0xa4,(byte)0xb4,
+ (byte)0xcd,(byte)0xc5,(byte)0xde,
+ (byte)0xde,(byte)0xd5,(byte)0xf6,
+ (byte)0xde,(byte)0xde,(byte)0xf6,
+ (byte)0xde,(byte)0xde,(byte)0xf6,
+ (byte)0xde,(byte)0xd5,(byte)0xf6,
+ (byte)0xde,(byte)0xd5,(byte)0xf6,
+ (byte)0xde,(byte)0xde,(byte)0xf6,
+ (byte)0xd5,(byte)0xcd,(byte)0xee,
+ (byte)0xb4,(byte)0xac,(byte)0xbd,
+ (byte)0xb4,(byte)0xa4,(byte)0xb4,
+ (byte)0xcd,(byte)0xbd,(byte)0xde,
+ (byte)0x52,(byte)0x31,(byte)0x39,
+ (byte)0x20,(byte)0x20,(byte)0x20,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x39,(byte)0x08,(byte)0x18,
+ (byte)0x8b,(byte)0x20,(byte)0x41,
+ (byte)0x39,(byte)0x18,(byte)0x29,
+ (byte)0x00,(byte)0x00,(byte)0x08,
+ (byte)0x08,(byte)0x08,(byte)0x18,
+ (byte)0x00,(byte)0x08,(byte)0x08,
+ (byte)0x20,(byte)0x08,(byte)0x10,
+ (byte)0x41,(byte)0x20,(byte)0x29,
+ (byte)0x52,(byte)0x4a,(byte)0x4a,
+ (byte)0x41,(byte)0x39,(byte)0x39,
+ (byte)0x41,(byte)0x31,(byte)0x31,
+ (byte)0x31,(byte)0x18,(byte)0x29,
+ (byte)0x18,(byte)0x08,(byte)0x18,
+ (byte)0x08,(byte)0x08,(byte)0x10,
+ (byte)0x08,(byte)0x08,(byte)0x10,
+ (byte)0x00,(byte)0x00,(byte)0x08,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x31,(byte)0x29,(byte)0x18,
+ (byte)0x5a,(byte)0x52,(byte)0x31,
+ (byte)0x4a,(byte)0x39,(byte)0x31,
+ (byte)0x20,(byte)0x10,(byte)0x08,
+ (byte)0x20,(byte)0x18,(byte)0x08,
+ (byte)0x29,(byte)0x18,(byte)0x10,
+ (byte)0x10,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x18,(byte)0x08,(byte)0x08,
+ (byte)0x29,(byte)0x10,(byte)0x08,
+ (byte)0x39,(byte)0x18,(byte)0x10,
+ (byte)0x31,(byte)0x20,(byte)0x20,
+ (byte)0x41,(byte)0x41,(byte)0x31,
+ (byte)0x10,(byte)0x10,(byte)0x10,
+ (byte)0x18,(byte)0x18,(byte)0x10,
+ (byte)0x10,(byte)0x08,(byte)0x08,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x10,(byte)0x10,(byte)0x10,
+ (byte)0x31,(byte)0x31,(byte)0x29,
+ (byte)0x31,(byte)0x29,(byte)0x20,
+ (byte)0x9c,(byte)0x8b,(byte)0x7b,
+ (byte)0xb4,(byte)0xac,(byte)0xac,
+ (byte)0xa4,(byte)0x9c,(byte)0xac,
+ (byte)0xac,(byte)0xac,(byte)0xbd,
+ (byte)0xc5,(byte)0xc5,(byte)0xd5,
+ (byte)0xd5,(byte)0xd5,(byte)0xee,
+ (byte)0xde,(byte)0xde,(byte)0xf6,
+ (byte)0xde,(byte)0xd5,(byte)0xf6,
+ (byte)0xde,(byte)0xd5,(byte)0xf6,
+ (byte)0xde,(byte)0xd5,(byte)0xee,
+ (byte)0xd5,(byte)0xcd,(byte)0xde,
+ (byte)0xbd,(byte)0xac,(byte)0xc5,
+ (byte)0xa4,(byte)0x7b,(byte)0x8b,
+ (byte)0xcd,(byte)0xbd,(byte)0xd5,
+ (byte)0x5a,(byte)0x29,(byte)0x31,
+ (byte)0x08,(byte)0x08,(byte)0x08,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x4a,(byte)0x08,(byte)0x10,
+ (byte)0x8b,(byte)0x20,(byte)0x41,
+ (byte)0x41,(byte)0x20,(byte)0x31,
+ (byte)0x00,(byte)0x08,(byte)0x10,
+ (byte)0x08,(byte)0x08,(byte)0x08,
+ (byte)0x00,(byte)0x08,(byte)0x08,
+ (byte)0x18,(byte)0x08,(byte)0x10,
+ (byte)0x29,(byte)0x10,(byte)0x20,
+ (byte)0x29,(byte)0x20,(byte)0x20,
+ (byte)0x39,(byte)0x31,(byte)0x31,
+ (byte)0x29,(byte)0x10,(byte)0x18,
+ (byte)0x29,(byte)0x08,(byte)0x10,
+ (byte)0x08,(byte)0x08,(byte)0x08,
+ (byte)0x08,(byte)0x08,(byte)0x10,
+ (byte)0x18,(byte)0x18,(byte)0x31,
+ (byte)0x08,(byte)0x08,(byte)0x10,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x08,
+ (byte)0x29,(byte)0x18,(byte)0x10,
+ (byte)0x73,(byte)0x4a,(byte)0x41,
+ (byte)0x94,(byte)0x52,(byte)0x73,
+ (byte)0x6a,(byte)0x39,(byte)0x5a,
+ (byte)0x31,(byte)0x18,(byte)0x20,
+ (byte)0x18,(byte)0x08,(byte)0x00,
+ (byte)0x18,(byte)0x00,(byte)0x00,
+ (byte)0x18,(byte)0x10,(byte)0x18,
+ (byte)0x10,(byte)0x08,(byte)0x10,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x20,(byte)0x08,(byte)0x00,
+ (byte)0x20,(byte)0x08,(byte)0x08,
+ (byte)0x20,(byte)0x18,(byte)0x29,
+ (byte)0x52,(byte)0x41,(byte)0x39,
+ (byte)0x39,(byte)0x29,(byte)0x18,
+ (byte)0x20,(byte)0x18,(byte)0x10,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x18,(byte)0x10,(byte)0x08,
+ (byte)0x08,(byte)0x08,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x18,(byte)0x18,(byte)0x10,
+ (byte)0x20,(byte)0x29,(byte)0x18,
+ (byte)0x31,(byte)0x20,(byte)0x18,
+ (byte)0xb4,(byte)0x9c,(byte)0xac,
+ (byte)0xd5,(byte)0xd5,(byte)0xee,
+ (byte)0xb4,(byte)0xa4,(byte)0xb4,
+ (byte)0xa4,(byte)0x8b,(byte)0x9c,
+ (byte)0xbd,(byte)0xb4,(byte)0xc5,
+ (byte)0xcd,(byte)0xc5,(byte)0xde,
+ (byte)0xd5,(byte)0xcd,(byte)0xcd,
+ (byte)0xde,(byte)0xd5,(byte)0xee,
+ (byte)0xde,(byte)0xd5,(byte)0xf6,
+ (byte)0xd5,(byte)0xcd,(byte)0xd5,
+ (byte)0xcd,(byte)0xc5,(byte)0xc5,
+ (byte)0xc5,(byte)0xac,(byte)0xbd,
+ (byte)0xa4,(byte)0x7b,(byte)0x83,
+ (byte)0xbd,(byte)0xac,(byte)0xbd,
+ (byte)0x52,(byte)0x31,(byte)0x31,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x08,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x4a,(byte)0x00,(byte)0x08,
+ (byte)0x94,(byte)0x31,(byte)0x4a,
+ (byte)0x52,(byte)0x39,(byte)0x52,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x08,(byte)0x08,
+ (byte)0x00,(byte)0x00,(byte)0x08,
+ (byte)0x08,(byte)0x08,(byte)0x08,
+ (byte)0x18,(byte)0x08,(byte)0x10,
+ (byte)0x08,(byte)0x08,(byte)0x10,
+ (byte)0x18,(byte)0x10,(byte)0x18,
+ (byte)0x29,(byte)0x00,(byte)0x18,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x08,(byte)0x08,
+ (byte)0x00,(byte)0x08,(byte)0x08,
+ (byte)0x08,(byte)0x08,(byte)0x18,
+ (byte)0x08,(byte)0x08,(byte)0x10,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x18,(byte)0x00,(byte)0x08,
+ (byte)0x9c,(byte)0x5a,(byte)0x8b,
+ (byte)0xb4,(byte)0x62,(byte)0xa4,
+ (byte)0xa4,(byte)0x5a,(byte)0x8b,
+ (byte)0x8b,(byte)0x39,(byte)0x6a,
+ (byte)0x6a,(byte)0x29,(byte)0x41,
+ (byte)0x6a,(byte)0x31,(byte)0x41,
+ (byte)0x41,(byte)0x20,(byte)0x31,
+ (byte)0x10,(byte)0x08,(byte)0x10,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x18,(byte)0x08,(byte)0x00,
+ (byte)0x10,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x08,
+ (byte)0x52,(byte)0x39,(byte)0x29,
+ (byte)0x52,(byte)0x41,(byte)0x10,
+ (byte)0x41,(byte)0x31,(byte)0x29,
+ (byte)0x18,(byte)0x10,(byte)0x08,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x10,(byte)0x10,(byte)0x08,
+ (byte)0x39,(byte)0x39,(byte)0x31,
+ (byte)0x18,(byte)0x18,(byte)0x18,
+ (byte)0x41,(byte)0x18,(byte)0x18,
+ (byte)0xac,(byte)0x7b,(byte)0x8b,
+ (byte)0xde,(byte)0xde,(byte)0xff,
+ (byte)0xac,(byte)0x9c,(byte)0xa4,
+ (byte)0xa4,(byte)0x62,(byte)0x73,
+ (byte)0xbd,(byte)0xa4,(byte)0xbd,
+ (byte)0xc5,(byte)0xbd,(byte)0xbd,
+ (byte)0xcd,(byte)0xbd,(byte)0x9c,
+ (byte)0xd5,(byte)0xc5,(byte)0xac,
+ (byte)0xcd,(byte)0xc5,(byte)0xb4,
+ (byte)0xd5,(byte)0xc5,(byte)0xa4,
+ (byte)0xd5,(byte)0xc5,(byte)0xa4,
+ (byte)0xbd,(byte)0xa4,(byte)0xa4,
+ (byte)0x9c,(byte)0x8b,(byte)0x8b,
+ (byte)0x9c,(byte)0x8b,(byte)0x94,
+ (byte)0x5a,(byte)0x39,(byte)0x41,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x18,(byte)0x10,(byte)0x08,
+ (byte)0x08,(byte)0x08,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x4a,(byte)0x00,(byte)0x08,
+ (byte)0x9c,(byte)0x4a,(byte)0x5a,
+ (byte)0x5a,(byte)0x39,(byte)0x5a,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x08,(byte)0x08,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x08,
+ (byte)0x08,(byte)0x00,(byte)0x08,
+ (byte)0x18,(byte)0x18,(byte)0x29,
+ (byte)0x18,(byte)0x10,(byte)0x18,
+ (byte)0x10,(byte)0x00,(byte)0x08,
+ (byte)0x00,(byte)0x00,(byte)0x08,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x08,(byte)0x08,
+ (byte)0x08,(byte)0x08,(byte)0x08,
+ (byte)0x08,(byte)0x08,(byte)0x08,
+ (byte)0x08,(byte)0x00,(byte)0x08,
+ (byte)0x20,(byte)0x10,(byte)0x18,
+ (byte)0x8b,(byte)0x62,(byte)0x83,
+ (byte)0x9c,(byte)0x41,(byte)0x6a,
+ (byte)0x83,(byte)0x18,(byte)0x41,
+ (byte)0x73,(byte)0x08,(byte)0x18,
+ (byte)0x7b,(byte)0x18,(byte)0x39,
+ (byte)0x8b,(byte)0x29,(byte)0x52,
+ (byte)0x8b,(byte)0x39,(byte)0x62,
+ (byte)0x29,(byte)0x10,(byte)0x18,
+ (byte)0x08,(byte)0x00,(byte)0x08,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x08,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x39,(byte)0x20,(byte)0x08,
+ (byte)0x4a,(byte)0x39,(byte)0x10,
+ (byte)0x29,(byte)0x20,(byte)0x18,
+ (byte)0x10,(byte)0x08,(byte)0x08,
+ (byte)0x18,(byte)0x10,(byte)0x08,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x18,(byte)0x18,(byte)0x18,
+ (byte)0x10,(byte)0x08,(byte)0x08,
+ (byte)0x18,(byte)0x10,(byte)0x08,
+ (byte)0x62,(byte)0x29,(byte)0x31,
+ (byte)0xc5,(byte)0xa4,(byte)0xcd,
+ (byte)0x94,(byte)0x83,(byte)0x8b,
+ (byte)0x83,(byte)0x73,(byte)0x6a,
+ (byte)0xbd,(byte)0xa4,(byte)0xb4,
+ (byte)0xc5,(byte)0xb4,(byte)0xac,
+ (byte)0xcd,(byte)0xb4,(byte)0x83,
+ (byte)0xcd,(byte)0xbd,(byte)0x8b,
+ (byte)0xc5,(byte)0xb4,(byte)0x8b,
+ (byte)0xcd,(byte)0xbd,(byte)0x9c,
+ (byte)0xc5,(byte)0xb4,(byte)0x7b,
+ (byte)0xcd,(byte)0xc5,(byte)0xc5,
+ (byte)0x8b,(byte)0x7b,(byte)0x73,
+ (byte)0x8b,(byte)0x62,(byte)0x73,
+ (byte)0x5a,(byte)0x31,(byte)0x41,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x20,(byte)0x18,(byte)0x10,
+ (byte)0x08,(byte)0x08,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x4a,(byte)0x08,(byte)0x10,
+ (byte)0xa4,(byte)0x52,(byte)0x6a,
+ (byte)0x4a,(byte)0x29,(byte)0x41,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x08,
+ (byte)0x10,(byte)0x00,(byte)0x08,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x10,(byte)0x18,(byte)0x31,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x08,
+ (byte)0x08,(byte)0x00,(byte)0x08,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x52,(byte)0x29,(byte)0x4a,
+ (byte)0xcd,(byte)0x94,(byte)0xd5,
+ (byte)0x9c,(byte)0x41,(byte)0x6a,
+ (byte)0x7b,(byte)0x10,(byte)0x08,
+ (byte)0x6a,(byte)0x10,(byte)0x00,
+ (byte)0x6a,(byte)0x08,(byte)0x18,
+ (byte)0x73,(byte)0x10,(byte)0x31,
+ (byte)0x4a,(byte)0x10,(byte)0x20,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x08,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x08,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x18,(byte)0x08,(byte)0x08,
+ (byte)0x39,(byte)0x29,(byte)0x10,
+ (byte)0x18,(byte)0x10,(byte)0x08,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x18,(byte)0x10,(byte)0x08,
+ (byte)0x39,(byte)0x29,(byte)0x20,
+ (byte)0x18,(byte)0x10,(byte)0x08,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x08,(byte)0x08,
+ (byte)0x10,(byte)0x10,(byte)0x10,
+ (byte)0x4a,(byte)0x18,(byte)0x20,
+ (byte)0x9c,(byte)0x5a,(byte)0x7b,
+ (byte)0x83,(byte)0x52,(byte)0x62,
+ (byte)0x6a,(byte)0x52,(byte)0x41,
+ (byte)0xbd,(byte)0xb4,(byte)0xa4,
+ (byte)0xde,(byte)0xd5,(byte)0xd5,
+ (byte)0xc5,(byte)0xac,(byte)0x8b,
+ (byte)0xc5,(byte)0xac,(byte)0x8b,
+ (byte)0xd5,(byte)0xc5,(byte)0xbd,
+ (byte)0xc5,(byte)0xac,(byte)0x8b,
+ (byte)0xc5,(byte)0xac,(byte)0x94,
+ (byte)0xde,(byte)0xd5,(byte)0xcd,
+ (byte)0x94,(byte)0x83,(byte)0x73,
+ (byte)0x83,(byte)0x4a,(byte)0x52,
+ (byte)0x52,(byte)0x31,(byte)0x31,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x18,(byte)0x08,(byte)0x08,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x52,(byte)0x10,(byte)0x18,
+ (byte)0xa4,(byte)0x4a,(byte)0x5a,
+ (byte)0x52,(byte)0x31,(byte)0x4a,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x08,(byte)0x10,
+ (byte)0x4a,(byte)0x20,(byte)0x39,
+ (byte)0x18,(byte)0x10,(byte)0x18,
+ (byte)0x10,(byte)0x18,(byte)0x29,
+ (byte)0x08,(byte)0x08,(byte)0x10,
+ (byte)0x4a,(byte)0x18,(byte)0x31,
+ (byte)0x20,(byte)0x18,(byte)0x20,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x10,(byte)0x00,(byte)0x08,
+ (byte)0x20,(byte)0x08,(byte)0x10,
+ (byte)0x31,(byte)0x18,(byte)0x20,
+ (byte)0x20,(byte)0x00,(byte)0x08,
+ (byte)0x73,(byte)0x4a,(byte)0x6a,
+ (byte)0xac,(byte)0x52,(byte)0x94,
+ (byte)0x8b,(byte)0x20,(byte)0x4a,
+ (byte)0x83,(byte)0x20,(byte)0x08,
+ (byte)0x62,(byte)0x18,(byte)0x00,
+ (byte)0x6a,(byte)0x10,(byte)0x31,
+ (byte)0x73,(byte)0x18,(byte)0x41,
+ (byte)0x5a,(byte)0x20,(byte)0x31,
+ (byte)0x08,(byte)0x00,(byte)0x08,
+ (byte)0x00,(byte)0x00,(byte)0x08,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x08,
+ (byte)0x08,(byte)0x00,(byte)0x08,
+ (byte)0x39,(byte)0x10,(byte)0x18,
+ (byte)0x31,(byte)0x10,(byte)0x08,
+ (byte)0x31,(byte)0x10,(byte)0x18,
+ (byte)0x83,(byte)0x41,(byte)0x73,
+ (byte)0x8b,(byte)0x52,(byte)0x73,
+ (byte)0x73,(byte)0x41,(byte)0x41,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x08,(byte)0x08,
+ (byte)0x08,(byte)0x08,(byte)0x08,
+ (byte)0x08,(byte)0x08,(byte)0x08,
+ (byte)0x18,(byte)0x10,(byte)0x10,
+ (byte)0x20,(byte)0x10,(byte)0x10,
+ (byte)0x20,(byte)0x10,(byte)0x10,
+ (byte)0x8b,(byte)0x6a,(byte)0x52,
+ (byte)0xbd,(byte)0xac,(byte)0x83,
+ (byte)0xc5,(byte)0xac,(byte)0x73,
+ (byte)0xc5,(byte)0xac,(byte)0x8b,
+ (byte)0xcd,(byte)0xc5,(byte)0xc5,
+ (byte)0xc5,(byte)0xbd,(byte)0x9c,
+ (byte)0xcd,(byte)0xc5,(byte)0xbd,
+ (byte)0xc5,(byte)0xb4,(byte)0xa4,
+ (byte)0xcd,(byte)0xb4,(byte)0x83,
+ (byte)0xac,(byte)0x94,(byte)0x73,
+ (byte)0x39,(byte)0x20,(byte)0x20,
+ (byte)0x39,(byte)0x20,(byte)0x20,
+ (byte)0x08,(byte)0x08,(byte)0x08,
+ (byte)0x10,(byte)0x08,(byte)0x00,
+ (byte)0x10,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x52,(byte)0x10,(byte)0x18,
+ (byte)0x94,(byte)0x31,(byte)0x41,
+ (byte)0x73,(byte)0x39,(byte)0x62,
+ (byte)0x31,(byte)0x10,(byte)0x18,
+ (byte)0x4a,(byte)0x20,(byte)0x31,
+ (byte)0x10,(byte)0x10,(byte)0x10,
+ (byte)0x4a,(byte)0x39,(byte)0x4a,
+ (byte)0x6a,(byte)0x62,(byte)0x8b,
+ (byte)0x29,(byte)0x29,(byte)0x41,
+ (byte)0x62,(byte)0x62,(byte)0x83,
+ (byte)0x73,(byte)0x62,(byte)0x8b,
+ (byte)0x31,(byte)0x31,(byte)0x39,
+ (byte)0x31,(byte)0x18,(byte)0x20,
+ (byte)0x83,(byte)0x39,(byte)0x6a,
+ (byte)0x83,(byte)0x31,(byte)0x62,
+ (byte)0x9c,(byte)0x5a,(byte)0x8b,
+ (byte)0x94,(byte)0x4a,(byte)0x7b,
+ (byte)0x83,(byte)0x4a,(byte)0x6a,
+ (byte)0xa4,(byte)0x52,(byte)0x83,
+ (byte)0x8b,(byte)0x20,(byte)0x52,
+ (byte)0x7b,(byte)0x10,(byte)0x31,
+ (byte)0x6a,(byte)0x08,(byte)0x20,
+ (byte)0x73,(byte)0x10,(byte)0x31,
+ (byte)0x5a,(byte)0x20,(byte)0x31,
+ (byte)0x39,(byte)0x31,(byte)0x18,
+ (byte)0x20,(byte)0x18,(byte)0x10,
+ (byte)0x08,(byte)0x00,(byte)0x08,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x08,
+ (byte)0x10,(byte)0x10,(byte)0x20,
+ (byte)0x5a,(byte)0x18,(byte)0x29,
+ (byte)0x94,(byte)0x29,(byte)0x4a,
+ (byte)0x7b,(byte)0x31,(byte)0x4a,
+ (byte)0x73,(byte)0x29,(byte)0x41,
+ (byte)0xac,(byte)0x5a,(byte)0x7b,
+ (byte)0xc5,(byte)0x94,(byte)0x8b,
+ (byte)0xac,(byte)0x83,(byte)0x9c,
+ (byte)0x39,(byte)0x20,(byte)0x20,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x08,(byte)0x08,
+ (byte)0x08,(byte)0x08,(byte)0x08,
+ (byte)0x08,(byte)0x08,(byte)0x08,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x08,(byte)0x00,
+ (byte)0x5a,(byte)0x41,(byte)0x31,
+ (byte)0xa4,(byte)0x94,(byte)0x5a,
+ (byte)0xac,(byte)0x8b,(byte)0x31,
+ (byte)0xa4,(byte)0x8b,(byte)0x52,
+ (byte)0xc5,(byte)0xbd,(byte)0xb4,
+ (byte)0x8b,(byte)0x7b,(byte)0x41,
+ (byte)0xc5,(byte)0xb4,(byte)0xac,
+ (byte)0xb4,(byte)0x9c,(byte)0x73,
+ (byte)0xbd,(byte)0xa4,(byte)0x5a,
+ (byte)0xbd,(byte)0x9c,(byte)0x83,
+ (byte)0x20,(byte)0x10,(byte)0x10,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x08,(byte)0x08,
+ (byte)0x20,(byte)0x10,(byte)0x10,
+ (byte)0x18,(byte)0x08,(byte)0x08,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x52,(byte)0x10,(byte)0x20,
+ (byte)0x8b,(byte)0x29,(byte)0x39,
+ (byte)0x8b,(byte)0x39,(byte)0x6a,
+ (byte)0x83,(byte)0x41,(byte)0x62,
+ (byte)0x94,(byte)0x41,(byte)0x73,
+ (byte)0x4a,(byte)0x31,(byte)0x41,
+ (byte)0x6a,(byte)0x6a,(byte)0x83,
+ (byte)0x9c,(byte)0x9c,(byte)0xcd,
+ (byte)0x8b,(byte)0x9c,(byte)0xc5,
+ (byte)0x9c,(byte)0xa4,(byte)0xcd,
+ (byte)0xa4,(byte)0xac,(byte)0xd5,
+ (byte)0x8b,(byte)0x8b,(byte)0xa4,
+ (byte)0x8b,(byte)0x41,(byte)0x73,
+ (byte)0xac,(byte)0x52,(byte)0x94,
+ (byte)0xb4,(byte)0x5a,(byte)0xa4,
+ (byte)0xa4,(byte)0x41,(byte)0x83,
+ (byte)0xb4,(byte)0x6a,(byte)0xa4,
+ (byte)0xac,(byte)0x7b,(byte)0xa4,
+ (byte)0xb4,(byte)0x73,(byte)0xa4,
+ (byte)0xa4,(byte)0x4a,(byte)0x8b,
+ (byte)0x94,(byte)0x31,(byte)0x73,
+ (byte)0x94,(byte)0x39,(byte)0x73,
+ (byte)0x73,(byte)0x18,(byte)0x39,
+ (byte)0x4a,(byte)0x08,(byte)0x18,
+ (byte)0x10,(byte)0x10,(byte)0x08,
+ (byte)0x10,(byte)0x10,(byte)0x08,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x08,
+ (byte)0x18,(byte)0x10,(byte)0x18,
+ (byte)0x83,(byte)0x31,(byte)0x39,
+ (byte)0xb4,(byte)0x73,(byte)0x39,
+ (byte)0xbd,(byte)0x6a,(byte)0x73,
+ (byte)0x94,(byte)0x62,(byte)0x7b,
+ (byte)0xa4,(byte)0x62,(byte)0x5a,
+ (byte)0xbd,(byte)0x7b,(byte)0x5a,
+ (byte)0xc5,(byte)0x8b,(byte)0xb4,
+ (byte)0x62,(byte)0x41,(byte)0x4a,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x18,(byte)0x18,(byte)0x10,
+ (byte)0x18,(byte)0x18,(byte)0x10,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x08,(byte)0x08,
+ (byte)0x10,(byte)0x10,(byte)0x00,
+ (byte)0x4a,(byte)0x41,(byte)0x10,
+ (byte)0x73,(byte)0x62,(byte)0x20,
+ (byte)0x7b,(byte)0x6a,(byte)0x41,
+ (byte)0x9c,(byte)0x94,(byte)0x83,
+ (byte)0xa4,(byte)0x94,(byte)0x73,
+ (byte)0xb4,(byte)0xa4,(byte)0x9c,
+ (byte)0x83,(byte)0x6a,(byte)0x29,
+ (byte)0xac,(byte)0x8b,(byte)0x41,
+ (byte)0x4a,(byte)0x41,(byte)0x20,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x29,(byte)0x10,(byte)0x18,
+ (byte)0x20,(byte)0x10,(byte)0x10,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x4a,(byte)0x08,(byte)0x20,
+ (byte)0x7b,(byte)0x18,(byte)0x29,
+ (byte)0x83,(byte)0x31,(byte)0x5a,
+ (byte)0xa4,(byte)0x5a,(byte)0x94,
+ (byte)0xac,(byte)0x52,(byte)0x94,
+ (byte)0x9c,(byte)0x52,(byte)0x8b,
+ (byte)0x9c,(byte)0x9c,(byte)0xbd,
+ (byte)0xa4,(byte)0xac,(byte)0xd5,
+ (byte)0x9c,(byte)0xa4,(byte)0xcd,
+ (byte)0xa4,(byte)0xac,(byte)0xd5,
+ (byte)0xac,(byte)0xb4,(byte)0xd5,
+ (byte)0xb4,(byte)0x9c,(byte)0xcd,
+ (byte)0xa4,(byte)0x41,(byte)0x83,
+ (byte)0xa4,(byte)0x39,(byte)0x6a,
+ (byte)0xb4,(byte)0x62,(byte)0x39,
+ (byte)0xa4,(byte)0x41,(byte)0x5a,
+ (byte)0xb4,(byte)0x73,(byte)0xb4,
+ (byte)0xc5,(byte)0x8b,(byte)0xc5,
+ (byte)0xb4,(byte)0x6a,(byte)0x9c,
+ (byte)0x83,(byte)0x20,(byte)0x4a,
+ (byte)0x94,(byte)0x31,(byte)0x62,
+ (byte)0xc5,(byte)0x94,(byte)0xb4,
+ (byte)0x83,(byte)0x41,(byte)0x5a,
+ (byte)0x29,(byte)0x08,(byte)0x08,
+ (byte)0x10,(byte)0x08,(byte)0x00,
+ (byte)0x10,(byte)0x10,(byte)0x08,
+ (byte)0x08,(byte)0x10,(byte)0x08,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x08,(byte)0x08,
+ (byte)0x41,(byte)0x31,(byte)0x20,
+ (byte)0x7b,(byte)0x5a,(byte)0x29,
+ (byte)0x6a,(byte)0x41,(byte)0x29,
+ (byte)0x4a,(byte)0x31,(byte)0x29,
+ (byte)0x5a,(byte)0x39,(byte)0x39,
+ (byte)0x94,(byte)0x6a,(byte)0x83,
+ (byte)0x6a,(byte)0x4a,(byte)0x52,
+ (byte)0x29,(byte)0x10,(byte)0x10,
+ (byte)0x20,(byte)0x18,(byte)0x10,
+ (byte)0x39,(byte)0x31,(byte)0x29,
+ (byte)0x08,(byte)0x08,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x10,(byte)0x08,(byte)0x10,
+ (byte)0x62,(byte)0x29,(byte)0x41,
+ (byte)0x5a,(byte)0x20,(byte)0x29,
+ (byte)0x39,(byte)0x31,(byte)0x10,
+ (byte)0x62,(byte)0x5a,(byte)0x39,
+ (byte)0xa4,(byte)0x94,(byte)0x6a,
+ (byte)0x83,(byte)0x73,(byte)0x39,
+ (byte)0xac,(byte)0xa4,(byte)0x7b,
+ (byte)0x73,(byte)0x62,(byte)0x39,
+ (byte)0x83,(byte)0x73,(byte)0x4a,
+ (byte)0x52,(byte)0x4a,(byte)0x10,
+ (byte)0x18,(byte)0x18,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x31,(byte)0x18,(byte)0x20,
+ (byte)0x29,(byte)0x18,(byte)0x20,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x29,(byte)0x08,(byte)0x10,
+ (byte)0x7b,(byte)0x18,(byte)0x39,
+ (byte)0xa4,(byte)0x62,(byte)0x8b,
+ (byte)0xac,(byte)0x5a,(byte)0x9c,
+ (byte)0xa4,(byte)0x4a,(byte)0x8b,
+ (byte)0xa4,(byte)0x41,(byte)0x8b,
+ (byte)0xb4,(byte)0x83,(byte)0xb4,
+ (byte)0xac,(byte)0xb4,(byte)0xd5,
+ (byte)0xa4,(byte)0xac,(byte)0xd5,
+ (byte)0xa4,(byte)0xac,(byte)0xd5,
+ (byte)0xac,(byte)0xb4,(byte)0xde,
+ (byte)0xbd,(byte)0xa4,(byte)0xd5,
+ (byte)0xb4,(byte)0x5a,(byte)0x9c,
+ (byte)0xac,(byte)0x4a,(byte)0x4a,
+ (byte)0xbd,(byte)0x73,(byte)0x20,
+ (byte)0xa4,(byte)0x52,(byte)0x52,
+ (byte)0xbd,(byte)0x7b,(byte)0xbd,
+ (byte)0xac,(byte)0x52,(byte)0x9c,
+ (byte)0x9c,(byte)0x41,(byte)0x73,
+ (byte)0x73,(byte)0x08,(byte)0x20,
+ (byte)0x8b,(byte)0x29,(byte)0x4a,
+ (byte)0xb4,(byte)0x6a,(byte)0x94,
+ (byte)0x9c,(byte)0x6a,(byte)0x83,
+ (byte)0x7b,(byte)0x6a,(byte)0x6a,
+ (byte)0x52,(byte)0x4a,(byte)0x41,
+ (byte)0x6a,(byte)0x62,(byte)0x5a,
+ (byte)0x39,(byte)0x39,(byte)0x31,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x31,(byte)0x29,(byte)0x20,
+ (byte)0x20,(byte)0x20,(byte)0x10,
+ (byte)0x20,(byte)0x18,(byte)0x10,
+ (byte)0x10,(byte)0x08,(byte)0x00,
+ (byte)0x4a,(byte)0x41,(byte)0x31,
+ (byte)0x29,(byte)0x20,(byte)0x18,
+ (byte)0x18,(byte)0x08,(byte)0x08,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x31,(byte)0x20,(byte)0x18,
+ (byte)0x39,(byte)0x29,(byte)0x29,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x10,(byte)0x08,(byte)0x08,
+ (byte)0x41,(byte)0x18,(byte)0x18,
+ (byte)0x62,(byte)0x31,(byte)0x31,
+ (byte)0x18,(byte)0x10,(byte)0x00,
+ (byte)0x4a,(byte)0x4a,(byte)0x20,
+ (byte)0xac,(byte)0x9c,(byte)0x62,
+ (byte)0xa4,(byte)0x94,(byte)0x73,
+ (byte)0x9c,(byte)0x8b,(byte)0x6a,
+ (byte)0x94,(byte)0x83,(byte)0x5a,
+ (byte)0x8b,(byte)0x7b,(byte)0x5a,
+ (byte)0x52,(byte)0x41,(byte)0x18,
+ (byte)0x20,(byte)0x18,(byte)0x10,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x5a,(byte)0x31,(byte)0x4a,
+ (byte)0x18,(byte)0x10,(byte)0x10,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x18,(byte)0x08,(byte)0x08,
+ (byte)0x7b,(byte)0x18,(byte)0x39,
+ (byte)0xb4,(byte)0x6a,(byte)0xa4,
+ (byte)0xac,(byte)0x62,(byte)0x9c,
+ (byte)0xac,(byte)0x52,(byte)0x62,
+ (byte)0xa4,(byte)0x4a,(byte)0x5a,
+ (byte)0xac,(byte)0x5a,(byte)0x94,
+ (byte)0xbd,(byte)0xb4,(byte)0xde,
+ (byte)0xac,(byte)0xb4,(byte)0xd5,
+ (byte)0xac,(byte)0xb4,(byte)0xde,
+ (byte)0xb4,(byte)0xb4,(byte)0xd5,
+ (byte)0xc5,(byte)0xc5,(byte)0xe6,
+ (byte)0xb4,(byte)0x73,(byte)0xac,
+ (byte)0x94,(byte)0x29,(byte)0x5a,
+ (byte)0xb4,(byte)0x6a,(byte)0x7b,
+ (byte)0xc5,(byte)0x9c,(byte)0xcd,
+ (byte)0xc5,(byte)0x94,(byte)0xac,
+ (byte)0xc5,(byte)0x94,(byte)0xb4,
+ (byte)0x9c,(byte)0x41,(byte)0x7b,
+ (byte)0x94,(byte)0x31,(byte)0x52,
+ (byte)0x94,(byte)0x31,(byte)0x41,
+ (byte)0x94,(byte)0x39,(byte)0x62,
+ (byte)0x94,(byte)0x73,(byte)0x7b,
+ (byte)0x73,(byte)0x6a,(byte)0x62,
+ (byte)0x5a,(byte)0x5a,(byte)0x52,
+ (byte)0x94,(byte)0x8b,(byte)0x94,
+ (byte)0x41,(byte)0x39,(byte)0x39,
+ (byte)0x08,(byte)0x08,(byte)0x00,
+ (byte)0x08,(byte)0x08,(byte)0x08,
+ (byte)0x08,(byte)0x08,(byte)0x08,
+ (byte)0x39,(byte)0x31,(byte)0x29,
+ (byte)0x4a,(byte)0x41,(byte)0x39,
+ (byte)0x4a,(byte)0x41,(byte)0x39,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x10,(byte)0x10,(byte)0x10,
+ (byte)0x10,(byte)0x08,(byte)0x08,
+ (byte)0x18,(byte)0x08,(byte)0x08,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x08,(byte)0x08,
+ (byte)0x10,(byte)0x10,(byte)0x08,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x10,(byte)0x08,
+ (byte)0x08,(byte)0x08,(byte)0x00,
+ (byte)0x29,(byte)0x20,(byte)0x10,
+ (byte)0xac,(byte)0x9c,(byte)0x62,
+ (byte)0xac,(byte)0x9c,(byte)0x52,
+ (byte)0xc5,(byte)0xb4,(byte)0x9c,
+ (byte)0xb4,(byte)0xa4,(byte)0x83,
+ (byte)0xac,(byte)0x9c,(byte)0x6a,
+ (byte)0x29,(byte)0x29,(byte)0x10,
+ (byte)0x41,(byte)0x20,(byte)0x20,
+ (byte)0x52,(byte)0x20,(byte)0x39,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x08,(byte)0x00,
+ (byte)0x62,(byte)0x39,(byte)0x52,
+ (byte)0x08,(byte)0x08,(byte)0x08,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x10,(byte)0x08,(byte)0x08,
+ (byte)0x73,(byte)0x20,(byte)0x39,
+ (byte)0x9c,(byte)0x41,(byte)0x7b,
+ (byte)0xbd,(byte)0x83,(byte)0xc5,
+ (byte)0xb4,(byte)0x6a,(byte)0x5a,
+ (byte)0xb4,(byte)0x6a,(byte)0x29,
+ (byte)0xb4,(byte)0x6a,(byte)0x9c,
+ (byte)0xcd,(byte)0xbd,(byte)0xe6,
+ (byte)0xb4,(byte)0xb4,(byte)0xde,
+ (byte)0xac,(byte)0xb4,(byte)0xde,
+ (byte)0xb4,(byte)0xb4,(byte)0xde,
+ (byte)0xbd,(byte)0xbd,(byte)0xde,
+ (byte)0xb4,(byte)0x6a,(byte)0xac,
+ (byte)0x94,(byte)0x29,(byte)0x62,
+ (byte)0x9c,(byte)0x31,(byte)0x83,
+ (byte)0xb4,(byte)0x6a,(byte)0xac,
+ (byte)0xd5,(byte)0xb4,(byte)0x7b,
+ (byte)0xcd,(byte)0xa4,(byte)0x4a,
+ (byte)0xb4,(byte)0x73,(byte)0x9c,
+ (byte)0x9c,(byte)0x41,(byte)0x52,
+ (byte)0x73,(byte)0x10,(byte)0x00,
+ (byte)0x7b,(byte)0x29,(byte)0x39,
+ (byte)0xc5,(byte)0xbd,(byte)0xc5,
+ (byte)0x7b,(byte)0x73,(byte)0x6a,
+ (byte)0x6a,(byte)0x62,(byte)0x62,
+ (byte)0xa4,(byte)0x9c,(byte)0x9c,
+ (byte)0x5a,(byte)0x5a,(byte)0x5a,
+ (byte)0x08,(byte)0x08,(byte)0x08,
+ (byte)0x08,(byte)0x08,(byte)0x08,
+ (byte)0x08,(byte)0x00,(byte)0x08,
+ (byte)0x4a,(byte)0x41,(byte)0x39,
+ (byte)0x41,(byte)0x41,(byte)0x31,
+ (byte)0x31,(byte)0x31,(byte)0x20,
+ (byte)0x08,(byte)0x08,(byte)0x08,
+ (byte)0x00,(byte)0x08,(byte)0x00,
+ (byte)0x18,(byte)0x00,(byte)0x08,
+ (byte)0x39,(byte)0x08,(byte)0x08,
+ (byte)0x08,(byte)0x00,(byte)0x08,
+ (byte)0x29,(byte)0x41,(byte)0x41,
+ (byte)0x62,(byte)0x4a,(byte)0x31,
+ (byte)0x10,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x08,(byte)0x00,
+ (byte)0x08,(byte)0x08,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x4a,(byte)0x41,(byte)0x31,
+ (byte)0xac,(byte)0x9c,(byte)0x62,
+ (byte)0xac,(byte)0x9c,(byte)0x62,
+ (byte)0xcd,(byte)0xc5,(byte)0x94,
+ (byte)0xbd,(byte)0xac,(byte)0x7b,
+ (byte)0xac,(byte)0x9c,(byte)0x62,
+ (byte)0x41,(byte)0x41,(byte)0x20,
+ (byte)0x52,(byte)0x29,(byte)0x29,
+ (byte)0x52,(byte)0x18,(byte)0x29,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x08,(byte)0x08,
+ (byte)0x31,(byte)0x29,(byte)0x29,
+ (byte)0x6a,(byte)0x41,(byte)0x5a,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x5a,(byte)0x18,(byte)0x29,
+ (byte)0xa4,(byte)0x4a,(byte)0x7b,
+ (byte)0xbd,(byte)0x83,(byte)0xbd,
+ (byte)0xa4,(byte)0x5a,(byte)0x7b,
+ (byte)0xa4,(byte)0x52,(byte)0x18,
+ (byte)0x9c,(byte)0x39,(byte)0x5a,
+ (byte)0xb4,(byte)0x8b,(byte)0xbd,
+ (byte)0xb4,(byte)0xbd,(byte)0xe6,
+ (byte)0xb4,(byte)0xbd,(byte)0xde,
+ (byte)0xb4,(byte)0xbd,(byte)0xde,
+ (byte)0xb4,(byte)0xb4,(byte)0xd5,
+ (byte)0xb4,(byte)0x8b,(byte)0xb4,
+ (byte)0x9c,(byte)0x4a,(byte)0x7b,
+ (byte)0x9c,(byte)0x41,(byte)0x7b,
+ (byte)0xc5,(byte)0x9c,(byte)0xcd,
+ (byte)0xcd,(byte)0xac,(byte)0x6a,
+ (byte)0xc5,(byte)0x7b,(byte)0x08,
+ (byte)0xc5,(byte)0x8b,(byte)0x83,
+ (byte)0xa4,(byte)0x4a,(byte)0x7b,
+ (byte)0x7b,(byte)0x20,(byte)0x41,
+ (byte)0x5a,(byte)0x31,(byte)0x29,
+ (byte)0xa4,(byte)0x94,(byte)0x8b,
+ (byte)0x83,(byte)0x7b,(byte)0x6a,
+ (byte)0x7b,(byte)0x6a,(byte)0x6a,
+ (byte)0x29,(byte)0x29,(byte)0x20,
+ (byte)0x29,(byte)0x29,(byte)0x20,
+ (byte)0x08,(byte)0x08,(byte)0x08,
+ (byte)0x10,(byte)0x08,(byte)0x08,
+ (byte)0x18,(byte)0x00,(byte)0x08,
+ (byte)0x20,(byte)0x18,(byte)0x18,
+ (byte)0x83,(byte)0x7b,(byte)0x6a,
+ (byte)0x4a,(byte)0x4a,(byte)0x39,
+ (byte)0x18,(byte)0x20,(byte)0x10,
+ (byte)0x08,(byte)0x08,(byte)0x08,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x20,(byte)0x08,(byte)0x00,
+ (byte)0x10,(byte)0x10,(byte)0x10,
+ (byte)0x7b,(byte)0x6a,(byte)0x52,
+ (byte)0x73,(byte)0x4a,(byte)0x39,
+ (byte)0x20,(byte)0x18,(byte)0x08,
+ (byte)0x4a,(byte)0x4a,(byte)0x10,
+ (byte)0x41,(byte)0x41,(byte)0x10,
+ (byte)0x29,(byte)0x29,(byte)0x08,
+ (byte)0x31,(byte)0x31,(byte)0x18,
+ (byte)0x08,(byte)0x08,(byte)0x00,
+ (byte)0x18,(byte)0x18,(byte)0x08,
+ (byte)0x8b,(byte)0x7b,(byte)0x41,
+ (byte)0xa4,(byte)0x94,(byte)0x4a,
+ (byte)0xac,(byte)0x9c,(byte)0x5a,
+ (byte)0xc5,(byte)0xbd,(byte)0x83,
+ (byte)0xac,(byte)0xa4,(byte)0x6a,
+ (byte)0x9c,(byte)0x8b,(byte)0x52,
+ (byte)0x20,(byte)0x18,(byte)0x10,
+ (byte)0x29,(byte)0x10,(byte)0x10,
+ (byte)0x10,(byte)0x08,(byte)0x08,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x08,(byte)0x00,
+ (byte)0x52,(byte)0x39,(byte)0x4a,
+ (byte)0x5a,(byte)0x39,(byte)0x52,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x39,(byte)0x10,(byte)0x20,
+ (byte)0x8b,(byte)0x31,(byte)0x5a,
+ (byte)0xa4,(byte)0x52,(byte)0x83,
+ (byte)0xbd,(byte)0x7b,(byte)0xb4,
+ (byte)0xb4,(byte)0x7b,(byte)0x94,
+ (byte)0xa4,(byte)0x4a,(byte)0x6a,
+ (byte)0x9c,(byte)0x41,(byte)0x83,
+ (byte)0xbd,(byte)0xac,(byte)0xd5,
+ (byte)0xb4,(byte)0xbd,(byte)0xde,
+ (byte)0xb4,(byte)0xbd,(byte)0xde,
+ (byte)0x8b,(byte)0x83,(byte)0xa4,
+ (byte)0x7b,(byte)0x5a,(byte)0x6a,
+ (byte)0xa4,(byte)0x5a,(byte)0x83,
+ (byte)0x94,(byte)0x41,(byte)0x73,
+ (byte)0xb4,(byte)0x73,(byte)0xa4,
+ (byte)0xcd,(byte)0xa4,(byte)0x52,
+ (byte)0xb4,(byte)0x62,(byte)0x00,
+ (byte)0xa4,(byte)0x5a,(byte)0x62,
+ (byte)0x94,(byte)0x31,(byte)0x6a,
+ (byte)0x6a,(byte)0x10,(byte)0x29,
+ (byte)0x41,(byte)0x20,(byte)0x10,
+ (byte)0x83,(byte)0x73,(byte)0x6a,
+ (byte)0x62,(byte)0x52,(byte)0x52,
+ (byte)0x41,(byte)0x39,(byte)0x31,
+ (byte)0x4a,(byte)0x4a,(byte)0x41,
+ (byte)0x29,(byte)0x29,(byte)0x20,
+ (byte)0x10,(byte)0x10,(byte)0x08,
+ (byte)0x08,(byte)0x10,(byte)0x08,
+ (byte)0x10,(byte)0x08,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x29,(byte)0x20,(byte)0x10,
+ (byte)0x29,(byte)0x29,(byte)0x18,
+ (byte)0x20,(byte)0x20,(byte)0x18,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x29,(byte)0x18,(byte)0x10,
+ (byte)0x18,(byte)0x08,(byte)0x08,
+ (byte)0x39,(byte)0x31,(byte)0x18,
+ (byte)0x7b,(byte)0x73,(byte)0x31,
+ (byte)0x5a,(byte)0x5a,(byte)0x20,
+ (byte)0x4a,(byte)0x41,(byte)0x10,
+ (byte)0x29,(byte)0x29,(byte)0x08,
+ (byte)0x18,(byte)0x18,(byte)0x08,
+ (byte)0x73,(byte)0x6a,(byte)0x39,
+ (byte)0x9c,(byte)0x83,(byte)0x41,
+ (byte)0x8b,(byte)0x6a,(byte)0x31,
+ (byte)0xbd,(byte)0xac,(byte)0x6a,
+ (byte)0xac,(byte)0x9c,(byte)0x5a,
+ (byte)0xac,(byte)0x94,(byte)0x52,
+ (byte)0x6a,(byte)0x62,(byte)0x4a,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x10,(byte)0x08,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x08,(byte)0x00,
+ (byte)0x7b,(byte)0x52,(byte)0x62,
+ (byte)0x31,(byte)0x18,(byte)0x20,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x18,(byte)0x10,(byte)0x10,
+ (byte)0x8b,(byte)0x39,(byte)0x5a,
+ (byte)0x8b,(byte)0x29,(byte)0x5a,
+ (byte)0xac,(byte)0x5a,(byte)0x94,
+ (byte)0xc5,(byte)0x8b,(byte)0xc5,
+ (byte)0xa4,(byte)0x52,(byte)0x94,
+ (byte)0x9c,(byte)0x39,(byte)0x73,
+ (byte)0xac,(byte)0x83,(byte)0xac,
+ (byte)0x83,(byte)0x73,(byte)0x8b,
+ (byte)0x83,(byte)0x7b,(byte)0x94,
+ (byte)0x62,(byte)0x4a,(byte)0x5a,
+ (byte)0x5a,(byte)0x41,(byte)0x4a,
+ (byte)0x5a,(byte)0x31,(byte)0x41,
+ (byte)0x94,(byte)0x62,(byte)0x8b,
+ (byte)0xc5,(byte)0x8b,(byte)0xc5,
+ (byte)0xcd,(byte)0x9c,(byte)0x8b,
+ (byte)0xa4,(byte)0x52,(byte)0x18,
+ (byte)0x8b,(byte)0x31,(byte)0x4a,
+ (byte)0xac,(byte)0x73,(byte)0x94,
+ (byte)0x6a,(byte)0x20,(byte)0x31,
+ (byte)0x18,(byte)0x00,(byte)0x00,
+ (byte)0x10,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x39,(byte)0x39,(byte)0x31,
+ (byte)0x7b,(byte)0x73,(byte)0x7b,
+ (byte)0x41,(byte)0x39,(byte)0x39,
+ (byte)0x08,(byte)0x10,(byte)0x08,
+ (byte)0x08,(byte)0x08,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x29,(byte)0x20,(byte)0x18,
+ (byte)0x20,(byte)0x20,(byte)0x18,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x39,(byte)0x31,(byte)0x18,
+ (byte)0x5a,(byte)0x4a,(byte)0x29,
+ (byte)0x31,(byte)0x29,(byte)0x10,
+ (byte)0x39,(byte)0x31,(byte)0x10,
+ (byte)0x20,(byte)0x18,(byte)0x08,
+ (byte)0x83,(byte)0x6a,(byte)0x39,
+ (byte)0xbd,(byte)0xac,(byte)0x73,
+ (byte)0xa4,(byte)0x94,(byte)0x52,
+ (byte)0xa4,(byte)0x94,(byte)0x5a,
+ (byte)0xb4,(byte)0xa4,(byte)0x73,
+ (byte)0x94,(byte)0x7b,(byte)0x41,
+ (byte)0xa4,(byte)0x8b,(byte)0x41,
+ (byte)0x31,(byte)0x29,(byte)0x18,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x08,(byte)0x08,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x29,(byte)0x20,(byte)0x20,
+ (byte)0x83,(byte)0x52,(byte)0x52,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x5a,(byte)0x31,(byte)0x41,
+ (byte)0x94,(byte)0x39,(byte)0x62,
+ (byte)0x94,(byte)0x31,(byte)0x62,
+ (byte)0xc5,(byte)0x9c,(byte)0xb4,
+ (byte)0xb4,(byte)0x6a,(byte)0xac,
+ (byte)0x94,(byte)0x31,(byte)0x73,
+ (byte)0x9c,(byte)0x52,(byte)0x7b,
+ (byte)0x62,(byte)0x41,(byte)0x52,
+ (byte)0x52,(byte)0x39,(byte)0x4a,
+ (byte)0x5a,(byte)0x41,(byte)0x52,
+ (byte)0x4a,(byte)0x39,(byte)0x4a,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x5a,(byte)0x39,(byte)0x52,
+ (byte)0xcd,(byte)0x9c,(byte)0xd5,
+ (byte)0xcd,(byte)0xb4,(byte)0xe6,
+ (byte)0xbd,(byte)0x94,(byte)0xb4,
+ (byte)0xb4,(byte)0x83,(byte)0xa4,
+ (byte)0xa4,(byte)0x73,(byte)0x94,
+ (byte)0xbd,(byte)0x9c,(byte)0xbd,
+ (byte)0x4a,(byte)0x20,(byte)0x20,
+ (byte)0x10,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x10,(byte)0x18,(byte)0x10,
+ (byte)0x18,(byte)0x18,(byte)0x10,
+ (byte)0x08,(byte)0x08,(byte)0x08,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x08,(byte)0x00,
+ (byte)0x08,(byte)0x08,(byte)0x08,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x20,(byte)0x20,(byte)0x08,
+ (byte)0x18,(byte)0x18,(byte)0x00,
+ (byte)0x39,(byte)0x29,(byte)0x18,
+ (byte)0x73,(byte)0x62,(byte)0x41,
+ (byte)0x94,(byte)0x83,(byte)0x6a,
+ (byte)0x7b,(byte)0x73,(byte)0x41,
+ (byte)0xa4,(byte)0x94,(byte)0x62,
+ (byte)0x94,(byte)0x8b,(byte)0x52,
+ (byte)0xac,(byte)0x9c,(byte)0x5a,
+ (byte)0x94,(byte)0x7b,(byte)0x39,
+ (byte)0x83,(byte)0x7b,(byte)0x39,
+ (byte)0x10,(byte)0x18,(byte)0x08,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x10,(byte)0x08,(byte)0x08,
+ (byte)0x6a,(byte)0x4a,(byte)0x4a,
+ (byte)0x62,(byte)0x39,(byte)0x39,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x20,(byte)0x10,(byte)0x10,
+ (byte)0x94,(byte)0x4a,(byte)0x6a,
+ (byte)0x8b,(byte)0x20,(byte)0x4a,
+ (byte)0xc5,(byte)0x94,(byte)0x94,
+ (byte)0xcd,(byte)0xac,(byte)0x83,
+ (byte)0xbd,(byte)0x7b,(byte)0xbd,
+ (byte)0x9c,(byte)0x4a,(byte)0x7b,
+ (byte)0x73,(byte)0x4a,(byte)0x62,
+ (byte)0x52,(byte)0x39,(byte)0x4a,
+ (byte)0x41,(byte)0x31,(byte)0x41,
+ (byte)0x10,(byte)0x10,(byte)0x10,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x52,(byte)0x29,(byte)0x41,
+ (byte)0xcd,(byte)0xa4,(byte)0xde,
+ (byte)0xcd,(byte)0xb4,(byte)0xe6,
+ (byte)0xc5,(byte)0xac,(byte)0xd5,
+ (byte)0xcd,(byte)0xc5,(byte)0xee,
+ (byte)0x94,(byte)0x4a,(byte)0x62,
+ (byte)0x83,(byte)0x41,(byte)0x62,
+ (byte)0x8b,(byte)0x6a,(byte)0x7b,
+ (byte)0x10,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x10,(byte)0x08,(byte)0x08,
+ (byte)0x10,(byte)0x10,(byte)0x08,
+ (byte)0x00,(byte)0x00,(byte)0x08,
+ (byte)0x00,(byte)0x00,(byte)0x08,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x10,(byte)0x08,(byte)0x00,
+ (byte)0x29,(byte)0x20,(byte)0x08,
+ (byte)0x6a,(byte)0x5a,(byte)0x31,
+ (byte)0xd5,(byte)0xc5,(byte)0x94,
+ (byte)0x9c,(byte)0x8b,(byte)0x5a,
+ (byte)0x9c,(byte)0x8b,(byte)0x5a,
+ (byte)0x73,(byte)0x6a,(byte)0x31,
+ (byte)0x4a,(byte)0x4a,(byte)0x10,
+ (byte)0xa4,(byte)0x94,(byte)0x5a,
+ (byte)0xc5,(byte)0xb4,(byte)0x73,
+ (byte)0x62,(byte)0x5a,(byte)0x31,
+ (byte)0x18,(byte)0x18,(byte)0x08,
+ (byte)0x10,(byte)0x10,(byte)0x08,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x39,(byte)0x31,(byte)0x31,
+ (byte)0x94,(byte)0x5a,(byte)0x5a,
+ (byte)0x20,(byte)0x08,(byte)0x08,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x52,(byte)0x31,(byte)0x39,
+ (byte)0x9c,(byte)0x4a,(byte)0x6a,
+ (byte)0x9c,(byte)0x39,(byte)0x62,
+ (byte)0xcd,(byte)0x94,(byte)0x41,
+ (byte)0xcd,(byte)0xb4,(byte)0xa4,
+ (byte)0xac,(byte)0x62,(byte)0xa4,
+ (byte)0x7b,(byte)0x4a,(byte)0x6a,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x20,(byte)0x08,(byte)0x10,
+ (byte)0xac,(byte)0x73,(byte)0xac,
+ (byte)0xcd,(byte)0xbd,(byte)0xee,
+ (byte)0xa4,(byte)0x83,(byte)0x9c,
+ (byte)0xac,(byte)0x83,(byte)0xac,
+ (byte)0xb4,(byte)0x8b,(byte)0xac,
+ (byte)0x31,(byte)0x00,(byte)0x08,
+ (byte)0x52,(byte)0x39,(byte)0x41,
+ (byte)0x39,(byte)0x29,(byte)0x29,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x41,(byte)0x10,(byte)0x31,
+ (byte)0x31,(byte)0x18,(byte)0x31,
+ (byte)0x10,(byte)0x10,(byte)0x20,
+ (byte)0x10,(byte)0x10,(byte)0x18,
+ (byte)0x08,(byte)0x00,(byte)0x08,
+ (byte)0x00,(byte)0x00,(byte)0x08,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x31,(byte)0x20,(byte)0x08,
+ (byte)0x29,(byte)0x18,(byte)0x08,
+ (byte)0x20,(byte)0x10,(byte)0x08,
+ (byte)0x52,(byte)0x41,(byte)0x10,
+ (byte)0x7b,(byte)0x6a,(byte)0x41,
+ (byte)0x8b,(byte)0x7b,(byte)0x52,
+ (byte)0x8b,(byte)0x7b,(byte)0x62,
+ (byte)0x29,(byte)0x20,(byte)0x00,
+ (byte)0x8b,(byte)0x7b,(byte)0x41,
+ (byte)0x6a,(byte)0x62,(byte)0x31,
+ (byte)0xa4,(byte)0x94,(byte)0x5a,
+ (byte)0x4a,(byte)0x41,(byte)0x20,
+ (byte)0x29,(byte)0x29,(byte)0x10,
+ (byte)0x10,(byte)0x18,(byte)0x08,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x20,(byte)0x18,(byte)0x10,
+ (byte)0x7b,(byte)0x5a,(byte)0x52,
+ (byte)0x7b,(byte)0x41,(byte)0x39,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x10,(byte)0x08,(byte)0x00,
+ (byte)0x8b,(byte)0x4a,(byte)0x62,
+ (byte)0x9c,(byte)0x39,(byte)0x62,
+ (byte)0xbd,(byte)0x73,(byte)0x73,
+ (byte)0xcd,(byte)0x94,(byte)0x29,
+ (byte)0xc5,(byte)0x8b,(byte)0x7b,
+ (byte)0xc5,(byte)0x94,(byte)0xcd,
+ (byte)0x62,(byte)0x39,(byte)0x52,
+ (byte)0x10,(byte)0x00,(byte)0x08,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x6a,(byte)0x39,(byte)0x5a,
+ (byte)0xd5,(byte)0xbd,(byte)0xee,
+ (byte)0x83,(byte)0x5a,(byte)0x73,
+ (byte)0x7b,(byte)0x41,(byte)0x62,
+ (byte)0x62,(byte)0x39,(byte)0x52,
+ (byte)0x18,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x08,(byte)0x00,
+ (byte)0x18,(byte)0x10,(byte)0x08,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x10,(byte)0x08,(byte)0x10,
+ (byte)0x18,(byte)0x10,(byte)0x20,
+ (byte)0x10,(byte)0x18,(byte)0x29,
+ (byte)0x18,(byte)0x18,(byte)0x29,
+ (byte)0x08,(byte)0x00,(byte)0x08,
+ (byte)0x08,(byte)0x08,(byte)0x08,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x08,(byte)0x00,
+ (byte)0x18,(byte)0x18,(byte)0x08,
+ (byte)0x29,(byte)0x18,(byte)0x08,
+ (byte)0x39,(byte)0x29,(byte)0x10,
+ (byte)0x29,(byte)0x20,(byte)0x00,
+ (byte)0x39,(byte)0x31,(byte)0x18,
+ (byte)0xa4,(byte)0x94,(byte)0x6a,
+ (byte)0x39,(byte)0x39,(byte)0x18,
+ (byte)0x52,(byte)0x52,(byte)0x31,
+ (byte)0xa4,(byte)0x94,(byte)0x62,
+ (byte)0x8b,(byte)0x7b,(byte)0x5a,
+ (byte)0x62,(byte)0x52,(byte)0x41,
+ (byte)0x31,(byte)0x31,(byte)0x10,
+ (byte)0x52,(byte)0x4a,(byte)0x10,
+ (byte)0x10,(byte)0x10,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x20,(byte)0x18,(byte)0x18,
+ (byte)0x83,(byte)0x52,(byte)0x4a,
+ (byte)0x29,(byte)0x10,(byte)0x10,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x5a,(byte)0x39,(byte)0x4a,
+ (byte)0xa4,(byte)0x4a,(byte)0x6a,
+ (byte)0xa4,(byte)0x5a,(byte)0x62,
+ (byte)0xbd,(byte)0x73,(byte)0x4a,
+ (byte)0xc5,(byte)0x7b,(byte)0x10,
+ (byte)0xc5,(byte)0x94,(byte)0xa4,
+ (byte)0xc5,(byte)0x94,(byte)0xd5,
+ (byte)0xa4,(byte)0x7b,(byte)0xac,
+ (byte)0x29,(byte)0x10,(byte)0x20,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x29,(byte)0x10,(byte)0x20,
+ (byte)0x62,(byte)0x41,(byte)0x5a,
+ (byte)0x31,(byte)0x08,(byte)0x18,
+ (byte)0x62,(byte)0x41,(byte)0x5a,
+ (byte)0x18,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x10,(byte)0x08,(byte)0x08,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x10,(byte)0x08,(byte)0x00,
+ (byte)0x10,(byte)0x18,(byte)0x00,
+ (byte)0x31,(byte)0x20,(byte)0x08,
+ (byte)0x29,(byte)0x20,(byte)0x08,
+ (byte)0x39,(byte)0x31,(byte)0x10,
+ (byte)0x41,(byte)0x41,(byte)0x20,
+ (byte)0x62,(byte)0x5a,(byte)0x39,
+ (byte)0x9c,(byte)0x8b,(byte)0x62,
+ (byte)0x9c,(byte)0x83,(byte)0x52,
+ (byte)0xac,(byte)0x9c,(byte)0x73,
+ (byte)0x39,(byte)0x29,(byte)0x10,
+ (byte)0x4a,(byte)0x41,(byte)0x10,
+ (byte)0x52,(byte)0x52,(byte)0x18,
+ (byte)0x10,(byte)0x10,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x39,(byte)0x20,(byte)0x20,
+ (byte)0x6a,(byte)0x31,(byte)0x39,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x08,(byte)0x08,
+ (byte)0x73,(byte)0x39,(byte)0x52,
+ (byte)0x83,(byte)0x10,(byte)0x20,
+ (byte)0x9c,(byte)0x41,(byte)0x52,
+ (byte)0xac,(byte)0x62,(byte)0x4a,
+ (byte)0xb4,(byte)0x73,(byte)0x41,
+ (byte)0xcd,(byte)0xbd,(byte)0xde,
+ (byte)0xcd,(byte)0xb4,(byte)0xe6,
+ (byte)0xac,(byte)0x83,(byte)0xb4,
+ (byte)0x4a,(byte)0x20,(byte)0x39,
+ (byte)0x10,(byte)0x00,(byte)0x08,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x31,(byte)0x18,(byte)0x29,
+ (byte)0x10,(byte)0x00,(byte)0x08,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x10,(byte)0x00,(byte)0x08,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x18,(byte)0x10,(byte)0x00,
+ (byte)0x08,(byte)0x10,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x52,(byte)0x41,(byte)0x29,
+ (byte)0x6a,(byte)0x52,(byte)0x31,
+ (byte)0x41,(byte)0x39,(byte)0x20,
+ (byte)0x62,(byte)0x52,(byte)0x31,
+ (byte)0x62,(byte)0x52,(byte)0x31,
+ (byte)0xac,(byte)0x9c,(byte)0x6a,
+ (byte)0x6a,(byte)0x62,(byte)0x41,
+ (byte)0x20,(byte)0x18,(byte)0x00,
+ (byte)0x5a,(byte)0x5a,(byte)0x20,
+ (byte)0x41,(byte)0x41,(byte)0x10,
+ (byte)0x18,(byte)0x08,(byte)0x08,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x7b,(byte)0x41,(byte)0x52,
+ (byte)0x18,(byte)0x08,(byte)0x10,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x20,(byte)0x18,(byte)0x18,
+ (byte)0x7b,(byte)0x41,(byte)0x4a,
+ (byte)0x83,(byte)0x20,(byte)0x39,
+ (byte)0xa4,(byte)0x52,(byte)0x8b,
+ (byte)0x8b,(byte)0x29,(byte)0x29,
+ (byte)0xb4,(byte)0x7b,(byte)0x94,
+ (byte)0xcd,(byte)0xbd,(byte)0xe6,
+ (byte)0xcd,(byte)0xb4,(byte)0xe6,
+ (byte)0xcd,(byte)0xbd,(byte)0xee,
+ (byte)0x52,(byte)0x31,(byte)0x4a,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x10,(byte)0x00,(byte)0x08,
+ (byte)0x18,(byte)0x00,(byte)0x08,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x29,(byte)0x18,(byte)0x18,
+ (byte)0xb4,(byte)0x9c,(byte)0x7b,
+ (byte)0x94,(byte)0x7b,(byte)0x52,
+ (byte)0x29,(byte)0x20,(byte)0x08,
+ (byte)0x20,(byte)0x20,(byte)0x08,
+ (byte)0x31,(byte)0x29,(byte)0x08,
+ (byte)0x5a,(byte)0x4a,(byte)0x20,
+ (byte)0x10,(byte)0x10,(byte)0x00,
+ (byte)0x31,(byte)0x31,(byte)0x10,
+ (byte)0x52,(byte)0x4a,(byte)0x20,
+ (byte)0x4a,(byte)0x39,(byte)0x20,
+ (byte)0x18,(byte)0x18,(byte)0x10,
+ (byte)0x52,(byte)0x39,(byte)0x41,
+ (byte)0x62,(byte)0x39,(byte)0x4a,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x62,(byte)0x62,(byte)0x62,
+ (byte)0x94,(byte)0x62,(byte)0x6a,
+ (byte)0x7b,(byte)0x18,(byte)0x39,
+ (byte)0x8b,(byte)0x29,(byte)0x52,
+ (byte)0xbd,(byte)0x8b,(byte)0xac,
+ (byte)0xc5,(byte)0xac,(byte)0xd5,
+ (byte)0xa4,(byte)0x7b,(byte)0x9c,
+ (byte)0x94,(byte)0x62,(byte)0x83,
+ (byte)0x39,(byte)0x10,(byte)0x20,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x31,(byte)0x20,(byte)0x18,
+ (byte)0x52,(byte)0x41,(byte)0x31,
+ (byte)0x29,(byte)0x18,(byte)0x10,
+ (byte)0x20,(byte)0x18,(byte)0x08,
+ (byte)0x31,(byte)0x20,(byte)0x08,
+ (byte)0x20,(byte)0x18,(byte)0x08,
+ (byte)0x20,(byte)0x18,(byte)0x08,
+ (byte)0x39,(byte)0x39,(byte)0x10,
+ (byte)0x5a,(byte)0x52,(byte)0x31,
+ (byte)0x62,(byte)0x52,(byte)0x41,
+ (byte)0x39,(byte)0x39,(byte)0x31,
+ (byte)0x10,(byte)0x08,(byte)0x08,
+ (byte)0x73,(byte)0x41,(byte)0x52,
+ (byte)0x10,(byte)0x08,(byte)0x08,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x08,(byte)0x08,
+ (byte)0x8b,(byte)0x83,(byte)0x83,
+ (byte)0x94,(byte)0x6a,(byte)0x7b,
+ (byte)0x62,(byte)0x20,(byte)0x20,
+ (byte)0x8b,(byte)0x4a,(byte)0x6a,
+ (byte)0xb4,(byte)0x83,(byte)0xa4,
+ (byte)0xbd,(byte)0x94,(byte)0xbd,
+ (byte)0xa4,(byte)0x7b,(byte)0xa4,
+ (byte)0x6a,(byte)0x41,(byte)0x5a,
+ (byte)0x52,(byte)0x29,(byte)0x41,
+ (byte)0x18,(byte)0x08,(byte)0x18,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x10,(byte)0x00,(byte)0x00,
+ (byte)0x10,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x31,(byte)0x29,(byte)0x10,
+ (byte)0x29,(byte)0x18,(byte)0x08,
+ (byte)0x18,(byte)0x08,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x10,(byte)0x08,(byte)0x00,
+ (byte)0x29,(byte)0x18,(byte)0x10,
+ (byte)0x52,(byte)0x4a,(byte)0x41,
+ (byte)0x08,(byte)0x08,(byte)0x08,
+ (byte)0x5a,(byte)0x31,(byte)0x31,
+ (byte)0x20,(byte)0x10,(byte)0x18,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x29,(byte)0x31,(byte)0x29,
+ (byte)0x94,(byte)0x94,(byte)0x94,
+ (byte)0x9c,(byte)0x8b,(byte)0x8b,
+ (byte)0x4a,(byte)0x18,(byte)0x10,
+ (byte)0x83,(byte)0x52,(byte)0x6a,
+ (byte)0xa4,(byte)0x5a,(byte)0x83,
+ (byte)0xa4,(byte)0x73,(byte)0x94,
+ (byte)0x83,(byte)0x5a,(byte)0x73,
+ (byte)0x31,(byte)0x08,(byte)0x18,
+ (byte)0x10,(byte)0x00,(byte)0x08,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x10,(byte)0x00,(byte)0x00,
+ (byte)0x10,(byte)0x00,(byte)0x00,
+ (byte)0x18,(byte)0x00,(byte)0x08,
+ (byte)0x29,(byte)0x08,(byte)0x10,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x10,(byte)0x00,(byte)0x08,
+ (byte)0x39,(byte)0x10,(byte)0x10,
+ (byte)0x20,(byte)0x08,(byte)0x08,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x10,(byte)0x00,(byte)0x00,
+ (byte)0x18,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x20,(byte)0x18,(byte)0x08,
+ (byte)0x10,(byte)0x10,(byte)0x00,
+ (byte)0x20,(byte)0x20,(byte)0x08,
+ (byte)0x41,(byte)0x29,(byte)0x10,
+ (byte)0x10,(byte)0x08,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x08,(byte)0x08,
+ (byte)0x39,(byte)0x31,(byte)0x20,
+ (byte)0x10,(byte)0x08,(byte)0x10,
+ (byte)0x31,(byte)0x20,(byte)0x18,
+ (byte)0x39,(byte)0x20,(byte)0x29,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x20,(byte)0x20,(byte)0x20,
+ (byte)0x62,(byte)0x62,(byte)0x52,
+ (byte)0x6a,(byte)0x62,(byte)0x41,
+ (byte)0x41,(byte)0x29,(byte)0x18,
+ (byte)0x62,(byte)0x39,(byte)0x52,
+ (byte)0x83,(byte)0x4a,(byte)0x62,
+ (byte)0x39,(byte)0x10,(byte)0x20,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x10,(byte)0x00,(byte)0x00,
+ (byte)0x10,(byte)0x00,(byte)0x00,
+ (byte)0x18,(byte)0x00,(byte)0x08,
+ (byte)0x5a,(byte)0x18,(byte)0x29,
+ (byte)0x31,(byte)0x08,(byte)0x08,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x10,(byte)0x00,(byte)0x08,
+ (byte)0x18,(byte)0x00,(byte)0x08,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x10,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x10,(byte)0x10,(byte)0x00,
+ (byte)0x08,(byte)0x08,(byte)0x00,
+ (byte)0x10,(byte)0x10,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x10,(byte)0x08,(byte)0x08,
+ (byte)0x20,(byte)0x08,(byte)0x08,
+ (byte)0x39,(byte)0x20,(byte)0x20,
+ (byte)0x41,(byte)0x20,(byte)0x29,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x31,(byte)0x31,(byte)0x31,
+ (byte)0x62,(byte)0x62,(byte)0x52,
+ (byte)0x8b,(byte)0x83,(byte)0x83,
+ (byte)0x29,(byte)0x18,(byte)0x18,
+ (byte)0x41,(byte)0x29,(byte)0x31,
+ (byte)0x62,(byte)0x39,(byte)0x52,
+ (byte)0x39,(byte)0x20,(byte)0x29,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x10,(byte)0x00,(byte)0x00,
+ (byte)0x10,(byte)0x00,(byte)0x00,
+ (byte)0x20,(byte)0x00,(byte)0x08,
+ (byte)0x41,(byte)0x08,(byte)0x18,
+ (byte)0x29,(byte)0x00,(byte)0x08,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x10,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x20,(byte)0x08,(byte)0x08,
+ (byte)0x41,(byte)0x29,(byte)0x29,
+ (byte)0x41,(byte)0x20,(byte)0x31,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x4a,(byte)0x41,(byte)0x4a,
+ (byte)0xac,(byte)0xa4,(byte)0xac,
+ (byte)0x73,(byte)0x6a,(byte)0x62,
+ (byte)0x10,(byte)0x08,(byte)0x00,
+ (byte)0x10,(byte)0x00,(byte)0x00,
+ (byte)0x39,(byte)0x29,(byte)0x29,
+ (byte)0x29,(byte)0x18,(byte)0x18,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x10,(byte)0x00,(byte)0x00,
+ (byte)0x31,(byte)0x08,(byte)0x18,
+ (byte)0x4a,(byte)0x10,(byte)0x10,
+ (byte)0x18,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x10,(byte)0x00,(byte)0x00,
+ (byte)0x31,(byte)0x08,(byte)0x10,
+ (byte)0x29,(byte)0x08,(byte)0x10,
+ (byte)0x10,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x18,(byte)0x08,(byte)0x08,
+ (byte)0x41,(byte)0x31,(byte)0x29,
+ (byte)0x41,(byte)0x29,(byte)0x29,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x41,(byte)0x41,(byte)0x41,
+ (byte)0x7b,(byte)0x6a,(byte)0x6a,
+ (byte)0x62,(byte)0x5a,(byte)0x52,
+ (byte)0x10,(byte)0x08,(byte)0x08,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x10,(byte)0x08,(byte)0x08,
+ (byte)0x18,(byte)0x10,(byte)0x10,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x10,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x08,(byte)0x08,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x39,(byte)0x29,(byte)0x20,
+ (byte)0x39,(byte)0x20,(byte)0x20,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x4a,(byte)0x4a,(byte)0x4a,
+ (byte)0x5a,(byte)0x5a,(byte)0x52,
+ (byte)0x41,(byte)0x39,(byte)0x31,
+ (byte)0x20,(byte)0x20,(byte)0x20,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x10,(byte)0x08,(byte)0x08,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x18,(byte)0x10,(byte)0x08,
+ (byte)0x41,(byte)0x29,(byte)0x18,
+ (byte)0x20,(byte)0x18,(byte)0x18,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x20,(byte)0x20,(byte)0x20,
+ (byte)0x39,(byte)0x39,(byte)0x31,
+ (byte)0x41,(byte)0x41,(byte)0x39,
+ (byte)0x52,(byte)0x52,(byte)0x4a,
+ (byte)0x20,(byte)0x20,(byte)0x20,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x08,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x08,
+ (byte)0x18,(byte)0x00,(byte)0x10,
+ (byte)0x10,(byte)0x00,(byte)0x08,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x08,(byte)0x08,
+ (byte)0x10,(byte)0x18,(byte)0x10,
+ (byte)0x29,(byte)0x18,(byte)0x10,
+ (byte)0x39,(byte)0x20,(byte)0x10,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x10,(byte)0x10,(byte)0x10,
+ (byte)0x29,(byte)0x29,(byte)0x20,
+ (byte)0x41,(byte)0x41,(byte)0x41,
+ (byte)0x29,(byte)0x29,(byte)0x20,
+ (byte)0x10,(byte)0x10,(byte)0x08,
+ (byte)0x18,(byte)0x08,(byte)0x10,
+ (byte)0x29,(byte)0x08,(byte)0x20,
+ (byte)0x29,(byte)0x10,(byte)0x29,
+ (byte)0x18,(byte)0x10,(byte)0x20,
+ (byte)0x10,(byte)0x10,(byte)0x18,
+ (byte)0x08,(byte)0x08,(byte)0x10,
+ (byte)0x08,(byte)0x00,(byte)0x08,
+ (byte)0x08,(byte)0x08,(byte)0x10,
+ (byte)0x00,(byte)0x00,(byte)0x08,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x08,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x10,(byte)0x10,(byte)0x08,
+ (byte)0x18,(byte)0x18,(byte)0x10,
+ (byte)0x18,(byte)0x18,(byte)0x10,
+ (byte)0x29,(byte)0x20,(byte)0x10,
+ (byte)0x31,(byte)0x18,(byte)0x08,
+ (byte)0x18,(byte)0x08,(byte)0x08,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x08,(byte)0x08,
+ (byte)0x10,(byte)0x10,(byte)0x10,
+ (byte)0x10,(byte)0x10,(byte)0x08,
+ (byte)0x08,(byte)0x08,(byte)0x08,
+ (byte)0x18,(byte)0x10,(byte)0x10,
+ (byte)0x18,(byte)0x10,(byte)0x10,
+ (byte)0x10,(byte)0x08,(byte)0x10,
+ (byte)0x10,(byte)0x10,(byte)0x18,
+ (byte)0x10,(byte)0x10,(byte)0x20,
+ (byte)0x10,(byte)0x10,(byte)0x18,
+ (byte)0x10,(byte)0x10,(byte)0x18,
+ (byte)0x08,(byte)0x00,(byte)0x08,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x08,
+ (byte)0x00,(byte)0x00,(byte)0x08,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x20,(byte)0x20,(byte)0x18,
+ (byte)0x29,(byte)0x29,(byte)0x20,
+ (byte)0x31,(byte)0x31,(byte)0x20,
+ (byte)0x39,(byte)0x31,(byte)0x20,
+ (byte)0x41,(byte)0x31,(byte)0x29,
+ (byte)0x41,(byte)0x31,(byte)0x18,
+ (byte)0x20,(byte)0x10,(byte)0x08,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x08,
+ (byte)0x08,(byte)0x08,(byte)0x08,
+ (byte)0x08,(byte)0x08,(byte)0x08,
+ (byte)0x08,(byte)0x08,(byte)0x08,
+ (byte)0x08,(byte)0x10,(byte)0x08,
+ (byte)0x10,(byte)0x10,(byte)0x08,
+ (byte)0x08,(byte)0x08,(byte)0x08,
+ (byte)0x08,(byte)0x08,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x20,(byte)0x20,(byte)0x18,
+ (byte)0x4a,(byte)0x41,(byte)0x31,
+ (byte)0x4a,(byte)0x4a,(byte)0x39,
+ (byte)0x4a,(byte)0x41,(byte)0x39,
+ (byte)0x4a,(byte)0x41,(byte)0x31,
+ (byte)0x39,(byte)0x29,(byte)0x20,
+ (byte)0x29,(byte)0x18,(byte)0x10,
+ (byte)0x18,(byte)0x08,(byte)0x08,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x08,(byte)0x00,(byte)0x08,
+ (byte)0x10,(byte)0x00,(byte)0x08,
+ (byte)0x18,(byte)0x08,(byte)0x08,
+ (byte)0x29,(byte)0x18,(byte)0x18,
+ (byte)0x20,(byte)0x18,(byte)0x18,
+ (byte)0x10,(byte)0x10,(byte)0x08,
+ (byte)0x18,(byte)0x10,(byte)0x10,
+ (byte)0x20,(byte)0x18,(byte)0x18,
+ (byte)0x41,(byte)0x41,(byte)0x31,
+ (byte)0x52,(byte)0x4a,(byte)0x39,
+ (byte)0x39,(byte)0x29,(byte)0x20,
+ (byte)0x29,(byte)0x18,(byte)0x10,
+ (byte)0x20,(byte)0x10,(byte)0x10,
+ (byte)0x10,(byte)0x08,(byte)0x08,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x18,(byte)0x08,(byte)0x10,
+ (byte)0x10,(byte)0x10,(byte)0x10,
+ (byte)0x08,(byte)0x08,(byte)0x08,
+ (byte)0x08,(byte)0x08,(byte)0x00,
+ (byte)0x10,(byte)0x10,(byte)0x10,
+ (byte)0x20,(byte)0x18,(byte)0x18,
+ (byte)0x10,(byte)0x08,(byte)0x08,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ (byte)0x00,(byte)0x00,(byte)0x00,
+ };
+
+ public DemoTex1()
+ {
+ }
+
+ public void dispose()
+ {
+ }
+
+ /* GL_RGBA, etc. arg #3 in glTexImage2D() */
+ public int getComponents()
+ {
+ return(GL_RGB);
+ }
+
+ /* arg #4 in glTexImage2D() */
+ public int getWidth()
+ {
+ return(width);
+ }
+
+ /* arg #5 in glTexImage2D() */
+ public int getHeight()
+ {
+ return(height);
+ }
+
+ /* GL_RGBA, etc. arg #7 in glTexImage2D() */
+ public int getFormat()
+ {
+ return(GL_RGB);
+ }
+
+ /* GL_UNSIGNED_BYTE, etc. arg #8 in glTexImage2D() */
+ public int getType()
+ {
+ return(GL_UNSIGNED_BYTE);
+ }
+
+ /* arg #9 in glTexImage2D() */
+ public byte[] getBits()
+ {
+ return(bits);
+ }
+}
+
diff --git a/demos/RonsDemos/FullScreenGears.java b/demos/RonsDemos/FullScreenGears.java new file mode 100644 index 0000000..e0d6151 --- /dev/null +++ b/demos/RonsDemos/FullScreenGears.java @@ -0,0 +1,18 @@ +import java.applet.*; +import java.awt.*; +import java.awt.event.*; + +public class FullScreenGears { + public static void main(String[] args) { + final Applet a = new gears(); /*from ronsdemos*/ + final Window w = new Window(new Frame()); + w.setLayout(new BorderLayout()); + w.add("Center",a); + a.init(); + a.start(); + Toolkit tk = Toolkit.getDefaultToolkit(); + Dimension screensize = tk.getScreenSize(); + w.setBounds(0,0,screensize.width,screensize.height); + w.setVisible(true); + } +} diff --git a/demos/RonsDemos/GL4JDemos.pvk b/demos/RonsDemos/GL4JDemos.pvk Binary files differnew file mode 100644 index 0000000..46cc77a --- /dev/null +++ b/demos/RonsDemos/GL4JDemos.pvk diff --git a/demos/RonsDemos/GL4JDemos.spc b/demos/RonsDemos/GL4JDemos.spc Binary files differnew file mode 100644 index 0000000..643bed1 --- /dev/null +++ b/demos/RonsDemos/GL4JDemos.spc diff --git a/demos/RonsDemos/HardCodedTexture.java b/demos/RonsDemos/HardCodedTexture.java new file mode 100644 index 0000000..6395c8a --- /dev/null +++ b/demos/RonsDemos/HardCodedTexture.java @@ -0,0 +1,31 @@ +/**
+ * @(#) HardCodedTexture.java
+ * @(#) author: Ronald B. Cemer
+ * @(#) version: 1.0
+ */
+
+import java.io.*;
+
+public interface HardCodedTexture
+{
+ public void dispose();
+
+ /* GL_RGBA, etc. arg #3 in glTexImage2D() */
+ public int getComponents();
+
+ /* arg #4 in glTexImage2D() */
+ public int getWidth();
+
+ /* arg #5 in glTexImage2D() */
+ public int getHeight();
+
+ /* GL_RGBA, etc. arg #7 in glTexImage2D() */
+ public int getFormat();
+
+ /* GL_UNSIGNED_BYTE, etc. arg #8 in glTexImage2D() */
+ public int getType();
+
+ /* arg #9 in glTexImage2D() */
+ public byte[] getBits();
+}
+
diff --git a/demos/RonsDemos/MatrixFuncs.java b/demos/RonsDemos/MatrixFuncs.java new file mode 100644 index 0000000..75493a2 --- /dev/null +++ b/demos/RonsDemos/MatrixFuncs.java @@ -0,0 +1,200 @@ +/**
+ * @(#) MatrixFuncs.java
+ * @(#) author: Ronald B. Cemer
+ * @(#) version: 1.0
+ */
+
+import java.io.*;
+
+public class MatrixFuncs
+{
+ public static final float M_PI = 3.14159265359f;
+
+ // Given the angle in degs, create a 4x4 matrix
+ // in mtx which rotates around the X axis.
+ public void rotateAroundX(float degs, float mtx[])
+ {
+ float rads, rsin, rcos;
+
+ rads = degs*(M_PI/180.0f);
+ rsin = (float)Math.sin(rads);
+ rcos = (float)Math.cos(rads);
+ mtx[0] = 1.0f;
+ mtx[1] = 0.0f;
+ mtx[2] = 0.0f;
+ mtx[3] = 0.0f;
+ mtx[4] = 0.0f;
+ mtx[5] = rcos;
+ mtx[6] = rsin;
+ mtx[7] = 0.0f;
+ mtx[8] = 0.0f;
+ mtx[9] = -rsin;
+ mtx[10] = rcos;
+ mtx[11] = 0.0f;
+ mtx[12] = 0.0f;
+ mtx[13] = 0.0f;
+ mtx[14] = 0.0f;
+ mtx[15] = 1.0f;
+ }
+
+ // Given the angle in degs, create a 4x4 matrix
+ // in mtx which rotates around the Y axis.
+ public void rotateAroundY(float degs, float mtx[])
+ {
+ float rads, rsin, rcos;
+
+ rads = degs*(M_PI/180.0f);
+ rsin = (float)Math.sin(rads);
+ rcos = (float)Math.cos(rads);
+ mtx[0] = rcos;
+ mtx[1] = 0.0f;
+ mtx[2] = -rsin;
+ mtx[3] = 0.0f;
+ mtx[4] = 0.0f;
+ mtx[5] = 1.0f;
+ mtx[6] = 0.0f;
+ mtx[7] = 0.0f;
+ mtx[8] = rsin;
+ mtx[9] = 0.0f;
+ mtx[10] = rcos;
+ mtx[11] = 0.0f;
+ mtx[12] = 0.0f;
+ mtx[13] = 0.0f;
+ mtx[14] = 0.0f;
+ mtx[15] = 1.0f;
+ }
+
+ // Given the angle in degs, create a 4x4 matrix
+ // in mtx which rotates around the Z axis.
+ public void rotateAroundZ(float degs, float mtx[])
+ {
+ float rads, rsin, rcos;
+
+ rads = degs*(M_PI/180.0f);
+ rsin = (float)Math.sin(rads);
+ rcos = (float)Math.cos(rads);
+ mtx[0] = rcos;
+ mtx[1] = rsin;
+ mtx[2] = 0.0f;
+ mtx[3] = 0.0f;
+ mtx[4] = -rsin;
+ mtx[5] = rcos;
+ mtx[6] = 0.0f;
+ mtx[7] = 0.0f;
+ mtx[8] = 0.0f;
+ mtx[9] = 0.0f;
+ mtx[10] = 1.0f;
+ mtx[11] = 0.0f;
+ mtx[12] = 0.0f;
+ mtx[13] = 0.0f;
+ mtx[14] = 0.0f;
+ mtx[15] = 1.0f;
+ }
+
+ // Given two 4x4 matrices in mtx1 and mtx2, multiply
+ // them and put the result in dest.
+ // This routine uses a temporary buffer for the result,
+ // so if dest is the same as mtx1 or mtx2, it will still
+ // work properly.
+ public void multiplyMatrices(float mtx1[], float mtx2[], float dest[])
+ {
+ float nmtx[] = new float[16];
+
+ nmtx[0] =
+ (mtx1[0]*mtx2[0]) +
+ (mtx1[1]*mtx2[4]) +
+ (mtx1[2]*mtx2[8]) +
+ (mtx1[3]*mtx2[12]);
+ nmtx[1] =
+ (mtx1[0]*mtx2[1]) +
+ (mtx1[1]*mtx2[5]) +
+ (mtx1[2]*mtx2[9]) +
+ (mtx1[3]*mtx2[13]);
+ nmtx[2] =
+ (mtx1[0]*mtx2[2]) +
+ (mtx1[1]*mtx2[6]) +
+ (mtx1[2]*mtx2[10]) +
+ (mtx1[3]*mtx2[14]);
+ nmtx[3] =
+ (mtx1[0]*mtx2[3]) +
+ (mtx1[1]*mtx2[7]) +
+ (mtx1[2]*mtx2[11]) +
+ (mtx1[3]*mtx2[15]);
+ nmtx[4] =
+ (mtx1[4]*mtx2[0]) +
+ (mtx1[5]*mtx2[4]) +
+ (mtx1[6]*mtx2[8]) +
+ (mtx1[7]*mtx2[12]);
+ nmtx[5] =
+ (mtx1[4]*mtx2[1]) +
+ (mtx1[5]*mtx2[5]) +
+ (mtx1[6]*mtx2[9]) +
+ (mtx1[7]*mtx2[13]);
+ nmtx[6] =
+ (mtx1[4]*mtx2[2]) +
+ (mtx1[5]*mtx2[6]) +
+ (mtx1[6]*mtx2[10]) +
+ (mtx1[7]*mtx2[14]);
+ nmtx[7] =
+ (mtx1[4]*mtx2[3]) +
+ (mtx1[5]*mtx2[7]) +
+ (mtx1[6]*mtx2[11]) +
+ (mtx1[7]*mtx2[15]);
+ nmtx[8] =
+ (mtx1[8]*mtx2[0]) +
+ (mtx1[9]*mtx2[4]) +
+ (mtx1[10]*mtx2[8]) +
+ (mtx1[11]*mtx2[12]);
+ nmtx[9] =
+ (mtx1[8]*mtx2[1]) +
+ (mtx1[9]*mtx2[5]) +
+ (mtx1[10]*mtx2[9]) +
+ (mtx1[11]*mtx2[13]);
+ nmtx[10] =
+ (mtx1[8]*mtx2[2]) +
+ (mtx1[9]*mtx2[6]) +
+ (mtx1[10]*mtx2[10]) +
+ (mtx1[11]*mtx2[14]);
+ nmtx[11] =
+ (mtx1[8]*mtx2[3]) +
+ (mtx1[9]*mtx2[7]) +
+ (mtx1[10]*mtx2[11]) +
+ (mtx1[11]*mtx2[15]);
+ nmtx[12] =
+ (mtx1[12]*mtx2[0]) +
+ (mtx1[13]*mtx2[4]) +
+ (mtx1[14]*mtx2[8]) +
+ (mtx1[15]*mtx2[12]);
+ nmtx[13] =
+ (mtx1[12]*mtx2[1]) +
+ (mtx1[13]*mtx2[5]) +
+ (mtx1[14]*mtx2[9]) +
+ (mtx1[15]*mtx2[13]);
+ nmtx[14] =
+ (mtx1[12]*mtx2[2]) +
+ (mtx1[13]*mtx2[6]) +
+ (mtx1[14]*mtx2[10]) +
+ (mtx1[15]*mtx2[14]);
+ nmtx[15] =
+ (mtx1[12]*mtx2[3]) +
+ (mtx1[13]*mtx2[7]) +
+ (mtx1[14]*mtx2[11]) +
+ (mtx1[15]*mtx2[15]);
+ dest[0] = nmtx[0];
+ dest[1] = nmtx[1];
+ dest[2] = nmtx[2];
+ dest[3] = nmtx[3];
+ dest[4] = nmtx[4];
+ dest[5] = nmtx[5];
+ dest[6] = nmtx[6];
+ dest[7] = nmtx[7];
+ dest[8] = nmtx[8];
+ dest[9] = nmtx[9];
+ dest[10] = nmtx[10];
+ dest[11] = nmtx[11];
+ dest[12] = nmtx[12];
+ dest[13] = nmtx[13];
+ dest[14] = nmtx[14];
+ dest[15] = nmtx[15];
+ }
+}
diff --git a/demos/RonsDemos/animApplet.skel b/demos/RonsDemos/animApplet.skel new file mode 100644 index 0000000..ebbd52e --- /dev/null +++ b/demos/RonsDemos/animApplet.skel @@ -0,0 +1,125 @@ +/**
+ * Skeleton for animated applets (applets which automatically and
+ * continually redraw without intervention).
+ */
+
+/**
+ * @(#) [place applet name here].java
+ * @(#) author: [place author here] (converted to Java by Ron Cemer)
+ */
+
+import java.applet.*;
+import java.awt.*;
+import java.awt.event.*;
+import java.lang.*;
+import java.util.*;
+import java.io.*;
+import java.util.*;
+import gl4java.GLContext;
+import gl4java.awt.GLAnimCanvas;
+
+public class myapplet extends Applet
+{
+ myappletCanvas canvas = null;
+
+
+ /* Initialize the applet */
+
+
+ public void init()
+ {
+ Dimension d = getSize();
+ setLayout(new BorderLayout());
+ canvas = new myappletCanvas(d.width, d.height);
+ add("Center", canvas);
+ }
+
+
+ /* Start the applet */
+
+
+ public void start()
+ {
+ canvas.start();
+ }
+
+
+ /* Stop the applet */
+
+
+ public void stop()
+ {
+ canvas.stop();
+ }
+
+
+ /* Destroy the applet */
+
+
+ public void destroy()
+ {
+ canvas.stop();
+ canvas.destroy();
+ }
+
+
+ /* Local GLAnimCanvas extension class */
+
+
+ private class myappletCanvas extends GLAnimCanvas
+ {
+ public myappletCanvas(int w, int h)
+ {
+ super(w, h);
+ GLContext.gljNativeDebug = false;
+ GLContext.gljClassDebug = false;
+ setAnimateFps(60.0);
+ }
+
+ public void preInit()
+ {
+ doubleBuffer = true;
+ stereoView = false;
+ }
+
+ public void init()
+ {
+ System.out.println("init(): " + this);
+ reshape(getSize().width, getSize().height);
+
+// Put OpenGL initialization code here.
+
+ glj.gljCheckGL();
+ }
+
+ public void destroy()
+ {
+ System.out.println("destroy(): " + this);
+
+// Put any special takedown code here.
+
+ cvsDispose();
+ }
+
+ public void reshape(int width, int height)
+ {
+ gl.glViewport(0,0,width,height);
+
+// Put any custom reshape code here.
+
+ }
+
+ public void display()
+ {
+ if (glj.gljMakeCurrent(true) == false) return;
+
+// Put drawing code here.
+
+ glj.gljSwap();
+ glj.gljCheckGL();
+ glj.gljFree();
+
+ if (!isSuspended()) repaint(); // Animate at full speed.
+ }
+ }
+}
diff --git a/demos/RonsDemos/dinoshade.html b/demos/RonsDemos/dinoshade.html new file mode 100644 index 0000000..1b4fe08 --- /dev/null +++ b/demos/RonsDemos/dinoshade.html @@ -0,0 +1,21 @@ +<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.61 [en] (Win98; U) [Netscape]">
+ <title>Dinoshade by Mark J. Kilgard; ported to Java by Ron Cemer</title>
+</head>
+<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#e6e6ff">
+Dinoshade applet
+<br>Originially written by Mark J. Kilgard
+<br>Ported to Java by Ron Cemer
+<br>Press and hold left mouse button, then drag to rotate view.
+<br>Press and hold left mouse button, then press and hold right mouse button, then drag to rotate light.
+<br>Click right mouse button for a menu of options.
+<br>NOTE: If your system does not support hardware-accelerated stenciling, this demo will run slowly unless you disable stenciling for shadows and reflections.
+<br>
+<applet code="dinoshade.class" width=400 height=400>
+</applet>
+<hr>
+</body>
+</html>
diff --git a/demos/RonsDemos/dinoshade.java b/demos/RonsDemos/dinoshade.java new file mode 100755 index 0000000..344fd00 --- /dev/null +++ b/demos/RonsDemos/dinoshade.java @@ -0,0 +1,1104 @@ +/**
+ * @(#) dinoshade.java
+ * @(#) author: Mark J. Kilgard (converted to Java by Ron Cemer)
+ */
+
+/* Copyright (c) Mark J. Kilgard, 1994, 1997. */
+
+/* This program is freely distributable without licensing fees
+ and is provided without guarantee or warrantee expressed or
+ implied. This program is -not- in the public domain. */
+
+/* Example for PC game developers to show how to *combine* texturing,
+ reflections, and projected shadows all in real-time with OpenGL.
+ Robust reflections use stenciling. Robust projected shadows
+ use both stenciling and polygon offset. PC game programmers
+ should realize that neither stenciling nor polygon offset are
+ supported by Direct3D, so these real-time rendering algorithms
+ are only really viable with OpenGL.
+
+ The program has modes for disabling the stenciling and polygon
+ offset uses. It is worth running this example with these features
+ toggled off so you can see the sort of artifacts that result.
+
+ Notice that the floor texturing, reflections, and shadowing
+ all co-exist properly. */
+
+/* When you run this program: Left mouse button controls the
+ view. Middle mouse button controls light position (left &
+ right rotates light around dino; up & down moves light
+ position up and down). Right mouse button pops up menu. */
+
+/* Check out the comments in the "redraw" routine to see how the
+ reflection blending and surface stenciling is done. You can
+ also see in "redraw" how the projected shadows are rendered,
+ including the use of stenciling and polygon offset. */
+
+import java.applet.*;
+import java.awt.*;
+import java.awt.event.*;
+import java.lang.*;
+import java.util.*;
+import java.io.*;
+import java.util.*;
+import gl4java.GLContext;
+import gl4java.awt.GLAnimCanvas;
+import gl4java.applet.SimpleGLAnimApplet1;
+
+public class dinoshade extends SimpleGLAnimApplet1
+{
+ static final float[][] bodyVerts =
+ {
+ { 0.0f, 3.0f, 0.0f},
+ { 1.0f, 1.0f, 0.0f},
+ { 5.0f, 1.0f, 0.0f},
+ { 8.0f, 4.0f, 0.0f},
+ { 10.0f, 4.0f, 0.0f},
+ { 11.0f, 5.0f, 0.0f},
+ { 11.0f, 11.5f, 0.0f},
+ { 13.0f, 12.0f, 0.0f},
+ { 13.0f, 13.0f, 0.0f},
+ { 10.0f, 13.5f, 0.0f},
+ { 13.0f, 14.0f, 0.0f},
+ { 13.0f, 15.0f, 0.0f},
+ { 11.0f, 16.0f, 0.0f},
+ { 8.0f, 16.0f, 0.0f},
+ { 7.0f, 15.0f, 0.0f},
+ { 7.0f, 13.0f, 0.0f},
+ { 8.0f, 12.0f, 0.0f},
+ { 7.0f, 11.0f, 0.0f},
+ { 6.0f, 6.0f, 0.0f},
+ { 4.0f, 3.0f, 0.0f},
+ { 3.0f, 2.0f, 0.0f},
+ { 1.0f, 2.0f, 0.0f},
+ };
+
+ static final int[][] bodyTris =
+ {
+ { 1, 0, 21 },
+ { 1, 21, 2 },
+ { 21, 20, 2 },
+ { 20, 19, 2 },
+ { 19, 3, 2 },
+ { 19, 18, 3 },
+ { 18, 4, 3 },
+ { 18, 5, 4 },
+ { 18, 6, 5 },
+ { 18, 17, 6 },
+ { 17, 16, 6 },
+ { 16, 7, 6 },
+ { 16, 8, 7 },
+ { 16, 15, 8 },
+ { 15, 9, 8 },
+ { 15, 14, 9 },
+ { 14, 13, 9 },
+ { 9, 13, 12 },
+ { 9, 12, 11 },
+ { 11, 10, 9 },
+ };
+
+ static final float[][] armVerts =
+ {
+ { 8.0f, 10.0f, 0.0f},
+ { 9.0f, 9.0f, 0.0f},
+ { 10.0f, 9.0f, 0.0f},
+ { 13.0f, 8.0f, 0.0f},
+ { 14.0f, 9.0f, 0.0f},
+ { 16.0f, 9.0f, 0.0f},
+ { 15.0f, 9.5f, 0.0f},
+ { 16.0f, 10.0f, 0.0f},
+ { 15.0f, 10.0f, 0.0f},
+ { 15.5f, 11.0f, 0.0f},
+ { 14.5f, 10.0f, 0.0f},
+ { 14.0f, 11.0f, 0.0f},
+ { 14.0f, 10.0f, 0.0f},
+ { 13.0f, 9.0f, 0.0f},
+ { 11.0f, 11.0f, 0.0f},
+ { 9.0f, 11.0f, 0.0f},
+ };
+
+ static final int[][] armTris =
+ {
+ { 0, 15, 1 },
+ { 15, 2, 1 },
+ { 15, 14, 2 },
+ { 14, 13, 2 },
+ { 13, 3, 2 },
+ { 13, 4, 3 },
+ { 13, 12, 4 },
+ { 12, 11, 10 },
+ { 12, 10, 4 },
+ { 10, 6, 4 },
+ { 6, 5, 4 },
+ { 8, 7, 6 },
+ { 10, 8, 6 },
+ { 10, 9, 8 },
+ };
+
+ static final float[][] legVerts =
+ {
+ { 8.0f, 6.0f, 0.0f},
+ { 8.0f, 4.0f, 0.0f},
+ { 9.0f, 3.0f, 0.0f},
+ { 9.0f, 2.0f, 0.0f},
+ { 8.0f, 1.0f, 0.0f},
+ { 8.0f, 0.5f, 0.0f},
+ { 9.0f, 0.0f, 0.0f},
+ { 12.0f, 0.0f, 0.0f},
+ { 10.0f, 1.0f, 0.0f},
+ { 10.0f, 2.0f, 0.0f},
+ { 12.0f, 4.0f, 0.0f},
+ { 11.0f, 6.0f, 0.0f},
+ { 10.0f, 7.0f, 0.0f},
+ { 9.0f, 7.0f, 0.0f},
+ };
+
+ static final int[][] legTris =
+ {
+ { 6, 5, 7 },
+ { 5, 8, 7 },
+ { 5, 4, 8 },
+ { 4, 3, 8 },
+ { 3, 9, 8 },
+ { 3, 2, 9 },
+ { 2, 10, 9 },
+ { 2, 1, 10 },
+ { 1, 0, 10 },
+ { 0, 11, 10 },
+ { 0, 12, 11 },
+ { 0, 13, 12 },
+ };
+
+ static final float[][] eyeVerts =
+ {
+ { 8.75f, 15.0f, 0.0f},
+ { 9.0f, 14.7f, 0.0f},
+ { 9.6f, 14.7f, 0.0f},
+ { 10.1f, 15.0f, 0.0f},
+ { 9.6f, 15.25f, 0.0f},
+ { 9.0f, 15.25f, 0.0f},
+ };
+
+ static final int[][] eyeTris =
+ {
+ { 1, 0, 2 },
+ { 0, 5, 2 },
+ { 5, 4, 2 },
+ { 4, 3, 2 },
+ };
+
+ static final float floorVertices[][] =
+ {
+ { -20.0f, 0.0f, 20.0f },
+ { 20.0f, 0.0f, 20.0f },
+ { 20.0f, 0.0f, -20.0f },
+ { -20.0f, 0.0f, -20.0f },
+ };
+
+
+ /* Initialize the applet */
+
+
+ public void init()
+ {
+ super.init();
+ Dimension d = getSize();
+ canvas = new dinoshadeCanvas(d.width, d.height);
+ add("Center", canvas);
+ }
+
+
+ public static void main( String args[] ) {
+ dinoshade applet =
+ new dinoshade();
+
+ Frame f = new Frame("dinoshade");
+
+ f.addWindowListener( new WindowAdapter()
+ {
+ public void windowClosed(WindowEvent e)
+ {
+ System.exit(0);
+ }
+ public void windowClosing(WindowEvent e)
+ {
+ windowClosed(e);
+ }
+ }
+ );
+
+ f.setLayout(new BorderLayout());
+ f.add("Center", applet);
+ applet.setSize(500,300);
+ applet.init(); + applet.start();
+ Dimension ps = applet.getPreferredSize();
+ f.setBounds(-100,-100,99,99);
+ f.setVisible(true);
+ f.setVisible(false);
+ Insets i = f.getInsets();
+ f.setBounds(0,0,
+ ps.width+i.left+i.right,
+ ps.height+i.top+i.bottom);
+ f.setVisible(true);
+ }
+
+ /* Local GLAnimCanvas extension class */
+
+
+ private class dinoshadeCanvas extends GLAnimCanvas
+ implements MouseListener, MouseMotionListener, ActionListener
+ {
+ private static final double M_PI = 3.14159265;
+
+ // Menu options:
+ private static final String M_NONE = "-----------------------";
+ private static final String M_MOTION = "Toggle motion";
+ private static final String M_LIGHT = "Toggle light";
+ private static final String M_TEXTURE = "Toggle texture";
+ private static final String M_SHADOWS = "Toggle shadows";
+ private static final String M_REFLECTION = "Toggle reflection";
+ private static final String M_DINOSAUR = "Toggle dinosaur";
+ private static final String M_STENCIL_REFLECTION = "Toggle reflection stenciling";
+ private static final String M_STENCIL_SHADOW = "Toggle shadow stenciling";
+ private static final String M_OFFSET_SHADOW = "Toggle shadow offset";
+ private static final String M_POSITIONAL = "Positional light";
+ private static final String M_DIRECTIONAL = "Directional light";
+
+ private PopupMenu menu = null;
+ private boolean menu_showing = false;
+ private boolean save_suspended = false;
+
+ /* Variables controlling various rendering modes. */
+ private boolean stencilReflection = true, stencilShadow = true, offsetShadow = true;
+ private boolean renderShadow = true, renderDinosaur = true, renderReflection = true;
+ private boolean linearFiltering = false, useTexture = true;
+// private boolean useMipmaps = false;
+ private boolean lightSwitch = true;
+ private boolean directionalLight = true;
+
+ /* Time varying or user-controled variables. */
+ private float jump = 0.0f;
+ private float lightAngle = 0.0f, lightHeight = 20.0f;
+ private float angle = -150.0f; /* in degrees */
+ private float angle2 = 30.0f; /* in degrees */
+
+ private boolean moving = false;
+ private int startx, starty;
+ private boolean lightMoving = false;
+ private int lightStartX, lightStartY;
+
+ private final float bodyWidth = 3.0f;
+
+ private final float[] lightPosition = new float[4];
+ private final float lightColor[] = {0.8f, 1.0f, 0.8f, 1.0f}; /* green-tinted */
+ private final float skinColor[] = {0.1f, 1.0f, 0.1f, 1.0f};
+ private final float eyeColor[] = {1.0f, 0.2f, 0.2f, 1.0f};
+ private final int X = 0, Y = 1, Z = 2, W = 3;
+ private final int A = 0, B = 1, C = 2, D = 3;
+
+ /* Enumerants for refering to display lists. */
+ private static final int
+ BODY_SIDE = 1, BODY_EDGE = 2, BODY_WHOLE = 3,
+ ARM_SIDE = 4, ARM_EDGE = 5, ARM_WHOLE = 6,
+ LEG_SIDE = 7, LEG_EDGE = 8, LEG_WHOLE = 9,
+ EYE_SIDE = 10, EYE_EDGE = 11, EYE_WHOLE = 12;
+ private float floorPlane[] = new float[4];
+ private float floorShadow[] = new float[16];
+
+ public dinoshadeCanvas(int w, int h)
+ {
+ super(w, h);
+ GLContext.gljNativeDebug = false;
+ GLContext.gljClassDebug = false;
+ setAnimateFps(30.0);
+ }
+
+ public void preInit()
+ {
+ doubleBuffer = true;
+ stereoView = false;
+ stencilBits = 3; + }
+
+ public void init()
+ {
+ int [] res=new int[6]; + + gl.glGetIntegerv(GL_STENCIL_BITS,res); + + System.out.println("init(): " + this + "\n\t" + + "Stencil bits are "+res[0] +"\n\t" + + "IsOwnCreatedWindow: "+createOwnWindow); + + reshape(getSize().width, getSize().height);
+
+ makeDinosaur();
+
+ gl.glPolygonOffset(-2.0f, -1.0f);
+
+ gl.glEnable(GL_CULL_FACE);
+ gl.glEnable(GL_DEPTH_TEST);
+ gl.glEnable(GL_TEXTURE_2D);
+ gl.glLineWidth(3.0f);
+
+ gl.glMatrixMode(GL_PROJECTION);
+ glu.gluPerspective
+ ( /* field of view in degree */ 40.0f,
+ /* aspect ratio */ 1.0f,
+ /* Z near */ 20.0f,
+ /* Z far */ 100.0f);
+ gl.glMatrixMode(GL_MODELVIEW);
+ glu.gluLookAt
+ (0.0f, 8.0f, 60.0f, /* eye is at (0,8,60) */
+ 0.0f, 8.0f, 0.0f, /* center is at (0,8,0) */
+ 0.0f, 1.0f, 0.0f); /* up is in postivie Y direction */
+
+ gl.glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, 1);
+ gl.glLightfv(GL_LIGHT0, GL_DIFFUSE, lightColor);
+ gl.glLightf(GL_LIGHT0, GL_CONSTANT_ATTENUATION, 0.1f);
+ gl.glLightf(GL_LIGHT0, GL_LINEAR_ATTENUATION, 0.05f);
+ gl.glEnable(GL_LIGHT0);
+ gl.glEnable(GL_LIGHTING);
+
+ makeFloorTexture();
+
+ /* Setup floor plane for projected shadow calculations. */
+ findPlane
+ (floorPlane,
+ floorVertices[1],
+ floorVertices[2],
+ floorVertices[3]);
+
+ glj.gljCheckGL();
+
+ menu = new PopupMenu("Options");
+ menu.add(M_MOTION);
+ menu.add(M_NONE);
+ menu.add(M_LIGHT);
+ menu.add(M_TEXTURE);
+ menu.add(M_SHADOWS);
+ menu.add(M_REFLECTION);
+ menu.add(M_DINOSAUR);
+ menu.add(M_NONE);
+ menu.add(M_STENCIL_REFLECTION);
+ menu.add(M_STENCIL_SHADOW);
+ menu.add(M_OFFSET_SHADOW);
+ menu.add(M_NONE);
+ menu.add(M_POSITIONAL);
+ menu.add(M_DIRECTIONAL);
+ menu.addActionListener(this);
+ add(menu);
+
+ addMouseListener(this);
+ addMouseMotionListener(this);
+ }
+
+ public void doCleanup()
+ {
+ removeMouseListener(this);
+ removeMouseMotionListener(this);
+ menu.removeActionListener(this);
+ }
+
+ public void reshape(int width, int height)
+ {
+ gl.glViewport(0,0,width,height);
+ }
+
+ public void display()
+ {
+ if (glj.gljMakeCurrent() == false) return;
+
+ if (!isSuspended())
+ {
+ long ltime =
+ System.currentTimeMillis() % 3142L; //approximate 2*PI*500
+ float time = (float)(((double)ltime)/500.0);
+ jump = 4.0f * (float)Math.abs(Math.sin(time)*0.5);
+ if (!lightMoving) lightAngle += 0.0f;
+ }
+
+ /* Clear; default stencil clears to zero. */
+ if ((stencilReflection && renderReflection) || (stencilShadow && renderShadow))
+ gl.glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
+ else
+ /* Avoid clearing stencil when not using it. */
+ gl.glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+ /* Reposition the light source. */
+ lightPosition[0] = 12*(float)Math.cos(lightAngle);
+ lightPosition[1] = lightHeight;
+ lightPosition[2] = 12*(float)Math.sin(lightAngle);
+ if (directionalLight)
+ lightPosition[3] = 0.0f;
+ else
+ lightPosition[3] = 1.0f;
+
+ shadowMatrix(floorShadow, floorPlane, lightPosition);
+
+ gl.glPushMatrix();
+
+ /* Perform scene rotations based on user mouse input. */
+ gl.glRotatef(angle2, 1.0f, 0.0f, 0.0f);
+ gl.glRotatef(angle, 0.0f, 1.0f, 0.0f);
+
+ /* Tell GL new light source position. */
+ gl.glLightfv(GL_LIGHT0, GL_POSITION, lightPosition);
+
+ if (renderReflection)
+ {
+ if (stencilReflection)
+ {
+ /* We can eliminate the visual "artifact" of seeing the "flipped"
+ dinosaur underneath the floor by using stencil. The idea is
+ draw the floor without color or depth update but so that
+ a stencil value of one is where the floor will be. Later when
+ rendering the dinosaur reflection, we will only update pixels
+ with a stencil value of 1 to make sure the reflection only
+ lives on the floor, not below the floor. */
+
+ /* Don't update color or depth. */
+ gl.glDisable(GL_DEPTH_TEST);
+ gl.glColorMask(false, false, false, false);
+
+ /* Draw 1 into the stencil buffer. */
+ gl.glEnable(GL_STENCIL_TEST);
+ gl.glStencilOp(GL_REPLACE, GL_REPLACE, GL_REPLACE);
+ gl.glStencilFunc(GL_ALWAYS, 1, 0xffffffff);
+
+ /* Now render floor; floor pixels just get their stencil set to 1. */
+ drawFloor();
+
+ /* Re-enable update of color and depth. */
+ gl.glColorMask(true, true, true, true);
+ gl.glEnable(GL_DEPTH_TEST);
+
+ /* Now, only render where stencil is set to 1. */
+ gl.glStencilFunc(GL_EQUAL, 1, 0xffffffff); /* draw if ==1 */
+ gl.glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP);
+ }
+
+ gl.glPushMatrix();
+
+ /* The critical reflection step: Reflect dinosaur through the floor
+ (the Y=0 plane) to make a relection. */
+
+ gl.glScalef(1.0f, -1.0f, 1.0f);
+
+ /* Reflect the light position. */
+ gl.glLightfv(GL_LIGHT0, GL_POSITION, lightPosition);
+
+ /* To avoid our normals getting reversed and hence botched lighting
+ on the reflection, turn on normalize. */
+ gl.glEnable(GL_NORMALIZE);
+ gl.glCullFace(GL_FRONT);
+
+ /* Draw the reflected dinosaur. */
+ drawDinosaur();
+
+ /* Disable noramlize again and re-enable back face culling. */
+ gl.glDisable(GL_NORMALIZE);
+ gl.glCullFace(GL_BACK);
+
+ gl.glPopMatrix();
+
+ /* Switch back to the unreflected light position. */
+ gl.glLightfv(GL_LIGHT0, GL_POSITION, lightPosition);
+
+ if (stencilReflection) gl.glDisable(GL_STENCIL_TEST);
+ }
+
+ /* Back face culling will get used to only draw either the top or the
+ bottom floor. This let's us get a floor with two distinct
+ appearances. The top floor surface is reflective and kind of red.
+ The bottom floor surface is not reflective and blue. */
+
+ /* Draw "bottom" of floor in blue. */
+ gl.glFrontFace(GL_CW); /* Switch face orientation. */
+ gl.glColor4f(0.1f, 0.1f, 0.7f, 1.0f);
+ drawFloor();
+ gl.glFrontFace(GL_CCW);
+
+ if (renderShadow)
+ {
+ if (stencilShadow)
+ {
+ /* Draw the floor with stencil value 3. This helps us only
+ draw the shadow once per floor pixel (and only on the
+ floor pixels). */
+ gl.glEnable(GL_STENCIL_TEST);
+ gl.glStencilFunc(GL_ALWAYS, 3, 0xffffffff);
+ gl.glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE);
+ }
+ }
+
+ /* Draw "top" of floor. Use blending to blend in reflection. */
+ gl.glEnable(GL_BLEND);
+ gl.glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+ gl.glColor4f(0.7f, 0.0f, 0.0f, 0.3f);
+ gl.glColor4f(1.0f, 1.0f, 1.0f, 0.3f);
+ drawFloor();
+ gl.glDisable(GL_BLEND);
+
+ /* Draw "actual" dinosaur, not its reflection. */
+ if (renderDinosaur) drawDinosaur();
+
+ if (renderShadow)
+ {
+ /* Render the projected shadow. */
+ if (stencilShadow)
+ {
+ /* Now, only render where stencil is set above 2 (ie, 3 where
+ the top floor is). Update stencil with 2 where the shadow
+ gets drawn so we don't redraw (and accidently reblend) the
+ shadow). */
+ gl.glStencilFunc(GL_LESS, 2, 0xffffffff); /* draw if ==1 */
+ gl.glStencilOp(GL_REPLACE, GL_REPLACE, GL_REPLACE);
+ }
+ /* To eliminate depth buffer artifacts, we use polygon offset
+ to raise the depth of the projected shadow slightly so
+ that it does not depth buffer alias with the floor. */
+ if (offsetShadow) gl.glEnable(GL_POLYGON_OFFSET_FILL);
+
+ /* Render 50% black shadow color on top of whatever the
+ floor appareance is. */
+ gl.glEnable(GL_BLEND);
+ gl.glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+ gl.glDisable(GL_LIGHTING); /* Force the 50% black. */
+ gl.glColor4f(0.0f, 0.0f, 0.0f, 0.5f);
+
+ gl.glPushMatrix();
+ /* Project the shadow. */
+ gl.glMultMatrixf(floorShadow);
+ drawDinosaur();
+ gl.glPopMatrix();
+
+ gl.glDisable(GL_BLEND);
+ gl.glEnable(GL_LIGHTING);
+
+ if (offsetShadow) gl.glDisable(GL_POLYGON_OFFSET_FILL);
+ if (stencilShadow) gl.glDisable(GL_STENCIL_TEST);
+ }
+
+ gl.glPushMatrix();
+ gl.glDisable(GL_LIGHTING);
+ gl.glColor3f(1.0f, 1.0f, 0.0f);
+ if (directionalLight)
+ {
+ /* Draw an arrowhead. */
+ gl.glDisable(GL_CULL_FACE);
+ gl.glTranslatef(lightPosition[0], lightPosition[1], lightPosition[2]);
+ gl.glRotatef(lightAngle * (float)(-180.0 / M_PI), 0, 1, 0);
+ gl.glRotatef((float)Math.atan(lightHeight/12) * (float)(180.0 / M_PI), 0, 0, 1);
+ gl.glBegin(GL_TRIANGLE_FAN);
+ gl.glVertex3f(0, 0, 0);
+ gl.glVertex3f(2, 1, 1);
+ gl.glVertex3f(2, -1, 1);
+ gl.glVertex3f(2, -1, -1);
+ gl.glVertex3f(2, 1, -1);
+ gl.glVertex3f(2, 1, 1);
+ gl.glEnd();
+ /* Draw a white line from light direction. */
+ gl.glColor3f(1.0f, 1.0f, 1.0f);
+ gl.glBegin(GL_LINES);
+ gl.glVertex3f(0, 0, 0);
+ gl.glVertex3f(5, 0, 0);
+ gl.glEnd();
+ gl.glEnable(GL_CULL_FACE);
+ }
+ else
+ {
+ /* Draw a yellow ball at the light source. */
+ gl.glTranslatef(lightPosition[0], lightPosition[1], lightPosition[2]);
+ int qobj = glu.gluNewQuadric();
+ glu.gluQuadricOrientation(qobj,GLU_OUTSIDE);
+ glu.gluQuadricNormals(qobj,GLU_SMOOTH);
+ glu.gluQuadricTexture(qobj,false);
+ glu.gluSphere(qobj,1.0f,5,5);
+ glu.gluDeleteQuadric(qobj);
+ }
+ gl.glEnable(GL_LIGHTING);
+ gl.glPopMatrix();
+
+ gl.glPopMatrix();
+
+ glj.gljSwap();
+ glj.gljCheckGL();
+ glj.gljFree();
+
+ // if (!isSuspended()) repaint(); // Animate at full speed.
+ }
+
+ private void makeDinosaur()
+ {
+ extrudeSolidFromPolygon
+ (bodyVerts,
+ bodyTris,
+ bodyWidth,
+ BODY_SIDE,
+ BODY_EDGE,
+ BODY_WHOLE);
+ extrudeSolidFromPolygon
+ (armVerts,
+ armTris,
+ bodyWidth/4,
+ ARM_SIDE,
+ ARM_EDGE,
+ ARM_WHOLE);
+ extrudeSolidFromPolygon
+ (legVerts,
+ legTris,
+ bodyWidth/2,
+ LEG_SIDE,
+ LEG_EDGE,
+ LEG_WHOLE);
+ extrudeSolidFromPolygon
+ (eyeVerts,
+ eyeTris,
+ bodyWidth+0.2f,
+ EYE_SIDE,
+ EYE_EDGE,
+ EYE_WHOLE);
+ }
+
+ private void drawDinosaur()
+ {
+ gl.glPushMatrix();
+ /* Translate the dinosaur to be at (0,8,0). */
+ gl.glTranslatef(-8, 0, -bodyWidth / 2);
+ gl.glTranslatef(0.0f, jump, 0.0f);
+ gl.glMaterialfv(GL_FRONT, GL_DIFFUSE, skinColor);
+ gl.glCallList(BODY_WHOLE);
+ gl.glTranslatef(0.0f, 0.0f, bodyWidth);
+ gl.glCallList(ARM_WHOLE);
+ gl.glCallList(LEG_WHOLE);
+ gl.glTranslatef(0.0f, 0.0f, -bodyWidth - bodyWidth / 4);
+ gl.glCallList(ARM_WHOLE);
+ gl.glTranslatef(0.0f, 0.0f, -bodyWidth / 4);
+ gl.glCallList(LEG_WHOLE);
+ gl.glTranslatef(0.0f, 0.0f, bodyWidth / 2 - 0.1f);
+ gl.glMaterialfv(GL_FRONT, GL_DIFFUSE, eyeColor);
+ gl.glCallList(EYE_WHOLE);
+ gl.glPopMatrix();
+ }
+
+ private void makeFloorTexture()
+ {
+ /* Nice floor texture tiling pattern. */
+ String circles[] =
+ {
+ "....xxxx........",
+ "..xxxxxxxx......",
+ ".xxxxxxxxxx.....",
+ ".xxx....xxx.....",
+ "xxx......xxx....",
+ "xxx......xxx....",
+ "xxx......xxx....",
+ "xxx......xxx....",
+ ".xxx....xxx.....",
+ ".xxxxxxxxxx.....",
+ "..xxxxxxxx......",
+ "....xxxx........",
+ "................",
+ "................",
+ "................",
+ "................"
+ };
+ byte floorTexture[] = new byte[16*16*3];
+
+ /* Setup RGB image for the texture. */
+ int idx = 0;
+ for (int t = 0; t < 16; t++)
+ {
+ for (int s = 0; s < 16; s++)
+ {
+ if (circles[t].charAt(s) == 'x')
+ {
+ /* Nice blue. */
+ floorTexture[idx++] = (byte)0x1f;
+ floorTexture[idx++] = (byte)0x1f;
+ floorTexture[idx++] = (byte)0x8f;
+ }
+ else
+ {
+ /* Light gray. */
+ floorTexture[idx++] = (byte)0xca;
+ floorTexture[idx++] = (byte)0xca;
+ floorTexture[idx++] = (byte)0xca;
+ }
+ }
+ }
+
+ gl.glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
+
+// if (useMipmaps)
+// {
+// gl.glTexParameteri
+// (GL_TEXTURE_2D,
+// GL_TEXTURE_MIN_FILTER,
+// GL_LINEAR_MIPMAP_LINEAR);
+// glu.gluBuild2DMipmaps
+// (GL_TEXTURE_2D,3,16,16,GL_RGB,GL_UNSIGNED_BYTE,floorTexture);
+// }
+// else
+ {
+ if (linearFiltering)
+ {
+ gl.glTexParameteri
+ (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+ gl.glTexParameteri
+ (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+ }
+ else
+ {
+ gl.glTexParameteri
+ (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+ gl.glTexParameteri
+ (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+ }
+ gl.glTexImage2D
+ (GL_TEXTURE_2D,0,3,16,16,0,GL_RGB,GL_UNSIGNED_BYTE,floorTexture);
+ }
+ }
+
+ /* Draw a floor (possibly textured). */
+ private void drawFloor()
+ {
+ gl.glDisable(GL_LIGHTING);
+ if (useTexture) gl.glEnable(GL_TEXTURE_2D);
+ gl.glBegin(GL_QUADS);
+ gl.glTexCoord2f(0.0f, 0.0f);
+ gl.glVertex3fv(floorVertices[0]);
+ gl.glTexCoord2f(0.0f, 16.0f);
+ gl.glVertex3fv(floorVertices[1]);
+ gl.glTexCoord2f(16.0f, 16.0f);
+ gl.glVertex3fv(floorVertices[2]);
+ gl.glTexCoord2f(16.0f, 0.0f);
+ gl.glVertex3fv(floorVertices[3]);
+ gl.glEnd();
+ if (useTexture) gl.glDisable(GL_TEXTURE_2D);
+ gl.glEnable(GL_LIGHTING);
+ }
+
+ /* create a matrix that will project the desired shadow */
+ void shadowMatrix(float shadowMat[], float groundplane[], float lightpos[])
+ {
+ float dot;
+
+ /* find dot product between light position vector
+ and ground plane normal */
+ dot =
+ groundplane[0] * lightpos[0] +
+ groundplane[1] * lightpos[1] +
+ groundplane[2] * lightpos[2] +
+ groundplane[3] * lightpos[3];
+
+ shadowMat[0] = dot - lightpos[0] * groundplane[0];
+ shadowMat[4] = -lightpos[0] * groundplane[1];
+ shadowMat[8] = -lightpos[0] * groundplane[2];
+ shadowMat[12] = -lightpos[0] * groundplane[3];
+
+ shadowMat[1] = -lightpos[1] * groundplane[0];
+ shadowMat[5] = dot - lightpos[1] * groundplane[1];
+ shadowMat[9] = -lightpos[1] * groundplane[2];
+ shadowMat[13] = -lightpos[1] * groundplane[3];
+
+ shadowMat[2] = -lightpos[2] * groundplane[0];
+ shadowMat[6] = -lightpos[2] * groundplane[1];
+ shadowMat[10] = dot - lightpos[2] * groundplane[2];
+ shadowMat[14] = -lightpos[2] * groundplane[3];
+
+ shadowMat[3] = -lightpos[3] * groundplane[0];
+ shadowMat[7] = -lightpos[3] * groundplane[1];
+ shadowMat[11] = -lightpos[3] * groundplane[2];
+ shadowMat[15] = dot - lightpos[3] * groundplane[3];
+ }
+
+ /* find the plane equation given 3 points */
+ void findPlane(float plane[], float v0[], float v1[], float v2[])
+ {
+ float vec0[] = new float[3], vec1[] = new float[3];
+
+ /* need 2 vectors to find cross product */
+ vec0[X] = v1[X] - v0[X];
+ vec0[Y] = v1[Y] - v0[Y];
+ vec0[Z] = v1[Z] - v0[Z];
+
+ vec1[X] = v2[X] - v0[X];
+ vec1[Y] = v2[Y] - v0[Y];
+ vec1[Z] = v2[Z] - v0[Z];
+
+ /* find cross product to get A, B, and C of plane equation */
+ plane[A] = vec0[Y] * vec1[Z] - vec0[Z] * vec1[Y];
+ plane[B] = -(vec0[X] * vec1[Z] - vec0[Z] * vec1[X]);
+ plane[C] = vec0[X] * vec1[Y] - vec0[Y] * vec1[X];
+ plane[D] = -(plane[A]*v0[X] + plane[B]*v0[Y] + plane[C]*v0[Z]);
+ }
+
+ /* Mark Kilgard's tessellation code from the "dino" demos.
+ Bug fixes and re-write without GLU tesselator
+ by Ronald B. Cemer */
+ private void extrudeSolidFromPolygon
+ (float data[][],
+ int outlineTriIndices[][],
+ float thickness,
+ int side,
+ int edge,
+ int whole)
+ {
+ double dx, dy, len;
+ int i, j0, j1, j2;
+ int min, max, range;
+ float x0, y0, x1, y1;
+ int count = data.length;
+ int tricount = outlineTriIndices.length;
+
+ gl.glNewList(side, GL_COMPILE);
+ gl.glShadeModel(GL_SMOOTH);
+ gl.glBegin(GL_TRIANGLES);
+ for (i = 0; i < tricount; i++)
+ {
+/* *+*+* Note that we use the triangle indices in reverse order here
+ because they are specified in reverse order in the arrays. */
+ j0 = outlineTriIndices[i][2];
+ j1 = outlineTriIndices[i][1];
+ j2 = outlineTriIndices[i][0];
+ gl.glVertex3f(data[j0][0],data[j0][1],0.0f);
+ gl.glVertex3f(data[j1][0],data[j1][1],0.0f);
+ gl.glVertex3f(data[j2][0],data[j2][1],0.0f);
+ }
+ gl.glEnd();
+ gl.glEndList();
+
+ gl.glNewList(edge, GL_COMPILE);
+ gl.glShadeModel(GL_FLAT); /* flat shade keeps angular hands
+ from being "smoothed" */
+ for (min = max = 0; min < count; min = max)
+ {
+ for (max = min+1; max < count; max++)
+ if (data[max][2] != 0.0f) break;
+ range = max-min;
+ gl.glBegin(GL_QUAD_STRIP);
+ for (i = min; i <= max; i++)
+ {
+ j0 = i;
+ j1 = i+1;
+ if (j0 >= max) j0 -= range;
+ if (j1 >= max) j1 -= range;
+ x0 = data[j0][0];
+ y0 = data[j0][1];
+ x1 = data[j1][0];
+ y1 = data[j1][1];
+ gl.glVertex3f(x0, y0, 0.0f);
+ gl.glVertex3f(x0, y0, thickness);
+ // Normals
+ dx = y1 - y0;
+ dy = x0 - x1;
+ len = Math.sqrt(dx * dx + dy * dy);
+ gl.glNormal3f((float)(dx / len), (float)(dy / len), 0.0f);
+ }
+ gl.glEnd();
+ }
+ gl.glEndList();
+
+ gl.glNewList(whole, GL_COMPILE);
+ gl.glFrontFace(GL_CW);
+
+ gl.glCallList(edge);
+
+ gl.glNormal3f(0.0f, 0.0f, -1.0f);
+ gl.glCallList(side);
+ gl.glPushMatrix();
+ gl.glTranslatef(0.0f, 0.0f, thickness);
+ gl.glFrontFace(GL_CCW);
+ gl.glNormal3f(0.0f, 0.0f, 1.0f);
+ gl.glCallList(side);
+ gl.glPopMatrix();
+
+ gl.glEndList();
+ }
+
+ // Methods required for the implementation of MouseListener
+ public void mouseEntered(MouseEvent evt)
+ {
+ }
+
+ public void mouseExited(MouseEvent evt)
+ {
+ }
+
+ public void mousePressed(MouseEvent evt)
+ {
+ // Left button moves view.
+ // Both buttons moves light.
+ // Right button pops up menu.
+ if (!menu_showing)
+ {
+ if ((evt.getModifiers() & evt.BUTTON3_MASK) == 0)
+ {
+ moving = true;
+ startx = evt.getX();
+ starty = evt.getY();
+ }
+ else if (moving)
+ {
+ moving = false;
+ lightMoving = true;
+ lightStartX = evt.getX();
+ lightStartY = evt.getY();
+ }
+ else
+ {
+ // Must be right mouse button.
+ menu_showing = true;
+ save_suspended = isSuspended();
+ if (!save_suspended)
+ {
+ setSuspended(true);
+ repaint(100);
+ try
+ {
+ Thread.currentThread().sleep(200);
+ }
+ catch (Exception e)
+ { }
+ }
+ menu.show(this,evt.getX(),evt.getY());
+ }
+ }
+ else
+ {
+ menu_showing = false;
+ setSuspended(save_suspended);
+ }
+ }
+
+ public void mouseReleased(MouseEvent evt)
+ {
+ lightMoving = false;
+ if ((evt.getModifiers() & evt.BUTTON3_MASK) == 0)
+ {
+ // Must be left button.
+ moving = false;
+ }
+ }
+
+ public void mouseClicked(MouseEvent evt)
+ {
+ }
+
+ // Methods required for the implementation of MouseMotionListener
+ public void mouseDragged(MouseEvent evt)
+ {
+ int x = evt.getX(), y = evt.getY();
+ if (moving)
+ {
+ angle += (x - startx);
+ while (angle < 0.0f) angle += 360.0f;
+ while (angle >= 360.0f) angle -= 360.0f;
+ angle2 += (y - starty);
+ if (angle2 < -180.0f)
+ angle2 = -180.0f;
+ else if (angle2 > 180.0f)
+ angle2 = 180.0f;
+ startx = x;
+ starty = y;
+ if (isSuspended()) repaint();
+ }
+ else if (lightMoving)
+ {
+ lightAngle += (lightStartX - x)/40.0f;
+ while (lightAngle < 0.0f) lightAngle += 360.0f;
+ while (lightAngle >= 360.0f) lightAngle -= 360.0f;
+ lightHeight += (lightStartY - y)/20.0f;
+ lightStartX = x;
+ lightStartY = y;
+ if (isSuspended()) repaint();
+ }
+ }
+
+ public void mouseMoved(MouseEvent evt)
+ {
+ }
+
+ // Method required for the implementation of ActionListener
+ public void actionPerformed(ActionEvent evt)
+ {
+ if (glj.gljMakeCurrent() == false) return;
+ boolean dorepaint = false;
+ String c = evt.getActionCommand();
+
+ if (c.equals(M_MOTION))
+ {
+ if (menu_showing)
+ save_suspended = !save_suspended;
+ else
+ setSuspended(!isSuspended());
+ dorepaint = true;
+ }
+ else if (c.equals(M_LIGHT))
+ {
+ lightSwitch = !lightSwitch;
+ if (lightSwitch)
+ gl.glEnable(GL_LIGHT0);
+ else
+ gl.glDisable(GL_LIGHT0);
+ dorepaint = true;
+ }
+ else if (c.equals(M_TEXTURE))
+ {
+ useTexture = !useTexture;
+ dorepaint = true;
+ }
+ else if (c.equals(M_SHADOWS))
+ {
+ renderShadow = !renderShadow;
+ dorepaint = true;
+ }
+ else if (c.equals(M_REFLECTION))
+ {
+ renderReflection = !renderReflection;
+ dorepaint = true;
+ }
+ else if (c.equals(M_DINOSAUR))
+ {
+ renderDinosaur = !renderDinosaur;
+ dorepaint = true;
+ }
+ else if (c.equals(M_STENCIL_REFLECTION))
+ {
+ stencilReflection = !stencilReflection;
+ dorepaint = true;
+ }
+ else if (c.equals(M_STENCIL_SHADOW))
+ {
+ stencilShadow = !stencilShadow;
+ dorepaint = true;
+ }
+ else if (c.equals(M_OFFSET_SHADOW))
+ {
+ offsetShadow = !offsetShadow;
+ dorepaint = true;
+ }
+ else if (c.equals(M_POSITIONAL))
+ {
+ directionalLight = false;
+ dorepaint = true;
+ }
+ else if (c.equals(M_DIRECTIONAL))
+ {
+ directionalLight = true;
+ dorepaint = true;
+ }
+
+ glj.gljFree();
+ if (menu_showing)
+ {
+ menu_showing = false;
+ setSuspended(save_suspended);
+ }
+ if ( (isSuspended()) && (dorepaint) ) repaint();
+ }
+ }
+}
diff --git a/demos/RonsDemos/dinoshade_plugin13.html b/demos/RonsDemos/dinoshade_plugin13.html new file mode 100644 index 0000000..da6f965 --- /dev/null +++ b/demos/RonsDemos/dinoshade_plugin13.html @@ -0,0 +1,52 @@ +<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.61 [en] (Win98; U) [Netscape]">
+ <title>Dinoshade by Mark J. Kilgard; ported to Java by Ron Cemer</title>
+</head>
+<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#e6e6ff">
+Dinoshade applet
+<br>Originially written by Mark J. Kilgard
+<br>Ported to Java by Ron Cemer
+<br>Press and hold left mouse button, then drag to rotate view.
+<br>Press and hold left mouse button, then press and hold right mouse button, then drag to rotate light.
+<br>Click right mouse button for a menu of options.
+<br>NOTE: If your system does not support hardware-accelerated stenciling, this demo will run slowly unless you disable stenciling for shadows and reflections.
+<br>
+<!--"CONVERTED_APPLET"-->
+<!-- CONVERTER VERSION 1.3 --> +<SCRIPT LANGUAGE="JavaScript"><!-- + var _info = navigator.userAgent; var _ns = false; + var _ie = (_info.indexOf("MSIE") > 0 && _info.indexOf("Win") > 0 && _info.indexOf("Windows 3.1") < 0); +//--></SCRIPT> +<COMMENT><SCRIPT LANGUAGE="JavaScript1.1"><!-- + var _ns = (navigator.appName.indexOf("Netscape") >= 0 && ((_info.indexOf("Win") > 0 && _info.indexOf("Win16") < 0 && java.lang.System.getProperty("os.version").indexOf("3.5") < 0) || (_info.indexOf("Sun") > 0) || (_info.indexOf("Linux") > 0))); +//--></SCRIPT></COMMENT> + +<SCRIPT LANGUAGE="JavaScript"><!-- + if (_ie == true) document.writeln('<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" WIDTH = 400 HEIGHT = 400 codebase="http://java.sun.com/products/plugin/1.3/jinstall-13-win32.cab#Version=1,3,0,0"><NOEMBED><XMP>'); + else if (_ns == true) document.writeln('<EMBED type="application/x-java-applet;version=1.3" CODE = "dinoshade.class" WIDTH = 400 HEIGHT = 400 scriptable=false pluginspage="http://java.sun.com/products/plugin/1.3/plugin-install.html"><NOEMBED><XMP>'); +//--></SCRIPT> +<APPLET CODE = "dinoshade.class" WIDTH = 400 HEIGHT = 400></XMP> +<PARAM NAME = CODE VALUE = "dinoshade.class" >
+ +<PARAM NAME="type" VALUE="application/x-java-applet;version=1.3"> +<PARAM NAME="scriptable" VALUE="false"> + +</APPLET> + +</NOEMBED></EMBED></OBJECT> + + +<!-- +<APPLET CODE = "dinoshade.class" WIDTH = 400 HEIGHT = 400>
+
+
+</APPLET> +--> +<!--"END_CONVERTED_APPLET"-->
+
+<hr>
+</body>
+</html>
diff --git a/demos/RonsDemos/dof.html b/demos/RonsDemos/dof.html new file mode 100644 index 0000000..b614546 --- /dev/null +++ b/demos/RonsDemos/dof.html @@ -0,0 +1,17 @@ +<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.61 [en] (Win98; U) [Netscape]">
+ <title>DOF by Silicon Graphics; ported to Java by Ron Cemer</title>
+</head>
+<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#e6e6ff">
+DOF applet
+<br>Originially written by Silicon Graphics
+<br>Ported to Java by Ron Cemer
+<br>
+<applet code="dof.class" width=400 height=400>
+</applet>
+<hr>
+</body>
+</html>
diff --git a/demos/RonsDemos/dof.java b/demos/RonsDemos/dof.java new file mode 100644 index 0000000..58d4e1a --- /dev/null +++ b/demos/RonsDemos/dof.java @@ -0,0 +1,513 @@ +/**
+ * @(#) dof.java
+ * @(#) author: Silicon Graphics (converted to Java by Ron Cemer)
+ */
+
+import java.applet.*;
+import java.awt.*;
+import java.awt.event.*;
+import java.lang.*;
+import java.util.*;
+import java.io.*;
+import java.util.*;
+import gl4java.GLContext;
+import gl4java.awt.GLCanvas;
+
+/*
+ * Copyright (c) 1993-1997, Silicon Graphics, Inc.
+ * ALL RIGHTS RESERVED
+ * Permission to use, copy, modify, and distribute this software for
+ * any purpose and without fee is hereby granted, provided that the above
+ * copyright notice appear in all copies and that both the copyright notice
+ * and this permission notice appear in supporting documentation, and that
+ * the name of Silicon Graphics, Inc. not be used in advertising
+ * or publicity pertaining to distribution of the software without specific,
+ * written prior permission.
+ *
+ * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
+ * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
+ * FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
+ * GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT,
+ * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY
+ * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION,
+ * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF
+ * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN
+ * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
+ * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * US Government Users Restricted Rights
+ * Use, duplication, or disclosure by the Government is subject to
+ * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
+ * (c)(1)(ii) of the Rights in Technical Data and Computer Software
+ * clause at DFARS 252.227-7013 and/or in similar or successor
+ * clauses in the FAR or the DOD or NASA FAR Supplement.
+ * Unpublished-- rights reserved under the copyright laws of the
+ * United States. Contractor/manufacturer is Silicon Graphics,
+ * Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311.
+ *
+ * OpenGL(R) is a registered trademark of Silicon Graphics, Inc.
+ */
+
+/*
+ * This program demonstrates use of the accumulation buffer to
+ * create an out-of-focus depth-of-field effect. The teapots
+ * are drawn several times into the accumulation buffer. The
+ * viewing volume is jittered, except at the focal point, where
+ * the viewing volume is at the same position, each time. In
+ * this case, the gold teapot remains in focus.
+ */
+
+public class dof extends Applet
+{
+ // Data for drawing teapots:
+ /* Rim, body, lid, and bottom data must be reflected in x and
+ y; handle and spout data across the y axis only. */
+ private static final int patchdata[][] =
+ {
+ /* rim */
+ {102, 103, 104, 105, 4, 5, 6, 7, 8, 9, 10, 11,
+ 12, 13, 14, 15},
+ /* body */
+ {12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
+ 24, 25, 26, 27},
+ {24, 25, 26, 27, 29, 30, 31, 32, 33, 34, 35, 36,
+ 37, 38, 39, 40},
+ /* lid */
+ {96, 96, 96, 96, 97, 98, 99, 100, 101, 101, 101,
+ 101, 0, 1, 2, 3,},
+ {0, 1, 2, 3, 106, 107, 108, 109, 110, 111, 112,
+ 113, 114, 115, 116, 117},
+ /* bottom */
+ {118, 118, 118, 118, 124, 122, 119, 121, 123, 126,
+ 125, 120, 40, 39, 38, 37},
+ /* handle */
+ {41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
+ 53, 54, 55, 56},
+ {53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
+ 28, 65, 66, 67},
+ /* spout */
+ {68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
+ 80, 81, 82, 83},
+ {80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91,
+ 92, 93, 94, 95}
+ };
+ private static final float cpdata[][] =
+ {
+ {0.2f, 0.0f, 2.7f}, {0.2f, -0.112f, 2.7f}, {0.112f, -0.2f, 2.7f}, {0.0f,
+ -0.2f, 2.7f}, {1.3375f, 0.0f, 2.53125f}, {1.3375f, -0.749f, 2.53125f},
+ {0.749f, -1.3375f, 2.53125f}, {0.0f, -1.3375f, 2.53125f}, {1.4375f,
+ 0.0f, 2.53125f}, {1.4375f, -0.805f, 2.53125f}, {0.805f, -1.4375f,
+ 2.53125f}, {0.0f, -1.4375f, 2.53125f}, {1.5f, 0.0f, 2.4f}, {1.5f, -0.84f,
+ 2.4f}, {0.84f, -1.5f, 2.4f}, {0.0f, -1.5f, 2.4f}, {1.75f, 0.0f, 1.875f},
+ {1.75f, -0.98f, 1.875f}, {0.98f, -1.75f, 1.875f}, {0.0f, -1.75f,
+ 1.875f}, {2f, 0.0f, 1.35f}, {2f, -1.12f, 1.35f}, {1.12f, -2f, 1.35f},
+ {0.0f, -2f, 1.35f}, {2f, 0.0f, 0.9f}, {2f, -1.12f, 0.9f}, {1.12f, -2f,
+ 0.9f}, {0.0f, -2f, 0.9f}, {-2f, 0.0f, 0.9f}, {2f, 0.0f, 0.45f}, {2f, -1.12f,
+ 0.45f}, {1.12f, -2f, 0.45f}, {0.0f, -2f, 0.45f}, {1.5f, 0.0f, 0.225f},
+ {1.5f, -0.84f, 0.225f}, {0.84f, -1.5f, 0.225f}, {0.0f, -1.5f, 0.225f},
+ {1.5f, 0.0f, 0.15f}, {1.5f, -0.84f, 0.15f}, {0.84f, -1.5f, 0.15f}, {0.0f,
+ -1.5f, 0.15f}, {-1.6f, 0.0f, 2.025f}, {-1.6f, -0.3f, 2.025f}, {-1.5f,
+ -0.3f, 2.25f}, {-1.5f, 0.0f, 2.25f}, {-2.3f, 0.0f, 2.025f}, {-2.3f, -0.3f,
+ 2.025f}, {-2.5f, -0.3f, 2.25f}, {-2.5f, 0.0f, 2.25f}, {-2.7f, 0.0f,
+ 2.025f}, {-2.7f, -0.3f, 2.025f}, {-3f, -0.3f, 2.25f}, {-3f, 0.0f,
+ 2.25f}, {-2.7f, 0.0f, 1.8f}, {-2.7f, -0.3f, 1.8f}, {-3f, -0.3f, 1.8f},
+ {-3f, 0.0f, 1.8f}, {-2.7f, 0.0f, 1.575f}, {-2.7f, -0.3f, 1.575f}, {-3f,
+ -0.3f, 1.35f}, {-3f, 0.0f, 1.35f}, {-2.5f, 0.0f, 1.125f}, {-2.5f, -0.3f,
+ 1.125f}, {-2.65f, -0.3f, 0.9375f}, {-2.65f, 0.0f, 0.9375f}, {-2f,
+ -0.3f, 0.9f}, {-1.9f, -0.3f, 0.6f}, {-1.9f, 0.0f, 0.6f}, {1.7f, 0.0f,
+ 1.425f}, {1.7f, -0.66f, 1.425f}, {1.7f, -0.66f, 0.6f}, {1.7f, 0.0f,
+ 0.6f}, {2.6f, 0.0f, 1.425f}, {2.6f, -0.66f, 1.425f}, {3.1f, -0.66f,
+ 0.825f}, {3.1f, 0.0f, 0.825f}, {2.3f, 0.0f, 2.1f}, {2.3f, -0.25f, 2.1f},
+ {2.4f, -0.25f, 2.025f}, {2.4f, 0.0f, 2.025f}, {2.7f, 0.0f, 2.4f}, {2.7f,
+ -0.25f, 2.4f}, {3.3f, -0.25f, 2.4f}, {3.3f, 0.0f, 2.4f}, {2.8f, 0.0f,
+ 2.475f}, {2.8f, -0.25f, 2.475f}, {3.525f, -0.25f, 2.49375f},
+ {3.525f, 0.0f, 2.49375f}, {2.9f, 0.0f, 2.475f}, {2.9f, -0.15f, 2.475f},
+ {3.45f, -0.15f, 2.5125f}, {3.45f, 0.0f, 2.5125f}, {2.8f, 0.0f, 2.4f},
+ {2.8f, -0.15f, 2.4f}, {3.2f, -0.15f, 2.4f}, {3.2f, 0.0f, 2.4f}, {0.0f, 0.0f,
+ 3.15f}, {0.8f, 0.0f, 3.15f}, {0.8f, -0.45f, 3.15f}, {0.45f, -0.8f,
+ 3.15f}, {0.0f, -0.8f, 3.15f}, {0.0f, 0.0f, 2.85f}, {1.4f, 0.0f, 2.4f}, {1.4f,
+ -0.784f, 2.4f}, {0.784f, -1.4f, 2.4f}, {0.0f, -1.4f, 2.4f}, {0.4f, 0.0f,
+ 2.55f}, {0.4f, -0.224f, 2.55f}, {0.224f, -0.4f, 2.55f}, {0.0f, -0.4f,
+ 2.55f}, {1.3f, 0.0f, 2.55f}, {1.3f, -0.728f, 2.55f}, {0.728f, -1.3f,
+ 2.55f}, {0.0f, -1.3f, 2.55f}, {1.3f, 0.0f, 2.4f}, {1.3f, -0.728f, 2.4f},
+ {0.728f, -1.3f, 2.4f}, {0.0f, -1.3f, 2.4f}, {0.0f, 0.0f, 0.0f}, {1.425f,
+ -0.798f, 0.0f}, {1.5f, 0.0f, 0.075f}, {1.425f, 0.0f, 0.0f}, {0.798f, -1.425f,
+ 0.0f}, {0.0f, -1.5f, 0.075f}, {0.0f, -1.425f, 0.0f}, {1.5f, -0.84f, 0.075f},
+ {0.84f, -1.5f, 0.075f}
+ };
+ private static final float tex[] =
+ {
+ 0.0f, 0.0f,
+ 1.0f, 0.0f,
+ 0.0f, 1.0f,
+ 1.0f, 1.0f
+ };
+ /* 8 jitter points */
+ double j8[][] =
+ {
+ {-0.334818, 0.435331},
+ { 0.286438, -0.393495},
+ { 0.459462, 0.141540},
+ {-0.414498, -0.192829},
+ {-0.183790, 0.082102},
+ {-0.079263, -0.317383},
+ { 0.102254, 0.299133},
+ { 0.164216, -0.054399}
+ };
+
+ dofCanvas canvas = null;
+
+
+ /* Initialize the applet */
+
+
+ public void init()
+ {
+ Dimension d = getSize();
+ setLayout(new BorderLayout());
+ canvas = new dofCanvas(d.width, d.height);
+ add("Center", canvas);
+ }
+
+
+ /* Start the applet */
+
+
+ public void start()
+ {
+ }
+
+
+ /* Stop the applet */
+
+
+ public void stop()
+ {
+ }
+
+
+ /* Destroy the applet */
+
+
+ public void destroy()
+ {
+ canvas.cvsDispose();
+ }
+
+
+ /* Local GLCanvas extension class */
+
+
+ private class dofCanvas extends GLCanvas
+ {
+ private final double PI_ = 3.14159265358979323846;
+ int teapotList;
+
+ public dofCanvas(int w, int h)
+ {
+ super(w, h);
+ GLContext.gljNativeDebug = false;
+ GLContext.gljClassDebug = false;
+ }
+
+ public void preInit()
+ {
+ doubleBuffer = true;
+ stereoView = false;
+ accumSize = 8;
+ }
+
+ public void init()
+ {
+ System.out.println("init(): " + this);
+ reshape(getSize().width, getSize().height);
+
+ float ambient[] = { 0.0f, 0.0f, 0.0f, 1.0f };
+ float diffuse[] = { 1.0f, 1.0f, 1.0f, 1.0f };
+ float specular[] = { 1.0f, 1.0f, 1.0f, 1.0f };
+ float position[] = { 0.0f, 3.0f, 3.0f, 0.0f };
+
+ float lmodel_ambient[] = { 0.2f, 0.2f, 0.2f, 1.0f };
+ float local_view[] = { 0.0f };
+
+ gl.glLightfv(GL_LIGHT0, GL_AMBIENT, ambient);
+ gl.glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse);
+ gl.glLightfv(GL_LIGHT0, GL_POSITION, position);
+
+ gl.glLightModelfv(GL_LIGHT_MODEL_AMBIENT, lmodel_ambient);
+ gl.glLightModelfv(GL_LIGHT_MODEL_LOCAL_VIEWER, local_view);
+
+ gl.glFrontFace(GL_CW);
+ gl.glEnable(GL_LIGHTING);
+ gl.glEnable(GL_LIGHT0);
+ gl.glEnable(GL_AUTO_NORMAL);
+ gl.glEnable(GL_NORMALIZE);
+ gl.glEnable(GL_DEPTH_TEST);
+
+ gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
+ gl.glClearAccum(0.0f, 0.0f, 0.0f, 0.0f);
+
+ /* make teapot display list */
+ teapotList = gl.glGenLists(1);
+ gl.glNewList(teapotList, GL_COMPILE);
+ glutSolidTeapot(0.5);
+ gl.glEndList();
+
+ glj.gljCheckGL();
+ }
+
+ public void cvsDispose()
+ {
+ System.out.println("destroy(): " + this);
+ super.cvsDispose();
+ }
+
+ public void reshape(int width, int height)
+ {
+ gl.glViewport(0,0,width,height);
+ }
+
+ public void display()
+ {
+ if (glj.gljMakeCurrent() == false) return;
+
+ int viewport[] = new int[4];
+
+ gl.glGetIntegerv(GL_VIEWPORT, viewport);
+ gl.glClear(GL_ACCUM_BUFFER_BIT);
+
+ for (int jitter = 0; jitter < 8; jitter++)
+ {
+ gl.glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+ accPerspective
+ (45.0,
+ (double)viewport[2]/(double)viewport[3],
+ 1.0, 15.0, 0.0, 0.0,
+ 0.33*j8[jitter][0], 0.33*j8[jitter][1], 5.0);
+ /* ruby, gold, silver, emerald, and cyan teapots */
+ renderTeapot
+ (-1.1f, -0.5f, -4.5f, 0.1745f, 0.01175f,
+ 0.01175f, 0.61424f, 0.04136f, 0.04136f,
+ 0.727811f, 0.626959f, 0.626959f, 0.6f);
+ renderTeapot
+ (-0.5f, -0.5f, -5.0f, 0.24725f, 0.1995f,
+ 0.0745f, 0.75164f, 0.60648f, 0.22648f,
+ 0.628281f, 0.555802f, 0.366065f, 0.4f);
+ renderTeapot
+ (0.2f, -0.5f, -5.5f, 0.19225f, 0.19225f,
+ 0.19225f, 0.50754f, 0.50754f, 0.50754f,
+ 0.508273f, 0.508273f, 0.508273f, 0.4f);
+ renderTeapot
+ (1.0f, -0.5f, -6.0f, 0.0215f, 0.1745f, 0.0215f,
+ 0.07568f, 0.61424f, 0.07568f, 0.633f,
+ 0.727811f, 0.633f, 0.6f);
+ renderTeapot
+ (1.8f, -0.5f, -6.5f, 0.0f, 0.1f, 0.06f, 0.0f,
+ 0.50980392f, 0.50980392f, 0.50196078f,
+ 0.50196078f, 0.50196078f, 0.25f);
+ gl.glAccum(GL_ACCUM, 0.125f);
+ }
+ gl.glAccum (GL_RETURN, 1.0f);
+
+ glj.gljSwap();
+ glj.gljCheckGL();
+ glj.gljFree();
+ }
+
+ // Imported from glut.
+ private void glutSolidTeapot(double scale)
+ {
+ teapot(14, scale, GL_FILL);
+ }
+
+ // Imported from glut.
+ private void teapot(int grid, double scale, int type)
+ {
+ float p[] = new float[4*4*3];
+ float q[] = new float[4*4*3];
+ float r[] = new float[4*4*3];
+ float s[] = new float[4*4*3];
+ float sc = (float)(0.5*scale);
+
+ gl.glPushAttrib(GL_ENABLE_BIT | GL_EVAL_BIT);
+ gl.glEnable(GL_AUTO_NORMAL);
+ gl.glEnable(GL_NORMALIZE);
+ gl.glEnable(GL_MAP2_VERTEX_3);
+ gl.glEnable(GL_MAP2_TEXTURE_COORD_2);
+ gl.glPushMatrix();
+ gl.glRotatef(270.0f, 1.0f, 0.0f, 0.0f);
+ gl.glScalef(sc, sc, sc);
+ gl.glTranslatef(0.0f, 0.0f, -1.5f);
+ for (int i = 0; i < 10; i++)
+ {
+ for (int j = 0; j < 4; j++)
+ {
+ for (int k = 0; k < 4; k++)
+ {
+ for (int l = 0; l < 3; l++)
+ {
+ p[(j*12)+(k*3)+l] = cpdata[patchdata[i][j * 4 + k]][l];
+ q[(j*12)+(k*3)+l] = cpdata[patchdata[i][j * 4 + (3 - k)]][l];
+ if (l == 1)
+ q[(j*12)+(k*3)+l] *= -1.0f;
+ if (i < 6)
+ {
+ r[(j*12)+(k*3)+l] =
+ cpdata[patchdata[i][j * 4 + (3 - k)]][l];
+ if (l == 0)
+ r[(j*12)+(k*3)+l] *= -1.0f;
+ s[(j*12)+(k*3)+l] =
+ cpdata[patchdata[i][j * 4 + k]][l];
+ if (l == 0)
+ s[(j*12)+(k*3)+l] *= -1.0f;
+ if (l == 1)
+ s[(j*12)+(k*3)+l] *= -1.0f;
+ }
+ }
+ }
+ }
+ gl.glMap2f
+ (GL_MAP2_TEXTURE_COORD_2, 0, 1, 2, 2, 0, 1, 4, 2, tex);
+ gl.glMap2f
+ (GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4, p);
+ gl.glMapGrid2f(grid, 0.0f, 1.0f, grid, 0.0f, 1.0f);
+ gl.glEvalMesh2(type, 0, grid, 0, grid);
+ gl.glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4, q);
+ gl.glEvalMesh2(type, 0, grid, 0, grid);
+ if (i < 6)
+ {
+ gl.glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4, r);
+ gl.glEvalMesh2(type, 0, grid, 0, grid);
+ gl.glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4, s);
+ gl.glEvalMesh2(type, 0, grid, 0, grid);
+ }
+ }
+ gl.glPopMatrix();
+ gl.glPopAttrib();
+ }
+
+ /* accFrustum()
+ * The first 6 arguments are identical to the glFrustum() call.
+ *
+ * pixdx and pixdy are anti-alias jitter in pixels.
+ * Set both equal to 0.0 for no anti-alias jitter.
+ * eyedx and eyedy are depth-of field jitter in pixels.
+ * Set both equal to 0.0 for no depth of field effects.
+ *
+ * focus is distance from eye to plane in focus.
+ * focus must be greater than, but not equal to 0.0.
+ *
+ * Note that accFrustum() calls glTranslatef(). You will
+ * probably want to insure that your ModelView matrix has been
+ * initialized to identity before calling accFrustum().
+ */
+ private void accFrustum
+ (double left,
+ double right,
+ double bottom,
+ double top,
+ double near,
+ double far,
+ double pixdx,
+ double pixdy,
+ double eyedx,
+ double eyedy,
+ double focus)
+ {
+ double xwsize, ywsize;
+ double dx, dy;
+ int viewport[] = new int[4];
+
+ gl.glGetIntegerv(GL_VIEWPORT, viewport);
+
+ xwsize = right - left;
+ ywsize = top - bottom;
+
+ dx = -(pixdx*xwsize/(double) viewport[2] + eyedx*near/focus);
+ dy = -(pixdy*ywsize/(double) viewport[3] + eyedy*near/focus);
+
+ gl.glMatrixMode(GL_PROJECTION);
+ gl.glLoadIdentity();
+ gl.glFrustum
+ ((float)(left + dx),
+ (float)(right + dx),
+ (float)(bottom + dy),
+ (float)(top + dy),
+ (float)near,
+ (float)far);
+ gl.glMatrixMode(GL_MODELVIEW);
+ gl.glLoadIdentity();
+ gl.glTranslatef((float)-eyedx, (float)-eyedy, 0.0f);
+ }
+
+ /* accPerspective()
+ *
+ * The first 4 arguments are identical to the gluPerspective() call.
+ * pixdx and pixdy are anti-alias jitter in pixels.
+ * Set both equal to 0.0 for no anti-alias jitter.
+ * eyedx and eyedy are depth-of field jitter in pixels.
+ * Set both equal to 0.0 for no depth of field effects.
+ *
+ * focus is distance from eye to plane in focus.
+ * focus must be greater than, but not equal to 0.0.
+ *
+ * Note that accPerspective() calls accFrustum().
+ */
+ private void accPerspective
+ (double fovy,
+ double aspect,
+ double near,
+ double far,
+ double pixdx,
+ double pixdy,
+ double eyedx,
+ double eyedy,
+ double focus)
+ {
+ double fov2,left,right,bottom,top;
+
+ fov2 = ((fovy*PI_) / 180.0) / 2.0;
+
+ top = near / (Math.cos(fov2) / Math.sin(fov2));
+ bottom = -top;
+
+ right = top * aspect;
+ left = -right;
+
+ accFrustum
+ (left,right,bottom,top,near,far,pixdx,pixdy,eyedx,eyedy,focus);
+ }
+
+ private void renderTeapot
+ (float x,
+ float y,
+ float z,
+ float ambr,
+ float ambg,
+ float ambb,
+ float difr,
+ float difg,
+ float difb,
+ float specr,
+ float specg,
+ float specb,
+ float shine)
+ {
+ float mat[] = new float[4];
+
+ gl.glPushMatrix();
+ gl.glTranslatef(x, y, z);
+ mat[0] = ambr; mat[1] = ambg; mat[2] = ambb; mat[3] = 1.0f;
+ gl.glMaterialfv(GL_FRONT, GL_AMBIENT, mat);
+ mat[0] = difr; mat[1] = difg; mat[2] = difb;
+ gl.glMaterialfv(GL_FRONT, GL_DIFFUSE, mat);
+ mat[0] = specr; mat[1] = specg; mat[2] = specb;
+ gl.glMaterialfv(GL_FRONT, GL_SPECULAR, mat);
+ gl.glMaterialf(GL_FRONT, GL_SHININESS, shine*128.0f);
+ gl.glCallList(teapotList);
+ gl.glPopMatrix();
+ }
+ }
+}
diff --git a/demos/RonsDemos/dof_plugin13.html b/demos/RonsDemos/dof_plugin13.html new file mode 100644 index 0000000..1f1e874 --- /dev/null +++ b/demos/RonsDemos/dof_plugin13.html @@ -0,0 +1,48 @@ +<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.61 [en] (Win98; U) [Netscape]">
+ <title>DOF by Silicon Graphics; ported to Java by Ron Cemer</title>
+</head>
+<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#e6e6ff">
+DOF applet
+<br>Originially written by Silicon Graphics
+<br>Ported to Java by Ron Cemer
+<br>
+<!--"CONVERTED_APPLET"-->
+<!-- CONVERTER VERSION 1.3 --> +<SCRIPT LANGUAGE="JavaScript"><!-- + var _info = navigator.userAgent; var _ns = false; + var _ie = (_info.indexOf("MSIE") > 0 && _info.indexOf("Win") > 0 && _info.indexOf("Windows 3.1") < 0); +//--></SCRIPT> +<COMMENT><SCRIPT LANGUAGE="JavaScript1.1"><!-- + var _ns = (navigator.appName.indexOf("Netscape") >= 0 && ((_info.indexOf("Win") > 0 && _info.indexOf("Win16") < 0 && java.lang.System.getProperty("os.version").indexOf("3.5") < 0) || (_info.indexOf("Sun") > 0) || (_info.indexOf("Linux") > 0))); +//--></SCRIPT></COMMENT> + +<SCRIPT LANGUAGE="JavaScript"><!-- + if (_ie == true) document.writeln('<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" WIDTH = 400 HEIGHT = 400 codebase="http://java.sun.com/products/plugin/1.3/jinstall-13-win32.cab#Version=1,3,0,0"><NOEMBED><XMP>'); + else if (_ns == true) document.writeln('<EMBED type="application/x-java-applet;version=1.3" CODE = "dof.class" WIDTH = 400 HEIGHT = 400 scriptable=false pluginspage="http://java.sun.com/products/plugin/1.3/plugin-install.html"><NOEMBED><XMP>'); +//--></SCRIPT> +<APPLET CODE = "dof.class" WIDTH = 400 HEIGHT = 400></XMP> +<PARAM NAME = CODE VALUE = "dof.class" >
+ +<PARAM NAME="type" VALUE="application/x-java-applet;version=1.3"> +<PARAM NAME="scriptable" VALUE="false"> + +</APPLET> + +</NOEMBED></EMBED></OBJECT> + + +<!-- +<APPLET CODE = "dof.class" WIDTH = 400 HEIGHT = 400>
+
+
+</APPLET> +--> +<!--"END_CONVERTED_APPLET"-->
+
+<hr>
+</body>
+</html>
diff --git a/demos/RonsDemos/fog.html b/demos/RonsDemos/fog.html new file mode 100644 index 0000000..b7684ab --- /dev/null +++ b/demos/RonsDemos/fog.html @@ -0,0 +1,18 @@ +<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.61 [en] (Win98; U) [Netscape]">
+ <title>Fog by Silicon Graphics; ported to Java by Ron Cemer</title>
+</head>
+<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#e6e6ff">
+Fog applet
+<br>Originially written by Silicon Graphics
+<br>Ported to Java by Ron Cemer
+<br>Click inside the window to cycle the fog mode.
+<br>
+<applet code="fog.class" width=400 height=400>
+</applet>
+<hr>
+</body>
+</html>
diff --git a/demos/RonsDemos/fog.java b/demos/RonsDemos/fog.java new file mode 100644 index 0000000..7f99c94 --- /dev/null +++ b/demos/RonsDemos/fog.java @@ -0,0 +1,266 @@ +/**
+ * @(#) fog.java
+ * @(#) author: Silicon Graphics (converted to Java by Ron Cemer)
+ */
+
+/*
+ * Copyright (c) 1993-1997, Silicon Graphics, Inc.
+ * ALL RIGHTS RESERVED
+ * Permission to use, copy, modify, and distribute this software for
+ * any purpose and without fee is hereby granted, provided that the above
+ * copyright notice appear in all copies and that both the copyright notice
+ * and this permission notice appear in supporting documentation, and that
+ * the name of Silicon Graphics, Inc. not be used in advertising
+ * or publicity pertaining to distribution of the software without specific,
+ * written prior permission.
+ *
+ * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
+ * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
+ * FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
+ * GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT,
+ * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY
+ * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION,
+ * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF
+ * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN
+ * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
+ * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * US Government Users Restricted Rights
+ * Use, duplication, or disclosure by the Government is subject to
+ * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
+ * (c)(1)(ii) of the Rights in Technical Data and Computer Software
+ * clause at DFARS 252.227-7013 and/or in similar or successor
+ * clauses in the FAR or the DOD or NASA FAR Supplement.
+ * Unpublished-- rights reserved under the copyright laws of the
+ * United States. Contractor/manufacturer is Silicon Graphics,
+ * Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311.
+ *
+ * OpenGL(R) is a registered trademark of Silicon Graphics, Inc.
+ */
+
+/*
+ * This program draws 5 red spheres, each at a different
+ * z distance from the eye, in different types of fog.
+ * Pressing the f key chooses between 3 types of
+ * fog: exponential, exponential squared, and linear.
+ * In this program, there is a fixed density value, as well
+ * as fixed start and end values for the linear fog.
+ */
+
+import java.applet.*;
+import java.awt.*;
+import java.awt.event.*;
+import java.lang.*;
+import java.util.*;
+import java.io.*;
+import java.util.*;
+import gl4java.GLContext;
+import gl4java.awt.GLCanvas;
+
+public class fog extends Applet
+{
+ fogCanvas canvas = null;
+
+
+ /* Initialize the applet */
+
+
+ public void init()
+ {
+ Dimension d = getSize();
+ setLayout(new BorderLayout());
+ canvas = new fogCanvas(d.width, d.height);
+ add("Center", canvas);
+ }
+
+
+ /* Start the applet */
+
+
+ public void start()
+ {
+ }
+
+
+ /* Stop the applet */
+
+
+ public void stop()
+ {
+ }
+
+
+ /* Destroy the applet */
+
+
+ public void destroy()
+ {
+ canvas.cvsDispose();
+ }
+
+
+ /* Local GLCanvas extension class */
+
+
+ private class fogCanvas extends GLCanvas implements MouseListener
+ {
+ int fogMode;
+
+ public fogCanvas(int w, int h)
+ {
+ super(w, h);
+ GLContext.gljNativeDebug = false;
+ GLContext.gljClassDebug = false;
+ }
+
+ public void preInit()
+ {
+ doubleBuffer = true;
+ stereoView = false;
+ }
+
+ public void init()
+ {
+ System.out.println("init(): " + this);
+ reshape(getSize().width, getSize().height);
+
+ float position[] = { 0.5f, 0.5f, 3.0f, 0.0f };
+
+ gl.glEnable(GL_DEPTH_TEST);
+
+ gl.glLightfv(GL_LIGHT0, GL_POSITION, position);
+ gl.glEnable(GL_LIGHTING);
+ gl.glEnable(GL_LIGHT0);
+
+ float mat[] = {0.1745f, 0.01175f, 0.01175f};
+ gl.glMaterialfv(GL_FRONT, GL_AMBIENT, mat);
+ mat[0] = 0.61424f; mat[1] = 0.04136f; mat[2] = 0.04136f;
+ gl.glMaterialfv(GL_FRONT, GL_DIFFUSE, mat);
+ mat[0] = 0.727811f; mat[1] = 0.626959f; mat[2] = 0.626959f;
+ gl.glMaterialfv(GL_FRONT, GL_SPECULAR, mat);
+ gl.glMaterialf(GL_FRONT, GL_SHININESS, 0.6f*128.0f);
+
+ gl.glEnable(GL_FOG);
+
+ float fogColor[] = {0.5f, 0.5f, 0.5f, 1.0f};
+ fogMode = GL_EXP;
+ gl.glFogi(GL_FOG_MODE, fogMode);
+ gl.glFogfv(GL_FOG_COLOR, fogColor);
+ gl.glFogf(GL_FOG_DENSITY, 0.35f);
+ gl.glHint(GL_FOG_HINT, GL_DONT_CARE);
+ gl.glFogf(GL_FOG_START, 1.0f);
+ gl.glFogf(GL_FOG_END, 5.0f);
+
+ gl.glClearColor(0.5f, 0.5f, 0.5f, 1.0f); /* fog color */
+
+ glj.gljCheckGL();
+
+ addMouseListener(this);
+ }
+
+ public void cvsDispose()
+ {
+ System.out.println("destroy(): " + this);
+ removeMouseListener(this);
+ super.cvsDispose();
+ }
+
+ public void reshape(int width, int height)
+ {
+ gl.glViewport(0,0,width,height);
+ gl.glMatrixMode(GL_PROJECTION);
+
+ gl.glLoadIdentity();
+ if (width <= height)
+ gl.glOrtho
+ (-2.5f,
+ 2.5f,
+ -2.5f*(float)height/(float)width,
+ 2.5f*(float)height/(float)width,
+ -10.0f,
+ 10.0f);
+ else
+ gl.glOrtho
+ (-2.5f*(float)width/(float)height,
+ 2.5f*(float)width/(float)height,
+ -2.5f,
+ 2.5f,
+ -10.0f,
+ 10.0f);
+ gl.glMatrixMode(GL_MODELVIEW);
+ gl.glLoadIdentity ();
+ }
+
+ public void display()
+ {
+ if (glj.gljMakeCurrent() == false) return;
+
+ gl.glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+ renderSphere(-2.0f, -0.5f, -1.0f);
+ renderSphere(-1.0f, -0.5f, -2.0f);
+ renderSphere(0.0f, -0.5f, -3.0f);
+ renderSphere(1.0f, -0.5f, -4.0f);
+ renderSphere(2.0f, -0.5f, -5.0f);
+ gl.glFlush();
+
+ glj.gljSwap();
+ glj.gljCheckGL();
+ glj.gljFree();
+ }
+
+ private void renderSphere(float x, float y, float z)
+ {
+ gl.glPushMatrix();
+ gl.glTranslatef(x, y, z);
+
+ int qobj = glu.gluNewQuadric();
+ glu.gluQuadricOrientation(qobj,GLU_OUTSIDE);
+ glu.gluQuadricNormals(qobj,GLU_SMOOTH);
+ glu.gluQuadricTexture(qobj,false);
+ glu.gluSphere(qobj,0.4f,16,16);
+ glu.gluDeleteQuadric(qobj);
+
+ gl.glPopMatrix();
+ }
+
+ // Methods required for the implementation of MouseListener
+ public void mouseEntered( MouseEvent evt )
+ {
+ }
+
+ public void mouseExited( MouseEvent evt )
+ {
+ }
+
+ public void mousePressed( MouseEvent evt )
+ {
+ if (fogMode == GL_EXP)
+ {
+ fogMode = GL_EXP2;
+ System.out.println("Fog mode is GL_EXP2");
+ }
+ else if (fogMode == GL_EXP2)
+ {
+ fogMode = GL_LINEAR;
+ System.out.println("Fog mode is GL_LINEAR");
+ }
+ else
+ {
+ fogMode = GL_EXP;
+ System.out.println("Fog mode is GL_EXP");
+ }
+ gl.glFogi(GL_FOG_MODE,fogMode);
+ repaint();
+ }
+
+ public void mouseReleased( MouseEvent evt )
+ {
+ }
+
+ public void mouseClicked( MouseEvent evt )
+ {
+ }
+ }
+}
diff --git a/demos/RonsDemos/fog_plugin13.html b/demos/RonsDemos/fog_plugin13.html new file mode 100644 index 0000000..94f367d --- /dev/null +++ b/demos/RonsDemos/fog_plugin13.html @@ -0,0 +1,49 @@ +<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.61 [en] (Win98; U) [Netscape]">
+ <title>Fog by Silicon Graphics; ported to Java by Ron Cemer</title>
+</head>
+<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#e6e6ff">
+Fog applet
+<br>Originially written by Silicon Graphics
+<br>Ported to Java by Ron Cemer
+<br>Click inside the window to cycle the fog mode.
+<br>
+<!--"CONVERTED_APPLET"-->
+<!-- CONVERTER VERSION 1.3 --> +<SCRIPT LANGUAGE="JavaScript"><!-- + var _info = navigator.userAgent; var _ns = false; + var _ie = (_info.indexOf("MSIE") > 0 && _info.indexOf("Win") > 0 && _info.indexOf("Windows 3.1") < 0); +//--></SCRIPT> +<COMMENT><SCRIPT LANGUAGE="JavaScript1.1"><!-- + var _ns = (navigator.appName.indexOf("Netscape") >= 0 && ((_info.indexOf("Win") > 0 && _info.indexOf("Win16") < 0 && java.lang.System.getProperty("os.version").indexOf("3.5") < 0) || (_info.indexOf("Sun") > 0) || (_info.indexOf("Linux") > 0))); +//--></SCRIPT></COMMENT> + +<SCRIPT LANGUAGE="JavaScript"><!-- + if (_ie == true) document.writeln('<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" WIDTH = 400 HEIGHT = 400 codebase="http://java.sun.com/products/plugin/1.3/jinstall-13-win32.cab#Version=1,3,0,0"><NOEMBED><XMP>'); + else if (_ns == true) document.writeln('<EMBED type="application/x-java-applet;version=1.3" CODE = "fog.class" WIDTH = 400 HEIGHT = 400 scriptable=false pluginspage="http://java.sun.com/products/plugin/1.3/plugin-install.html"><NOEMBED><XMP>'); +//--></SCRIPT> +<APPLET CODE = "fog.class" WIDTH = 400 HEIGHT = 400></XMP> +<PARAM NAME = CODE VALUE = "fog.class" >
+ +<PARAM NAME="type" VALUE="application/x-java-applet;version=1.3"> +<PARAM NAME="scriptable" VALUE="false"> + +</APPLET> + +</NOEMBED></EMBED></OBJECT> + + +<!-- +<APPLET CODE = "fog.class" WIDTH = 400 HEIGHT = 400>
+
+
+</APPLET> +--> +<!--"END_CONVERTED_APPLET"-->
+
+<hr>
+</body>
+</html>
diff --git a/demos/RonsDemos/gears.html b/demos/RonsDemos/gears.html new file mode 100644 index 0000000..fb44ddb --- /dev/null +++ b/demos/RonsDemos/gears.html @@ -0,0 +1,23 @@ +<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.61 [en] (Win98; U) [Netscape]">
+ <title>Gears by Brian Paul; ported to Java by Ron Cemer</title>
+</head>
+<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#e6e6ff">
+Gears applet
+<br>Originially written by Brian Paul
+<br>Ported to Java by Ron Cemer
+<br>
+<hr>
+<br>You can rotate the view by holding the left mouse button down and
+<br>dragging the mouse within the applet's window.
+<br>If you hold the right button down instead, the view will rotate
+<br>around the Z axis.
+<br>
+<applet code="gears.class" width=400 height=400>
+</applet>
+<hr>
+</body>
+</html>
diff --git a/demos/RonsDemos/gears.java b/demos/RonsDemos/gears.java new file mode 100644 index 0000000..cdc1634 --- /dev/null +++ b/demos/RonsDemos/gears.java @@ -0,0 +1,432 @@ +/**
+ * @(#) gears.java
+ * @(#) author: Brian Paul (converted to Java by Ron Cemer)
+ */
+
+import java.applet.*;
+import java.awt.*;
+import java.awt.event.*;
+import java.lang.*;
+import java.util.*;
+import java.io.*;
+import java.util.*;
+import gl4java.GLContext;
+import gl4java.awt.GLAnimCanvas;
+import gl4java.applet.SimpleGLAnimApplet1;
+
+public class gears extends SimpleGLAnimApplet1
+{
+
+ /* Initialize the applet */
+
+
+ public void init()
+ {
+ super.init();
+ Dimension d = getSize();
+ canvas = new gearsCanvas(d.width, d.height);
+ add("Center", canvas);
+ }
+
+
+ public static void main( String args[] )
+ {
+ Frame mainFrame = new Frame("gears");
+
+ gears applet = new gears();
+
+ applet.setSize(400, 400);
+ applet.init();
+ applet.start();
+
+ mainFrame.add(applet);
+
+ mainFrame.pack();
+ mainFrame.setVisible(true);
+ }
+
+
+ /* Local GLAnimCanvas extension class */
+
+
+ private class gearsCanvas extends GLAnimCanvas implements MouseListener, MouseMotionListener
+ {
+ private static final float M_PI = 3.14159265359f;
+ private int gear1, gear2, gear3;
+ private float angle = 0.0f;
+
+ private MatrixFuncs mtxfuncs = null;
+ private int prevMouseX, prevMouseY;
+ private boolean mouseRButtonDown = false;
+ private float rot_matrix[] =
+ {
+ 1.0f, 0.0f, 0.0f, 0.0f,
+ 0.0f, 1.0f, 0.0f, 0.0f,
+ 0.0f, 0.0f, 1.0f, 0.0f,
+ 0.0f, 0.0f, 0.0f, 1.0f
+ };
+
+ public gearsCanvas(int w, int h)
+ {
+ super(w, h);
+ GLContext.gljNativeDebug = false;
+ GLContext.gljClassDebug = false;
+ setAnimateFps(30.0);
+
+ mtxfuncs = new MatrixFuncs();
+ }
+
+ public void preInit()
+ {
+ doubleBuffer = true;
+ stereoView = false;
+ }
+
+ public void init()
+ {
+ System.out.println("init(): " + this);
+ reshape(getSize().width, getSize().height);
+
+ setInitialRotation();
+
+ float pos[] = { 5.0f, 5.0f, 10.0f, 0.0f };
+ float red[] = { 0.8f, 0.1f, 0.0f, 1.0f };
+ float green[] = { 0.0f, 0.8f, 0.2f, 1.0f };
+ float blue[] = { 0.2f, 0.2f, 1.0f, 1.0f };
+
+ gl.glLightfv(GL_LIGHT0, GL_POSITION, pos);
+ gl.glEnable(GL_CULL_FACE);
+ gl.glEnable(GL_LIGHTING);
+ gl.glEnable(GL_LIGHT0);
+ gl.glEnable(GL_DEPTH_TEST);
+
+ /* make the gears */
+ gear1 = gl.glGenLists(1);
+ gl.glNewList(gear1, GL_COMPILE);
+ gl.glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, red);
+ gear(1.0f, 4.0f, 1.0f, 20, 0.7f);
+ gl.glEndList();
+
+ gear2 = gl.glGenLists(1);
+ gl.glNewList(gear2, GL_COMPILE);
+ gl.glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, green);
+ gear(0.5f, 2.0f, 2.0f, 10, 0.7f);
+ gl.glEndList();
+
+ gear3 = gl.glGenLists(1);
+ gl.glNewList(gear3, GL_COMPILE);
+ gl.glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, blue);
+ gear(1.3f, 2.0f, 0.5f, 10, 0.7f);
+ gl.glEndList();
+
+ gl.glEnable(GL_NORMALIZE);
+
+ glj.gljCheckGL();
+
+ addMouseListener(this);
+ addMouseMotionListener(this);
+ }
+
+ public void doCleanup()
+ {
+ System.out.println("destroy(): " + this);
+ removeMouseListener(this);
+ removeMouseMotionListener(this);
+ }
+
+ public void reshape(int width, int height)
+ {
+ float h = (float)height / (float)width;
+
+ gl.glViewport(0,0,width,height);
+ gl.glMatrixMode(GL_PROJECTION);
+ gl.glLoadIdentity();
+ gl.glFrustum(-1.0f, 1.0f, -h, h, 5.0f, 60.0f);
+ gl.glMatrixMode(GL_MODELVIEW);
+ gl.glLoadIdentity();
+ gl.glTranslatef(0.0f, 0.0f, -40.0f);
+ }
+
+ public void display()
+ {
+ if (glj.gljMakeCurrent() == false) return;
+
+ angle += 0.5f;
+
+ gl.glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+ gl.glPushMatrix();
+ gl.glMultMatrixf(rot_matrix);
+
+ gl.glPushMatrix();
+ gl.glTranslatef(-3.0f, -2.0f, 0.0f);
+ gl.glRotatef(angle, 0.0f, 0.0f, 1.0f);
+ gl.glCallList(gear1);
+ gl.glPopMatrix();
+
+ gl.glPushMatrix();
+ gl.glTranslatef(3.1f, -2.0f, 0.0f);
+ gl.glRotatef(-2.0f * angle - 9.0f, 0.0f, 0.0f, 1.0f);
+ gl.glCallList(gear2);
+ gl.glPopMatrix();
+
+ gl.glPushMatrix();
+ gl.glTranslatef(-3.1f, 4.2f, 0.0f);
+ gl.glRotatef(-2.0f * angle - 25.0f, 0.0f, 0.0f, 1.0f);
+ gl.glCallList(gear3);
+ gl.glPopMatrix();
+
+ gl.glPopMatrix();
+
+ glj.gljSwap();
+ glj.gljCheckGL();
+ glj.gljFree();
+
+ //if (!isSuspended()) repaint(); // Animate at full speed.
+ }
+
+ private void gear
+ (float inner_radius,
+ float outer_radius,
+ float width,
+ int teeth,
+ float tooth_depth)
+ {
+ int i;
+ float r0, r1, r2;
+ float angle, da;
+ float u, v, len;
+
+ r0 = inner_radius;
+ r1 = outer_radius - tooth_depth / 2.0f;
+ r2 = outer_radius + tooth_depth / 2.0f;
+
+ da = 2.0f * M_PI / teeth / 4.0f;
+
+ gl.glShadeModel(GL_FLAT);
+
+ gl.glNormal3f(0.0f, 0.0f, 1.0f);
+
+ /* draw front face */
+ gl.glBegin(GL_QUAD_STRIP);
+ for (i = 0; i <= teeth; i++)
+ {
+ angle = i * 2.0f * M_PI / teeth;
+ gl.glVertex3f(r0 * (float)Math.cos(angle), r0 * (float)Math.sin(angle), width * 0.5f);
+ gl.glVertex3f(r1 * (float)Math.cos(angle), r1 * (float)Math.sin(angle), width * 0.5f);
+ gl.glVertex3f(r0 * (float)Math.cos(angle), r0 * (float)Math.sin(angle), width * 0.5f);
+ gl.glVertex3f(r1 * (float)Math.cos(angle + 3.0f * da), r1 * (float)Math.sin(angle + 3.0f * da), width * 0.5f);
+ }
+ gl.glEnd();
+
+ /* draw front sides of teeth */
+ gl.glBegin(GL_QUADS);
+ da = 2.0f * M_PI / teeth / 4.0f;
+ for (i = 0; i < teeth; i++)
+ {
+ angle = i * 2.0f * M_PI / teeth;
+ gl.glVertex3f(r1 * (float)Math.cos(angle), r1 * (float)Math.sin(angle), width * 0.5f);
+ gl.glVertex3f(r2 * (float)Math.cos(angle + da), r2 * (float)Math.sin(angle + da), width * 0.5f);
+ gl.glVertex3f(r2 * (float)Math.cos(angle + 2.0f * da), r2 * (float)Math.sin(angle + 2.0f * da), width * 0.5f);
+ gl.glVertex3f(r1 * (float)Math.cos(angle + 3.0f * da), r1 * (float)Math.sin(angle + 3.0f * da), width * 0.5f);
+ }
+ gl.glEnd();
+
+ gl.glNormal3f(0.0f, 0.0f, -1.0f);
+
+ /* draw back face */
+ gl.glBegin(GL_QUAD_STRIP);
+ for (i = 0; i <= teeth; i++)
+ {
+ angle = i * 2.0f * M_PI / teeth;
+ gl.glVertex3f(r1 * (float)Math.cos(angle), r1 * (float)Math.sin(angle), -width * 0.5f);
+ gl.glVertex3f(r0 * (float)Math.cos(angle), r0 * (float)Math.sin(angle), -width * 0.5f);
+ gl.glVertex3f(r1 * (float)Math.cos(angle + 3 * da), r1 * (float)Math.sin(angle + 3 * da), -width * 0.5f);
+ gl.glVertex3f(r0 * (float)Math.cos(angle), r0 * (float)Math.sin(angle), -width * 0.5f);
+ }
+ gl.glEnd();
+
+ /* draw back sides of teeth */
+ gl.glBegin(GL_QUADS);
+ da = 2.0f * M_PI / teeth / 4.0f;
+ for (i = 0; i < teeth; i++)
+ {
+ angle = i * 2.0f * M_PI / teeth;
+ gl.glVertex3f(r1 * (float)Math.cos(angle + 3 * da), r1 * (float)Math.sin(angle + 3 * da), -width * 0.5f);
+ gl.glVertex3f(r2 * (float)Math.cos(angle + 2 * da), r2 * (float)Math.sin(angle + 2 * da), -width * 0.5f);
+ gl.glVertex3f(r2 * (float)Math.cos(angle + da), r2 * (float)Math.sin(angle + da), -width * 0.5f);
+ gl.glVertex3f(r1 * (float)Math.cos(angle), r1 * (float)Math.sin(angle), -width * 0.5f);
+ }
+ gl.glEnd();
+
+ /* draw outward faces of teeth */
+ gl.glBegin(GL_QUAD_STRIP);
+ for (i = 0; i < teeth; i++)
+ {
+ angle = i * 2.0f * M_PI / teeth;
+ gl.glVertex3f(r1 * (float)Math.cos(angle), r1 * (float)Math.sin(angle), width * 0.5f);
+ gl.glVertex3f(r1 * (float)Math.cos(angle), r1 * (float)Math.sin(angle), -width * 0.5f);
+ u = r2 * (float)Math.cos(angle + da) - r1 * (float)Math.cos(angle);
+ v = r2 * (float)Math.sin(angle + da) - r1 * (float)Math.sin(angle);
+ len = (float)Math.sqrt(u * u + v * v);
+ u /= len;
+ v /= len;
+ gl.glNormal3f(v, -u, 0.0f);
+ gl.glVertex3f(r2 * (float)Math.cos(angle + da), r2 * (float)Math.sin(angle + da), width * 0.5f);
+ gl.glVertex3f(r2 * (float)Math.cos(angle + da), r2 * (float)Math.sin(angle + da), -width * 0.5f);
+ gl.glNormal3f((float)Math.cos(angle), (float)Math.sin(angle), 0.0f);
+ gl.glVertex3f(r2 * (float)Math.cos(angle + 2 * da), r2 * (float)Math.sin(angle + 2 * da), width * 0.5f);
+ gl.glVertex3f(r2 * (float)Math.cos(angle + 2 * da), r2 * (float)Math.sin(angle + 2 * da), -width * 0.5f);
+ u = r1 * (float)Math.cos(angle + 3 * da) - r2 * (float)Math.cos(angle + 2 * da);
+ v = r1 * (float)Math.sin(angle + 3 * da) - r2 * (float)Math.sin(angle + 2 * da);
+ gl.glNormal3f(v, -u, 0.0f);
+ gl.glVertex3f(r1 * (float)Math.cos(angle + 3 * da), r1 * (float)Math.sin(angle + 3 * da), width * 0.5f);
+ gl.glVertex3f(r1 * (float)Math.cos(angle + 3 * da), r1 * (float)Math.sin(angle + 3 * da), -width * 0.5f);
+ gl.glNormal3f((float)Math.cos(angle), (float)Math.sin(angle), 0.0f);
+ }
+ gl.glVertex3f(r1 * (float)Math.cos(0), r1 * (float)Math.sin(0), width * 0.5f);
+ gl.glVertex3f(r1 * (float)Math.cos(0), r1 * (float)Math.sin(0), -width * 0.5f);
+ gl.glEnd();
+
+ gl.glShadeModel(GL_SMOOTH);
+
+ /* draw inside radius cylinder */
+ gl.glBegin(GL_QUAD_STRIP);
+ for (i = 0; i <= teeth; i++)
+ {
+ angle = i * 2.0f * M_PI / teeth;
+ gl.glNormal3f(-(float)Math.cos(angle), -(float)Math.sin(angle), 0.0f);
+ gl.glVertex3f(r0 * (float)Math.cos(angle), r0 * (float)Math.sin(angle), -width * 0.5f);
+ gl.glVertex3f(r0 * (float)Math.cos(angle), r0 * (float)Math.sin(angle), width * 0.5f);
+ }
+ gl.glEnd();
+ }
+
+ // Reset the rotation matrix to the default view.
+ private void setInitialRotation()
+ {
+ float mtxbuf[] = new float[16];
+ float mtxbuf2[] = new float[16];
+
+ mtxfuncs.rotateAroundY(30.0f,mtxbuf);
+ mtxfuncs.rotateAroundX(20.0f,mtxbuf2);
+ mtxfuncs.multiplyMatrices(mtxbuf2,mtxbuf,rot_matrix);
+ fixRotationMatrix();
+ }
+
+ private void fixRotationMatrix()
+ {
+ // Fix any problems with the rotation matrix.
+ rot_matrix[3] =
+ rot_matrix[7] =
+ rot_matrix[11] =
+ rot_matrix[12] =
+ rot_matrix[13] =
+ rot_matrix[14] = 0.0f;
+ rot_matrix[15] = 1.0f;
+ float fac;
+ if ((fac = (float)Math.sqrt
+ ((rot_matrix[0]*rot_matrix[0]) +
+ (rot_matrix[4]*rot_matrix[4]) +
+ (rot_matrix[8]*rot_matrix[8]))) != 1.0f)
+ {
+ if (fac != 0.0f)
+ {
+ fac = 1.0f/fac;
+ rot_matrix[0] *= fac;
+ rot_matrix[4] *= fac;
+ rot_matrix[8] *= fac;
+ }
+ }
+ if ((fac = (float)Math.sqrt
+ ((rot_matrix[1]*rot_matrix[1]) +
+ (rot_matrix[5]*rot_matrix[5]) +
+ (rot_matrix[9]*rot_matrix[9]))) != 1.0f)
+ {
+ if (fac != 0.0f)
+ {
+ fac = 1.0f/fac;
+ rot_matrix[1] *= fac;
+ rot_matrix[5] *= fac;
+ rot_matrix[9] *= fac;
+ }
+ }
+ if ((fac = (float)Math.sqrt
+ ((rot_matrix[2]*rot_matrix[2]) +
+ (rot_matrix[6]*rot_matrix[6]) +
+ (rot_matrix[10]*rot_matrix[10]))) != 1.0f)
+ {
+ if (fac != 0.0f)
+ {
+ fac = 1.0f/fac;
+ rot_matrix[2] *= fac;
+ rot_matrix[6] *= fac;
+ rot_matrix[10] *= fac;
+ }
+ }
+ }
+
+ // Methods required for the implementation of MouseListener
+ public void mouseEntered( MouseEvent evt )
+ {
+ }
+
+ public void mouseExited( MouseEvent evt )
+ {
+ }
+
+ public void mousePressed( MouseEvent evt )
+ {
+ prevMouseX = evt.getX();
+ prevMouseY = evt.getY();
+ if ((evt.getModifiers() & evt.BUTTON3_MASK) != 0)
+ {
+ mouseRButtonDown = true;
+ evt.consume();
+ }
+ }
+
+ public void mouseReleased( MouseEvent evt )
+ {
+ if ((evt.getModifiers() & evt.BUTTON3_MASK) != 0)
+ {
+ mouseRButtonDown = false;
+ evt.consume();
+ }
+ }
+
+ public void mouseClicked( MouseEvent evt )
+ {
+ }
+
+ // Methods required for the implementation of MouseMotionListener
+ public void mouseDragged( MouseEvent evt )
+ {
+ int x = evt.getX();
+ int y = evt.getY();
+ float thetaX = (float)(x-prevMouseX)*(360.0f/(float)getSize().width);
+ float thetaY = (float)(prevMouseY-y)*(360.0f/(float)getSize().height);
+ float mtxbuf[] = new float[16];
+ float mtxbuf2[] = new float[16];
+
+ prevMouseX = x;
+ prevMouseY = y;
+ if ( (thetaX != 0.0f) || (thetaY != 0.0f) )
+ {
+ mtxfuncs.rotateAroundY(((float)thetaX),mtxbuf);
+ if (mouseRButtonDown)
+ mtxfuncs.rotateAroundZ(thetaY,mtxbuf2);
+ else
+ mtxfuncs.rotateAroundX(-thetaY,mtxbuf2);
+ mtxfuncs.multiplyMatrices(mtxbuf2,mtxbuf,mtxbuf);
+ mtxfuncs.multiplyMatrices(rot_matrix,mtxbuf,rot_matrix);
+ fixRotationMatrix();
+ }
+ evt.consume();
+ }
+
+ public void mouseMoved( MouseEvent evt )
+ {
+ }
+ }
+}
diff --git a/demos/RonsDemos/gears_plugin13.html b/demos/RonsDemos/gears_plugin13.html new file mode 100644 index 0000000..2069b32 --- /dev/null +++ b/demos/RonsDemos/gears_plugin13.html @@ -0,0 +1,54 @@ +<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.61 [en] (Win98; U) [Netscape]">
+ <title>Gears by Brian Paul; ported to Java by Ron Cemer</title>
+</head>
+<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#e6e6ff">
+Gears applet
+<br>Originially written by Brian Paul
+<br>Ported to Java by Ron Cemer
+<br>
+<hr>
+<br>You can rotate the view by holding the left mouse button down and
+<br>dragging the mouse within the applet's window.
+<br>If you hold the right button down instead, the view will rotate
+<br>around the Z axis.
+<br>
+<!--"CONVERTED_APPLET"-->
+<!-- CONVERTER VERSION 1.3 --> +<SCRIPT LANGUAGE="JavaScript"><!-- + var _info = navigator.userAgent; var _ns = false; + var _ie = (_info.indexOf("MSIE") > 0 && _info.indexOf("Win") > 0 && _info.indexOf("Windows 3.1") < 0); +//--></SCRIPT> +<COMMENT><SCRIPT LANGUAGE="JavaScript1.1"><!-- + var _ns = (navigator.appName.indexOf("Netscape") >= 0 && ((_info.indexOf("Win") > 0 && _info.indexOf("Win16") < 0 && java.lang.System.getProperty("os.version").indexOf("3.5") < 0) || (_info.indexOf("Sun") > 0) || (_info.indexOf("Linux") > 0))); +//--></SCRIPT></COMMENT> + +<SCRIPT LANGUAGE="JavaScript"><!-- + if (_ie == true) document.writeln('<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" WIDTH = 400 HEIGHT = 400 codebase="http://java.sun.com/products/plugin/1.3/jinstall-13-win32.cab#Version=1,3,0,0"><NOEMBED><XMP>'); + else if (_ns == true) document.writeln('<EMBED type="application/x-java-applet;version=1.3" CODE = "gears.class" WIDTH = 400 HEIGHT = 400 scriptable=false pluginspage="http://java.sun.com/products/plugin/1.3/plugin-install.html"><NOEMBED><XMP>'); +//--></SCRIPT> +<APPLET CODE = "gears.class" WIDTH = 400 HEIGHT = 400></XMP> +<PARAM NAME = CODE VALUE = "gears.class" >
+ +<PARAM NAME="type" VALUE="application/x-java-applet;version=1.3"> +<PARAM NAME="scriptable" VALUE="false"> + +</APPLET> + +</NOEMBED></EMBED></OBJECT> + + +<!-- +<APPLET CODE = "gears.class" WIDTH = 400 HEIGHT = 400>
+
+
+</APPLET> +--> +<!--"END_CONVERTED_APPLET"-->
+
+<hr>
+</body>
+</html>
diff --git a/demos/RonsDemos/gl4java.policy b/demos/RonsDemos/gl4java.policy new file mode 100644 index 0000000..6ea44cc --- /dev/null +++ b/demos/RonsDemos/gl4java.policy @@ -0,0 +1,27 @@ +
+grant codeBase "http://www.jausoft.com/Files/Java/1.1.X/GL4Java/demos/-"
+{
+ permission java.security.RuntimePermission;
+};
+
+grant codeBase "http://www.jausoft.com/Files/Java/1.1.X/GL4Java/demos/RonsDemos/-"
+{
+ permission java.security.RuntimePermission;
+};
+
+grant codeBase "http://jausoft.goethel.de/Files/Java/1.1.X/GL4Java/demos/RonsDemos/-" {
+ permission java.security.RuntimePermission;
+};
+
+grant codeBase "http://jausoft.goethel.de/Files/Java/1.1.X/GL4Java/demos/-" {
+ permission java.security.RuntimePermission;
+};
+
+grant codeBase "file://f/java-1.1.X/GL4Java/demos/-" {
+ permission java.security.AllPermission;
+};
+
+grant codeBase "file://f/java-1.1.X/GL4Java/demos/RonsDemos/-" {
+ permission java.security.AllPermission;
+};
+
diff --git a/demos/RonsDemos/glutplane.html b/demos/RonsDemos/glutplane.html new file mode 100644 index 0000000..3e7760d --- /dev/null +++ b/demos/RonsDemos/glutplane.html @@ -0,0 +1,19 @@ +<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.61 [en] (Win98; U) [Netscape]">
+ <title>Glutplane by Mark J. Kilgard; ported to Java by Ron Cemer</title>
+</head>
+<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#e6e6ff">
+Glutplane applet
+<br>Originially written by Mark J. Kilgard
+<br>Ported to Java by Ron Cemer
+<br>Right-click within the window for a menu of commands.
+<br>While suspended, left-click within the window to render the next frame.
+<br>
+<applet code="glutplane.class" width=400 height=400>
+</applet>
+<hr>
+</body>
+</html>
diff --git a/demos/RonsDemos/glutplane.java b/demos/RonsDemos/glutplane.java new file mode 100644 index 0000000..c1e0e52 --- /dev/null +++ b/demos/RonsDemos/glutplane.java @@ -0,0 +1,334 @@ +/**
+ * @(#) glutplane.java
+ * @(#) author: Mark J. Kilgard (converted to Java by Ron Cemer)
+ */
+
+/* This program is freely distributable without licensing fees
+ and is provided without guarantee or warrantee expressed or
+ implied. This program is -not- in the public domain. */
+
+import java.applet.*;
+import java.awt.*;
+import java.awt.event.*;
+import java.lang.*;
+import java.util.*;
+import java.io.*;
+import java.util.*;
+import gl4java.GLContext;
+import gl4java.awt.GLAnimCanvas;
+import gl4java.applet.SimpleGLAnimApplet1;
+
+public class glutplane extends SimpleGLAnimApplet1
+{
+ /* Initialize the applet */
+
+
+ public void init()
+ {
+ super.init();
+ Dimension d = getSize();
+ canvas = new glutplaneCanvas(d.width, d.height);
+ add("Center", canvas);
+ }
+
+
+ private class planeobj
+ {
+ float speed = 0.0f; /* zero speed means not flying */
+ float red = 0.0f, green = 0.0f, blue = 0.0f;
+ float theta = 0.0f;
+ float x = 0.0f, y = 0.0f, z = 0.0f, angle = 0.0f;
+
+ public void setColor(float r, float g, float b)
+ {
+ red = r;
+ green = g;
+ blue = b;
+ }
+ };
+
+
+ /* Local GLAnimCanvas extension class */
+
+
+ private class glutplaneCanvas extends GLAnimCanvas
+ implements MouseListener, ActionListener
+ {
+ private final double M_PI = 3.14159265;
+ private final double M_PI_2 = 1.57079632;
+ private final int MAX_PLANES = 15;
+ private final String ADD_PLANE = "Add plane";
+ private final String REMOVE_PLANE = "Remove plane";
+ private final String SUSPEND_RESUME = "Suspend/resume animation";
+
+ private planeobj planes[] = null;
+ private Random random = null;
+ private PopupMenu menu = null;
+ private boolean menu_showing = false;
+ private boolean save_suspended = false;
+
+ public glutplaneCanvas(int w, int h)
+ {
+ super(w, h);
+ GLContext.gljNativeDebug = false;
+ GLContext.gljClassDebug = false;
+ setAnimateFps(30.0);
+ }
+
+ public void preInit()
+ {
+ doubleBuffer = true;
+ stereoView = false;
+ }
+
+ public void init()
+ {
+ System.out.println("init(): " + this);
+ reshape(getSize().width, getSize().height);
+
+ gl.glClearDepth(1.0f);
+ gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
+ gl.glMatrixMode(GL_PROJECTION);
+ gl.glFrustum(-1.0f, 1.0f, -1.0f, 1.0f, 1.0f, 20.0f);
+ gl.glMatrixMode(GL_MODELVIEW);
+ /* add three initial random planes */
+ planes = new planeobj[MAX_PLANES];
+ for (int i = 0; i < MAX_PLANES; i++)
+ planes[i] = new planeobj();
+ random = new Random(System.currentTimeMillis());
+ add_plane();
+ add_plane();
+ add_plane();
+
+ glj.gljCheckGL();
+
+ menu = new PopupMenu("Options");
+ menu.add(ADD_PLANE);
+ menu.add(REMOVE_PLANE);
+ menu.add(SUSPEND_RESUME);
+ menu.addActionListener(this);
+ add(menu);
+
+ addMouseListener(this);
+ }
+
+ public void doCleanup()
+ {
+ System.out.println("destroy(): " + this);
+ removeMouseListener(this);
+ menu.removeActionListener(this);
+ }
+
+ public void reshape(int width, int height)
+ {
+ gl.glViewport(0,0,width,height);
+ }
+
+ public void display()
+ {
+ if (glj.gljMakeCurrent() == false) return;
+
+ tick();
+
+ float red, green, blue;
+
+ gl.glClear(GL_DEPTH_BUFFER_BIT);
+ /* paint black to blue smooth shaded polygon for background */
+ gl.glDisable(GL_DEPTH_TEST);
+ gl.glShadeModel(GL_SMOOTH);
+ gl.glBegin(GL_POLYGON);
+ gl.glColor3f(0.0f, 0.0f, 0.0f);
+ gl.glVertex3f(-20f, 20f, -19f);
+ gl.glVertex3f(20f, 20f, -19f);
+ gl.glColor3f(0.0f, 0.0f, 1.0f);
+ gl.glVertex3f(20f, -20f, -19f);
+ gl.glVertex3f(-20f, -20f, -19f);
+ gl.glEnd();
+ /* paint planes */
+ gl.glEnable(GL_DEPTH_TEST);
+ gl.glShadeModel(GL_FLAT);
+ for (int i = 0; i < MAX_PLANES; i++)
+ {
+ if (planes[i].speed != 0.0f)
+ {
+ gl.glPushMatrix();
+ gl.glTranslatef(planes[i].x, planes[i].y, planes[i].z);
+ gl.glRotatef(290.0f, 1.0f, 0.0f, 0.0f);
+ gl.glRotatef(planes[i].angle, 0.0f, 0.0f, 1.0f);
+ gl.glScalef(1.0f / 3.0f, 1.0f / 4.0f, 1.0f / 4.0f);
+ gl.glTranslatef(0.0f, -4.0f, -1.5f);
+ gl.glBegin(GL_TRIANGLE_STRIP);
+ /* left wing */
+ gl.glVertex3f(-7.0f, 0.0f, 2.0f);
+ gl.glVertex3f(-1.0f, 0.0f, 3.0f);
+ red = planes[i].red;
+ green = planes[i].green;
+ blue = planes[i].blue;
+ gl.glColor3f(red,green,blue);
+ gl.glVertex3f(-1.0f, 7.0f, 3.0f);
+ /* left side */
+ gl.glColor3f(0.6f * red, 0.6f * green, 0.6f * blue);
+ gl.glVertex3f(0.0f, 0.0f, 0.0f);
+ gl.glVertex3f(0.0f, 8.0f, 0.0f);
+ /* right side */
+ gl.glVertex3f(1.0f, 0.0f, 3.0f);
+ gl.glVertex3f(1.0f, 7.0f, 3.0f);
+ /* final tip of right wing */
+ gl.glColor3f(red, green, blue);
+ gl.glVertex3f(7.0f, 0.0f, 2.0f);
+ gl.glEnd();
+ gl.glPopMatrix();
+ }
+ }
+
+ glj.gljSwap();
+ glj.gljCheckGL();
+ glj.gljFree();
+
+ // if (!isSuspended()) repaint(); // Animate at full speed.
+ }
+
+ // Methods required for the implementation of MouseListener
+ public void mouseEntered(MouseEvent evt)
+ {
+ }
+
+ public void mouseExited(MouseEvent evt)
+ {
+ }
+
+ public void mousePressed(MouseEvent evt)
+ {
+ // If user presses right mouse button within canvas area,
+ // suspend animation and pop up menu.
+ // If menu was already popped up and user presses either
+ // mouse button within canvas area, resume animation
+ // because the menu will have been removed automatically.
+ if (!menu_showing)
+ {
+ if ((evt.getModifiers() & evt.BUTTON3_MASK) != 0)
+ {
+ menu_showing = true;
+ save_suspended = isSuspended();
+ if (!save_suspended)
+ {
+ setSuspended(true);
+ repaint(100);
+ try
+ {
+ Thread.currentThread().sleep(200);
+ }
+ catch (Exception e)
+ { }
+ }
+ menu.show(this,evt.getX(),evt.getY());
+ }
+ else
+ {
+ // Must be left button.
+ if (isSuspended()) repaint();
+ }
+ }
+ else
+ {
+ menu_showing = false;
+ setSuspended(save_suspended);
+ }
+ }
+
+ public void mouseReleased(MouseEvent evt)
+ {
+ }
+
+ public void mouseClicked(MouseEvent evt)
+ {
+ }
+
+ // Method required for the implementation of ActionListener
+ public void actionPerformed(ActionEvent evt)
+ {
+ String c = evt.getActionCommand();
+ if (c.equals(ADD_PLANE))
+ {
+ add_plane();
+ }
+ else if (c.equals(REMOVE_PLANE))
+ {
+ remove_plane();
+ }
+ else if (c.equals(SUSPEND_RESUME))
+ {
+ if (menu_showing)
+ save_suspended = !save_suspended;
+ else
+ setSuspended(!isSuspended()); // not likely to happen
+ }
+ if (menu_showing)
+ {
+ menu_showing = false;
+ setSuspended(save_suspended);
+ }
+ }
+
+ private void tick_per_plane(int i)
+ {
+ float theta = planes[i].theta += planes[i].speed;
+ planes[i].z = -9.0f + 4.0f * (float)Math.cos(theta);
+ planes[i].x = 4 * (float)Math.sin(2.0f * theta);
+ planes[i].y = (float)Math.sin(theta / 3.4f) * 3.0f;
+ planes[i].angle = (float)
+ (((Math.atan(2.0) + M_PI_2) * Math.sin(theta) - M_PI_2) *
+ 180.0 / M_PI);
+ if (planes[i].speed < 0.0f) planes[i].angle += 180.0f;
+ }
+
+ private void add_plane()
+ {
+ for (int i = 0; i < MAX_PLANES; i++)
+ {
+ if (planes[i].speed == 0.0f)
+ {
+ int c = random.nextInt() & 0x07;
+ while (c == 0) c = random.nextInt() & 0x07;
+ float r = (float)((c >> 2) & 0x01);
+ float g = (float)((c >> 1) & 0x01);
+ float b = (float)(c & 0x01);
+ // Blue fades into the background; lighten it up.
+ if (c == 0x01) r = g = 0.4f;
+ planes[i].setColor(r,g,b);
+ planes[i].speed =
+ ((float)(random.nextInt() % 20)) * 0.001f + 0.02f;
+ if ((random.nextInt() & 0x01) != 0)
+ planes[i].speed *= -1.0f;
+ planes[i].theta =
+ ((float)(random.nextInt() % 257))*0.1111f;
+ tick_per_plane(i);
+ if (isSuspended()) repaint();
+ return;
+ }
+ }
+ }
+
+ private void remove_plane()
+ {
+ for (int i = MAX_PLANES - 1; i >= 0; i--)
+ {
+ if (planes[i].speed != 0.0f)
+ {
+ planes[i].speed = 0.0f;
+ if (isSuspended()) repaint();
+ return;
+ }
+ }
+ }
+
+ private void tick()
+ {
+ for (int i = 0; i < MAX_PLANES; i++)
+ {
+ if (planes[i].speed != 0.0f)
+ tick_per_plane(i);
+ }
+ }
+ }
+}
diff --git a/demos/RonsDemos/glutplane_plugin13.html b/demos/RonsDemos/glutplane_plugin13.html new file mode 100644 index 0000000..c0d6353 --- /dev/null +++ b/demos/RonsDemos/glutplane_plugin13.html @@ -0,0 +1,50 @@ +<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.61 [en] (Win98; U) [Netscape]">
+ <title>Glutplane by Mark J. Kilgard; ported to Java by Ron Cemer</title>
+</head>
+<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#e6e6ff">
+Glutplane applet
+<br>Originially written by Mark J. Kilgard
+<br>Ported to Java by Ron Cemer
+<br>Right-click within the window for a menu of commands.
+<br>While suspended, left-click within the window to render the next frame.
+<br>
+<!--"CONVERTED_APPLET"-->
+<!-- CONVERTER VERSION 1.3 --> +<SCRIPT LANGUAGE="JavaScript"><!-- + var _info = navigator.userAgent; var _ns = false; + var _ie = (_info.indexOf("MSIE") > 0 && _info.indexOf("Win") > 0 && _info.indexOf("Windows 3.1") < 0); +//--></SCRIPT> +<COMMENT><SCRIPT LANGUAGE="JavaScript1.1"><!-- + var _ns = (navigator.appName.indexOf("Netscape") >= 0 && ((_info.indexOf("Win") > 0 && _info.indexOf("Win16") < 0 && java.lang.System.getProperty("os.version").indexOf("3.5") < 0) || (_info.indexOf("Sun") > 0) || (_info.indexOf("Linux") > 0))); +//--></SCRIPT></COMMENT> + +<SCRIPT LANGUAGE="JavaScript"><!-- + if (_ie == true) document.writeln('<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" WIDTH = 400 HEIGHT = 400 codebase="http://java.sun.com/products/plugin/1.3/jinstall-13-win32.cab#Version=1,3,0,0"><NOEMBED><XMP>'); + else if (_ns == true) document.writeln('<EMBED type="application/x-java-applet;version=1.3" CODE = "glutplane.class" WIDTH = 400 HEIGHT = 400 scriptable=false pluginspage="http://java.sun.com/products/plugin/1.3/plugin-install.html"><NOEMBED><XMP>'); +//--></SCRIPT> +<APPLET CODE = "glutplane.class" WIDTH = 400 HEIGHT = 400></XMP> +<PARAM NAME = CODE VALUE = "glutplane.class" >
+ +<PARAM NAME="type" VALUE="application/x-java-applet;version=1.3"> +<PARAM NAME="scriptable" VALUE="false"> + +</APPLET> + +</NOEMBED></EMBED></OBJECT> + + +<!-- +<APPLET CODE = "glutplane.class" WIDTH = 400 HEIGHT = 400>
+
+
+</APPLET> +--> +<!--"END_CONVERTED_APPLET"-->
+
+<hr>
+</body>
+</html>
diff --git a/demos/RonsDemos/index.html b/demos/RonsDemos/index.html new file mode 100644 index 0000000..c3005c5 --- /dev/null +++ b/demos/RonsDemos/index.html @@ -0,0 +1,123 @@ +<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="Author" content="Ron Cemer & Sven Goethel">
+ <meta name="GENERATOR" content="Mozilla/4.61 [en] (Win98; U) [Netscape]">
+ <title>OpenGL Demos Ported to GL4Java</title>
+</head>
+<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#e6e6ff">
+<br>
+<p><a href="index_plugin13.html">To use the Java2 Plug-In (Java2, JRE, Plug-In 1.3), click here !</a><br>
+<br>
+!!! The original demos are ported by Ron Cemer !!! <br>
+<br>
+I have made some changes, which i described below !<br>
+<br>
+Many THANXS to Ron Cemer !!!!!!!!! <br>
+<br>
+Sven Goethel
+<hr>
+
+This page contains OpenGL demos, originally
+written in C, which have been ported to Java and
+<br>modified to use the GL4Java library.
+<p>Since the source code is readily available for these demos, they could
+serve as a great starting point
+<br>for aspiring Java applet programmers who may or may not have experience
+with OpenGL. You DO
+<br>need to know Java in order to understand what is going on. Additionally,
+I STRONGLY recommend
+<br>that you buy the "OpenGL Programmer's Guide" (often called the "Red
+Book") if you plan to do
+<br>OpenGL programming, whether for C, Java or any other language.
+<p>*** YOU MUST INSTALL THE GL4JAVA LIBRARIES BEFORE RUNNING THE DEMOS
+***
+<br>If you haven't installed the GL4Java libraries yet, go do that first,
+then come back here and enjoy!
+<p>Here are the demos:
+<p> <a href="renormal.html">Renormal, originally by Brian Paul</a>
+: a sphere that grows and shrinks; demonstrates how to use auto-normalization.
+<br> <a href="gears.html">Gears, originally by Brian Paul</a> : three
+animated gears; user can rotate the scene using the mouse.
+<br> <a href="texobj.html">Texobj, originally by Brian Paul</a> :
+two animated, texture-mapped squares.
+<br> <a href="reflect.html">Reflect, originally by Brian Paul</a>
+: rotating, textured, reflective platform with hovering objects.
+<br> <a href="star.html">Star, originally by Silicon Graphics</a>
+: particle animation of stars flying toward the viewer.
+<br> <a href="movelight.html">Movelight, originally by Silicon Graphics</a>
+: interactive directional lighting demonstration.
+<br> <a href="molehill.html">Molehill, author unknown</a>
+: shiny nurbs/evaluators example.
+<br> <a href="fog.html">Fog, originally by Silicon Graphics</a>
+: red spheres fading into a fog background.
+<br> <a href="surface.html">Surface, originally by Silicon Graphics</a>
+: NURBS surface demo.
+<br> <a href="moth.html">Moth, originally by Robert Doyle</a>
+: simulation of a moth flying around a light.
+<br> <a href="shadowvol.html">Shadowvol, originally by Tom McReynolds, SGI</a>
+: demonstrates the use of shadow volumes.
+<br> <a href="softshadow.html">Softshadow, originally by Tom McReynolds, SGI</a>
+: demonstrates use of the accumulation buffer for soft shadows.
+<br> <a href="material.html">Material, originally by Silicon Graphics</a>
+: demonstrates the use of the OpenGL lighting model and materials.
+<br> <a href="logo.html">Logo, author unknown</a>
+: 3D SGI logo with textures and user-adjustable rendering parameters.
+<br> <a href="glutplane.html">Glutplane, originally by Mark J. Kilgard</a>
+: Paper airplanes demo. Originally written for Mark J Kilgard's GL Utility Toolkit (GLUT).
+<br> <a href="spots.html">Spots, originally by Mark J. Kilgard</a>
+: Spot light demo.
+<br> <a href="rings.html">Rings, originally by Philip Winston</a>
+: Do a slow zoom on a bunch of rings (ala Superman III?).
+<br> <a href="steam.html">Steam, originally by Troy Robinette</a>
+: Miniature steam engine simulation.
+<br> <a href="dof.html">DOF, originally by Silicon Graphics</a>
+: Uses accumulation buffer to create an out-of-focus depth-of-field effect.
+<br> <a href="pointblast.html">Pointblast, originally by Mark J. Kilgard</a>
+: Particle animation demo.
+<br> <a href="quadric.html">Quadric, originally by Silicon Graphics</a>
+: Demonstrates the use of some of the gluQuadric* routines.
+<br> <a href="mipmap.html">Mipmap, originally by Silicon Graphics</a>
+: Demonstrates the use of mipmaps for texture maps.
+<br> <a href="teapots.html">Teapots, originally by Silicon Graphics</a>
+: Demonstrates lots of material properties.
+<br> <a href="texgen.html">Texgen, originally by Silicon Graphics</a>
+: Demonstrates the use of automatically generated texture coordinates.
+<br> <a href="polyoff.html">Polyoff, originally by Silicon Graphics</a>
+: Uses polygon offset to draw wireframe over shaded polygons without ugly "stitching" artifacts.
+<br> <a href="scube.html">Scube, originally by David G Yu/Mark J. Kilgard/Silicon Graphics</a>
+: Displays a spinning cube and its shadow.
+<br> <a href="particle.html">Particle, originally by Nate Robins</a>
+: An example of a simple particle system.
+<br> <a href="text3d.html">Text3d, originally by Robert J. Doyle, Jr.</a>
+: 3D animated text.
+<br> <a href="dinoshade.html">Dinoshade, originally by Mark J. Kilgard</a>
+: Combines texturing, reflections, and projected shadows.
+<br>
+<br>
+<br>
+<hr>
+I have only added a new Class, to support a simple <br>
+customizing feature to these Applets ! <br>
+<br>
+The new Class is called "gl4java.applet.SimpleGLAnimApplet1", <br>
+and it supports to customize the frame/secounds (fps) value <br>
+and the refresh technique - both for animations ! <br>
+This new Class is now part of the GL4Java distribution,
+but is added here for portability !<br>
+<br>
+I removed the endless refresh technique from Ron, <br>
+so that the more portable "repaint" technique is used as default. <br>
+You can switch this off, like the "fps-sleep" delay ... <br>
+But you should know, what you are doing, e.g. be sure to have a <br>
+native thread JVM (MS-IE, and unix JVM's runs well with it) ! <br>
+<br>
+I removed the cab-files, and the jar-files also, <br>
+because it looks too confusing and too overdriven for me. <br>
+If you use MS-IE 4.0, be sure to have the new <br>
+MS-JVM machine (build 3186) installed ! <br>
+<br>
+Sven Goethel
+</body>
+</html>
diff --git a/demos/RonsDemos/index_plugin13.html b/demos/RonsDemos/index_plugin13.html new file mode 100644 index 0000000..e2f5095 --- /dev/null +++ b/demos/RonsDemos/index_plugin13.html @@ -0,0 +1,124 @@ +<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="Author" content="Ron Cemer & Sven Goethel">
+ <meta name="GENERATOR" content="Mozilla/4.61 [en] (Win98; U) [Netscape]">
+ <title>OpenGL Demos Ported to GL4Java</title>
+</head>
+<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#e6e6ff">
+<br>
+<a href="../../Installer/java.policy">The Java2 (sdk, jre, plugin 1.3) policy file example to give GL4Java the necessary permissions (Click here) !</a>
+<br>
+<hr>
+!!! The original demos are ported by Ron Cemer !!! <br>
+<br>
+I have made some changes, which i described below !<br>
+<br>
+Many THANXS to Ron Cemer !!!!!!!!! <br>
+<br>
+Sven Goethel
+<hr>
+
+This page contains OpenGL demos, originally
+written in C, which have been ported to Java and
+<br>modified to use the GL4Java library.
+<p>Since the source code is readily available for these demos, they could
+serve as a great starting point
+<br>for aspiring Java applet programmers who may or may not have experience
+with OpenGL. You DO
+<br>need to know Java in order to understand what is going on. Additionally,
+I STRONGLY recommend
+<br>that you buy the "OpenGL Programmer's Guide" (often called the "Red
+Book") if you plan to do
+<br>OpenGL programming, whether for C, Java or any other language.
+<p>*** YOU MUST INSTALL THE GL4JAVA LIBRARIES BEFORE RUNNING THE DEMOS
+***
+<br>If you haven't installed the GL4Java libraries yet, go do that first,
+then come back here and enjoy!
+<p>Here are the demos:
+<p> <a href="renormal_plugin13.html">Renormal, originally by Brian Paul</a>
+: a sphere that grows and shrinks; demonstrates how to use auto-normalization.
+<br> <a href="gears_plugin13.html">Gears, originally by Brian Paul</a> : three
+animated gears; user can rotate the scene using the mouse.
+<br> <a href="texobj_plugin13.html">Texobj, originally by Brian Paul</a> :
+two animated, texture-mapped squares.
+<br> <a href="reflect_plugin13.html">Reflect, originally by Brian Paul</a>
+: rotating, textured, reflective platform with hovering objects.
+<br> <a href="star_plugin13.html">Star, originally by Silicon Graphics</a>
+: particle animation of stars flying toward the viewer.
+<br> <a href="movelight_plugin13.html">Movelight, originally by Silicon Graphics</a>
+: interactive directional lighting demonstration.
+<br> <a href="molehill_plugin13.html">Molehill, author unknown</a>
+: shiny nurbs/evaluators example.
+<br> <a href="fog_plugin13.html">Fog, originally by Silicon Graphics</a>
+: red spheres fading into a fog background.
+<br> <a href="surface_plugin13.html">Surface, originally by Silicon Graphics</a>
+: NURBS surface demo.
+<br> <a href="moth_plugin13.html">Moth, originally by Robert Doyle</a>
+: simulation of a moth flying around a light.
+<br> <a href="shadowvol_plugin13.html">Shadowvol, originally by Tom McReynolds, SGI</a>
+: demonstrates the use of shadow volumes.
+<br> <a href="softshadow_plugin13.html">Softshadow, originally by Tom McReynolds, SGI</a>
+: demonstrates use of the accumulation buffer for soft shadows.
+<br> <a href="material_plugin13.html">Material, originally by Silicon Graphics</a>
+: demonstrates the use of the OpenGL lighting model and materials.
+<br> <a href="logo_plugin13.html">Logo, author unknown</a>
+: 3D SGI logo with textures and user-adjustable rendering parameters.
+<br> <a href="glutplane_plugin13.html">Glutplane, originally by Mark J. Kilgard</a>
+: Paper airplanes demo. Originally written for Mark J Kilgard's GL Utility Toolkit (GLUT).
+<br> <a href="spots_plugin13.html">Spots, originally by Mark J. Kilgard</a>
+: Spot light demo.
+<br> <a href="rings_plugin13.html">Rings, originally by Philip Winston</a>
+: Do a slow zoom on a bunch of rings (ala Superman III?).
+<br> <a href="steam_plugin13.html">Steam, originally by Troy Robinette</a>
+: Miniature steam engine simulation.
+<br> <a href="dof_plugin13.html">DOF, originally by Silicon Graphics</a>
+: Uses accumulation buffer to create an out-of-focus depth-of-field effect.
+<br> <a href="pointblast_plugin13.html">Pointblast, originally by Mark J. Kilgard</a>
+: Particle animation demo.
+<br> <a href="quadric_plugin13.html">Quadric, originally by Silicon Graphics</a>
+: Demonstrates the use of some of the gluQuadric* routines.
+<br> <a href="mipmap_plugin13.html">Mipmap, originally by Silicon Graphics</a>
+: Demonstrates the use of mipmaps for texture maps.
+<br> <a href="teapots_plugin13.html">Teapots, originally by Silicon Graphics</a>
+: Demonstrates lots of material properties.
+<br> <a href="texgen_plugin13.html">Texgen, originally by Silicon Graphics</a>
+: Demonstrates the use of automatically generated texture coordinates.
+<br> <a href="polyoff_plugin13.html">Polyoff, originally by Silicon Graphics</a>
+: Uses polygon offset to draw wireframe over shaded polygons without ugly "stitching" artifacts.
+<br> <a href="scube_plugin13.html">Scube, originally by David G Yu/Mark J. Kilgard/Silicon Graphics</a>
+: Displays a spinning cube and its shadow.
+<br> <a href="particle_plugin13.html">Particle, originally by Nate Robins</a>
+: An example of a simple particle system.
+<br> <a href="text3d_plugin13.html">Text3d, originally by Robert J. Doyle, Jr.</a>
+: 3D animated text.
+<br> <a href="dinoshade_plugin13.html">Dinoshade, originally by Mark J. Kilgard</a>
+: Combines texturing, reflections, and projected shadows.
+<br>
+<br>
+<br>
+<hr>
+I have only added a new Class, to support a simple <br>
+customizing feature to these Applets ! <br>
+<br>
+The new Class is called "gl4java.applet.SimpleGLAnimApplet1", <br>
+and it supports to customize the frame/secounds (fps) value <br>
+and the refresh technique - both for animations ! <br>
+This new Class is now part of the GL4Java distribution,
+but is added here for portability !<br>
+<br>
+I removed the endless refresh technique from Ron, <br>
+so that the more portable "repaint" technique is used as default. <br>
+You can switch this off, like the "fps-sleep" delay ... <br>
+But you should know, what you are doing, e.g. be sure to have a <br>
+native thread JVM (MS-IE, and unix JVM's runs well with it) ! <br>
+<br>
+I removed the cab-files, and the jar-files also, <br>
+because it looks too confusing and too overdriven for me. <br>
+If you use MS-IE 4.0, be sure to have the new <br>
+MS-JVM machine (build 3186) installed ! <br>
+<br>
+Sven Goethel
+</body>
+</html>
diff --git a/demos/RonsDemos/logo.html b/demos/RonsDemos/logo.html new file mode 100644 index 0000000..98055c7 --- /dev/null +++ b/demos/RonsDemos/logo.html @@ -0,0 +1,45 @@ +<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.61 [en] (Win98; U) [Netscape]">
+ <title>Logo (author unknown); ported to Java by Ron Cemer</title>
+</head>
+<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#e6e6ff">
+Logo applet
+<br>Originial author unknown
+<br>Ported to Java by Ron Cemer
+<br>SEE BELOW FOR INSTRUCTIONS.
+<br>
+<applet code="logo.class" width=400 height=400>
+</applet>
+<br>Click inside the window, then press any of the following keys:
+<br>Up/down arrows: move the clipping plane in or out
+<br>Left/right arrows: rotate the model
+<br>z/Z: translate (move) the model in or out
+<br>1: render points only
+<br>2: render line drawing
+<br>3: render polygons
+<br>4: enable polygon smoothing
+<br>5: disable polygon smoothing
+<br>6: enable dithering
+<br>7: disable dithering
+<br>8: enable polygon stippling
+<br>9: disable polygon stippling
+<br>-: smooth shading
+<br>=: flat shading
+<br>q: disable culling
+<br>w: cull backfaces
+<br>e: cull frontfaces
+<br>r: frontfaces are counterclockwise (CCW)
+<br>t: frontfaces are clockwise (CW)
+<br>y/u: change stippling pattern
+<br>a: enable texturing; use brick texture
+<br>s: enable texturing; use checkered texture
+<br>d: disable texturing
+<br>f: texure modulate mode
+<br>g: texure decal mode
+<br>
+<hr>
+</body>
+</html>
diff --git a/demos/RonsDemos/logo.java b/demos/RonsDemos/logo.java new file mode 100644 index 0000000..0360ef8 --- /dev/null +++ b/demos/RonsDemos/logo.java @@ -0,0 +1,1091 @@ +/**
+ * @(#) logo.java
+ * @(#) author unknown (converted to Java by Ron Cemer)
+ */
+
+import java.applet.*;
+import java.awt.*;
+import java.awt.event.*;
+import java.lang.*;
+import java.util.*;
+import java.io.*;
+import java.util.*;
+import gl4java.GLContext;
+import gl4java.awt.GLCanvas;
+
+public class logo extends Applet
+{
+ // [3*CHECKIMAGEWIDTH*CHECKIMAGEHEIGHT]
+ private static final byte checkImage[] =
+ {
+ (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xff,
+ (byte)0xff, (byte)0xff, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xff, (byte)0xff,
+ (byte)0xff, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0x00, (byte)0x00, (byte)0x00,
+ (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xff,
+ (byte)0xff, (byte)0xff, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xff, (byte)0xff,
+ (byte)0xff, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0x00, (byte)0x00, (byte)0x00,
+ (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xff,
+ (byte)0xff, (byte)0xff, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xff, (byte)0xff,
+ (byte)0xff, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0x00, (byte)0x00, (byte)0x00,
+ (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xff,
+ (byte)0xff, (byte)0xff, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xff, (byte)0xff,
+ (byte)0xff, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0x00, (byte)0x00, (byte)0x00,
+ };
+ // [4*BRICKIMAGEWIDTH*BRICKIMAGEHEIGHT]
+ private static final byte brickImage[] =
+ {
+ (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff,
+ (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff,
+ (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff,
+ (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff,
+ (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff, (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff, (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff, (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff, (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff, (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff, (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff, (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff, (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff, (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff, (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff, (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff, (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff, (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff, (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff, (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff,
+ (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff,
+ (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff,
+ (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff,
+ (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff,
+ (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff, (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff, (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff, (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff, (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff, (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff, (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff, (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff, (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff, (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff, (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff, (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff, (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff, (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff, (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff, (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff,
+ (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff,
+ (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff,
+ (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff,
+ (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff,
+ (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff, (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff, (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff, (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff, (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff, (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff, (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff, (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff, (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff, (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff, (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff, (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff, (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff, (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff, (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff, (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff,
+ (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff, (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff, (byte)0xa4,(byte)0x00,(byte)0x00,(byte)0xff
+ };
+ // [4*32]
+ private static final byte stipple[] =
+ {
+ (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
+ (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
+ (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
+ (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
+ (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
+ (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
+ (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
+ (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
+
+ (byte)0x00, (byte)0x0F, (byte)0xF0, (byte)0x00,
+ (byte)0x00, (byte)0x0F, (byte)0xF0, (byte)0x00,
+ (byte)0x00, (byte)0x0F, (byte)0xF0, (byte)0x00,
+ (byte)0x00, (byte)0x0F, (byte)0xF0, (byte)0x00,
+ (byte)0x00, (byte)0x0F, (byte)0xF0, (byte)0x00,
+ (byte)0x00, (byte)0x0F, (byte)0xF0, (byte)0x00,
+ (byte)0x00, (byte)0x0F, (byte)0xF0, (byte)0x00,
+ (byte)0x00, (byte)0x0F, (byte)0xF0, (byte)0x00,
+
+ (byte)0x00, (byte)0x0F, (byte)0xF0, (byte)0x00,
+ (byte)0x00, (byte)0x0F, (byte)0xF0, (byte)0x00,
+ (byte)0x00, (byte)0x0F, (byte)0xF0, (byte)0x00,
+ (byte)0x00, (byte)0x0F, (byte)0xF0, (byte)0x00,
+ (byte)0x00, (byte)0x0F, (byte)0xF0, (byte)0x00,
+ (byte)0x00, (byte)0x0F, (byte)0xF0, (byte)0x00,
+ (byte)0x00, (byte)0x0F, (byte)0xF0, (byte)0x00,
+ (byte)0x00, (byte)0x0F, (byte)0xF0, (byte)0x00,
+
+ (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
+ (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
+ (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
+ (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
+ (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
+ (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
+ (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
+ (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
+ };
+ // [18][2]
+ private static final float tscp[][] =
+ {
+ { 0.0f, 0.0f },
+ { 1.0f, 0.0f },
+ { 0.0f, 0.125f },
+ { 1.0f, 0.125f },
+ { 0.0f, 0.250f },
+ { 1.0f, 0.25f },
+ { 0.0f, 0.375f },
+ { 1.0f, 0.375f },
+ { 0.0f, 0.50f },
+ { 1.0f, 0.50f },
+ { 0.0f, 0.625f },
+ { 1.0f, 0.625f },
+ { 0.0f, 0.75f },
+ { 1.0f, 0.75f },
+ { 0.0f, 0.875f },
+ { 1.0f, 0.875f },
+ { 0.0f, 1.0f },
+ { 1.0f, 1.0f }
+ };
+ // [18][3]
+ private static final float scp[][] =
+ {
+ { 1.000000f, 0.000000f, 0.000000f },
+ { 1.000000f, 0.000000f, 5.000000f },
+ { 0.707107f, 0.707107f, 0.000000f },
+ { 0.707107f, 0.707107f, 5.000000f },
+ { 0.000000f, 1.000000f, 0.000000f },
+ { 0.000000f, 1.000000f, 5.000000f },
+ { -0.707107f, 0.707107f, 0.000000f },
+ { -0.707107f, 0.707107f, 5.000000f },
+ { -1.000000f, 0.000000f, 0.000000f },
+ { -1.000000f, 0.000000f, 5.000000f },
+ { -0.707107f, -0.707107f, 0.000000f },
+ { -0.707107f, -0.707107f, 5.000000f },
+ { 0.000000f, -1.000000f, 0.000000f },
+ { 0.000000f, -1.000000f, 5.000000f },
+ { 0.707107f, -0.707107f, 0.000000f },
+ { 0.707107f, -0.707107f, 5.000000f },
+ { 1.000000f, 0.000000f, 0.000000f },
+ { 1.000000f, 0.000000f, 5.000000f }
+ };
+ // [18][3]
+ private static final float dcp[][] =
+ {
+ { 1.000000f, 0.000000f, 0.000000f },
+ { 1.000000f, 0.000000f, 7.000000f },
+ { 0.707107f, 0.707107f, 0.000000f },
+ { 0.707107f, 0.707107f, 7.000000f },
+ { 0.000000f, 1.000000f, 0.000000f },
+ { 0.000000f, 1.000000f, 7.000000f },
+ { -0.707107f, 0.707107f, 0.000000f },
+ { -0.707107f, 0.707107f, 7.000000f },
+ { -1.000000f, 0.000000f, 0.000000f },
+ { -1.000000f, 0.000000f, 7.000000f },
+ { -0.707107f, -0.707107f, 0.000000f },
+ { -0.707107f, -0.707107f, 7.000000f },
+ { 0.000000f, -1.000000f, 0.000000f },
+ { 0.000000f, -1.000000f, 7.000000f },
+ { 0.707107f, -0.707107f, 0.000000f },
+ { 0.707107f, -0.707107f, 7.000000f },
+ { 1.000000f, 0.000000f, 0.000000f },
+ { 1.000000f, 0.000000f, 7.000000f }
+ };
+ // [7][9][3]
+ private static final float ep[][][] =
+ {
+ {
+ { 1.000000f, 0.000000f, 0.000000f },
+ { 0.707107f, 0.707107f, 0.000000f },
+ { 0.000000f, 1.000000f, 0.000000f },
+ { -0.707107f, 0.707107f, 0.000000f },
+ { -1.000000f, 0.000000f, 0.000000f },
+ { -0.707107f, -0.707107f, 0.000000f },
+ { 0.000000f, -1.000000f, 0.000000f },
+ { 0.707107f, -0.707107f, 0.000000f },
+ { 1.000000f, 0.000000f, 0.000000f }
+ },
+ {
+ { 1.000000f, 0.034074f, 0.258819f },
+ { 0.707107f, 0.717087f, 0.075806f },
+ { 0.000000f, 1.000000f, 0.000000f },
+ { -0.707107f, 0.717087f, 0.075806f },
+ { -1.000000f, 0.034074f, 0.258819f },
+ { -0.707107f, -0.648939f, 0.441832f },
+ { 0.000000f, -0.931852f, 0.517638f },
+ { 0.707107f, -0.648939f, 0.441832f },
+ { 1.000000f, 0.034074f, 0.258819f }
+ },
+ {
+ { 1.000000f, 0.133975f, 0.500000f },
+ { 0.707107f, 0.746347f, 0.146447f },
+ { 0.000000f, 1.000000f, 0.000000f },
+ { -0.707107f, 0.746347f, 0.146447f },
+ { -1.000000f, 0.133975f, 0.500000f },
+ { -0.707107f, -0.478398f, 0.853553f },
+ { 0.000000f, -0.732051f, 1.000000f },
+ { 0.707107f, -0.478398f, 0.853553f },
+ { 1.000000f, 0.133975f, 0.500000f }
+ },
+ {
+ { 1.000000f, 0.292893f, 0.707107f },
+ { 0.707107f, 0.792893f, 0.207107f },
+ { 0.000000f, 1.000000f, 0.000000f },
+ { -0.707107f, 0.792893f, 0.207107f },
+ { -1.000000f, 0.292893f, 0.707107f },
+ { -0.707107f, -0.207107f, 1.207107f },
+ { 0.000000f, -0.414214f, 1.414214f },
+ { 0.707107f, -0.207107f, 1.207107f },
+ { 1.000000f, 0.292893f, 0.707107f }
+ },
+ {
+ { 1.000000f, 0.500000f, 0.866025f },
+ { 0.707107f, 0.853553f, 0.253653f },
+ { 0.000000f, 1.000000f, 0.000000f },
+ { -0.707107f, 0.853553f, 0.253653f },
+ { -1.000000f, 0.500000f, 0.866025f },
+ { -0.707107f, 0.146447f, 1.478398f },
+ { 0.000000f, 0.000000f, 1.732051f },
+ { 0.707107f, 0.146447f, 1.478398f },
+ { 1.000000f, 0.500000f, 0.866025f }
+ },
+ {
+ { 1.000000f, 0.741181f, 0.965926f },
+ { 0.707107f, 0.924194f, 0.282913f },
+ { 0.000000f, 1.000000f, 0.000000f },
+ { -0.707107f, 0.924194f, 0.282913f },
+ { -1.000000f, 0.741181f, 0.965926f },
+ { -0.707107f, 0.558168f, 1.648939f },
+ { 0.000000f, 0.482362f, 1.931852f },
+ { 0.707107f, 0.558168f, 1.648939f },
+ { 1.000000f, 0.741181f, 0.965926f }
+ },
+ {
+ { 1.000000f, 1.000000f, 1.000000f },
+ { 0.707107f, 1.000000f, 0.292893f },
+ { 0.000000f, 1.000000f, 0.000000f },
+ { -0.707107f, 1.000000f, 0.292893f },
+ { -1.000000f, 1.000000f, 1.000000f },
+ { -0.707107f, 1.000000f, 1.707107f },
+ { 0.000000f, 1.000000f, 2.000000f },
+ { 0.707107f, 1.000000f, 1.707107f },
+ { 1.000000f, 1.000000f, 1.000000f }
+ }
+ };
+ // [7][9][3]
+ private static final float en[][][] =
+ {
+ {
+ { 1.000000f, 0.000000f, 0.000000f },
+ { 0.707107f, 0.707107f, 0.000000f },
+ { 0.000000f, 1.000000f, 0.000000f },
+ { -0.707107f, 0.707107f, 0.000000f },
+ { -1.000000f, 0.000000f, 0.000000f },
+ { -0.707107f, -0.707107f, 0.000000f },
+ { 0.000000f, -1.000000f, 0.000000f },
+ { 0.707107f, -0.707107f, 0.000000f },
+ { 1.000000f, 0.000000f, 0.000000f }
+ },
+ {
+ { 1.000000f, 0.000000f, 0.000000f },
+ { 0.707107f, 0.683013f, -0.183013f },
+ { 0.000000f, 0.965926f, -0.258819f },
+ { -0.707107f, 0.683013f, -0.183013f },
+ { -1.000000f, 0.000000f, 0.000000f },
+ { -0.707107f, -0.683013f, 0.183013f },
+ { 0.000000f, -0.965926f, 0.258819f },
+ { 0.707107f, -0.683013f, 0.183013f },
+ { 1.000000f, 0.000000f, 0.000000f }
+ },
+ {
+ { 1.000000f, 0.000000f, 0.000000f },
+ { 0.707107f, 0.612372f, -0.353553f },
+ { 0.000000f, 0.866025f, -0.500000f },
+ { -0.707107f, 0.612372f, -0.353553f },
+ { -1.000000f, 0.000000f, 0.000000f },
+ { -0.707107f, -0.612372f, 0.353553f },
+ { 0.000000f, -0.866025f, 0.500000f },
+ { 0.707107f, -0.612372f, 0.353553f },
+ { 1.000000f, 0.000000f, 0.000000f }
+ },
+ {
+ { 1.000000f, 0.000000f, 0.000000f },
+ { 0.000000f, 0.707107f, -0.707107f },
+ { -0.707107f, 0.500000f, -0.500000f },
+ { -1.000000f, 0.000000f, 0.000000f },
+ { -0.707107f, -0.500000f, 0.500000f },
+ { 0.000000f, -0.707107f, 0.707107f },
+ { 0.707107f, -0.500000f, 0.500000f },
+ { 1.000000f, 0.000000f, 0.000000f },
+ { 0.000000f, 0.000000f, 0.000000f } /// ???
+ },
+ {
+ { 1.000000f, 0.000000f, 0.000000f },
+ { 0.707107f, 0.353553f, -0.612372f },
+ { 0.000000f, 0.500000f, -0.866025f },
+ { -0.707107f, 0.353553f, -0.612372f },
+ { -1.000000f, 0.000000f, 0.000000f },
+ { -0.707107f, -0.353553f, 0.612372f },
+ { 0.000000f, -0.500000f, 0.866025f },
+ { 0.707107f, -0.353553f, 0.612372f },
+ { 1.000000f, 0.000000f, 0.000000f }
+ },
+ {
+ { 1.000000f, 0.000000f, 0.000000f },
+ { 0.707107f, 0.183013f, -0.683013f },
+ { 0.000000f, 0.258819f, -0.965926f },
+ { -0.707107f, 0.183013f, -0.683013f },
+ { -1.000000f, 0.000000f, 0.000000f },
+ { -0.707107f, -0.183013f, 0.683013f },
+ { 0.000000f, -0.258819f, 0.965926f },
+ { 0.707107f, -0.183013f, 0.683013f },
+ { 1.000000f, 0.000000f, 0.000000f }
+ },
+ {
+ { 1.000000f, 0.000000f, 0.000000f },
+ { 0.707107f, 0.000000f, -0.707107f },
+ { 0.000000f, 0.000000f, -1.000000f },
+ { -0.707107f, 0.000000f, -0.707107f },
+ { -1.000000f, 0.000000f, 0.000000f },
+ { -0.707107f, 0.000000f, 0.707107f },
+ { 0.000000f, 0.000000f, 1.000000f },
+ { 0.707107f, 0.000000f, 0.707107f },
+ { 1.000000f, 0.000000f, 0.000000f }
+ }
+ };
+ // [7][9][2]
+ private static final float tep[][][] =
+ {
+ {
+ { 0.0f, 0.0f },
+ { 0.125f, 0.0f },
+ { 0.25f, 0.0f },
+ { 0.375f, 0.0f },
+ { 0.5f, 0.0f },
+ { 0.625f, 0.0f },
+ { 0.75f, 0.0f },
+ { 0.875f, 0.0f },
+ { 1.0f, 0.0f }
+ },
+ {
+ { 0.0f, 0.16667f },
+ { 0.125f, 0.16667f },
+ { 0.25f, 0.16667f },
+ { 0.375f, 0.16667f },
+ { 0.5f, 0.16667f },
+ { 0.625f, 0.16667f },
+ { 0.75f, 0.16667f },
+ { 0.875f, 0.16667f },
+ { 1.0f, 0.16667f }
+ },
+ {
+ { 0.0f, 0.33333f },
+ { 0.125f, 0.33333f },
+ { 0.25f, 0.33333f },
+ { 0.375f, 0.33333f },
+ { 0.5f, 0.33333f },
+ { 0.625f, 0.33333f },
+ { 0.75f, 0.33333f },
+ { 0.875f, 0.33333f },
+ { 1.0f, 0.33333f }
+ },
+ {
+ { 0.0f, 0.5f },
+ { 0.125f, 0.5f },
+ { 0.25f, 0.5f },
+ { 0.375f, 0.5f },
+ { 0.5f, 0.5f },
+ { 0.625f, 0.5f },
+ { 0.75f, 0.5f },
+ { 0.875f, 0.5f },
+ { 1.0f, 0.5f }
+ },
+ {
+ { 0.0f, 0.6667f },
+ { 0.125f, 0.6667f },
+ { 0.25f, 0.6667f },
+ { 0.375f, 0.6667f },
+ { 0.5f, 0.6667f },
+ { 0.625f, 0.6667f },
+ { 0.75f, 0.6667f },
+ { 0.875f, 0.6667f },
+ { 1.0f, 0.6667f }
+ },
+ {
+ { 0.0f, 0.83333f },
+ { 0.125f, 0.83333f },
+ { 0.25f, 0.83333f },
+ { 0.375f, 0.83333f },
+ { 0.5f, 0.83333f },
+ { 0.625f, 0.83333f },
+ { 0.75f, 0.83333f },
+ { 0.875f, 0.83333f },
+ { 1.0f, 0.83333f }
+ },
+ {
+ { 0.0f, 1.0f },
+ { 0.125f, 1.0f },
+ { 0.25f, 1.0f },
+ { 0.375f, 1.0f },
+ { 0.5f, 1.0f },
+ { 0.625f, 1.0f },
+ { 0.75f, 1.0f },
+ { 0.875f, 1.0f },
+ { 1.0f, 1.0f }
+ }
+ };
+
+ logoCanvas canvas = null;
+
+
+ /* Initialize the applet */
+
+
+ public void init()
+ {
+ Dimension d = getSize();
+ setLayout(new BorderLayout());
+ canvas = new logoCanvas(d.width, d.height);
+ canvas.requestFocus();
+ add("Center", canvas);
+ }
+
+
+ /* Start the applet */
+
+
+ public void start()
+ {
+ }
+
+
+ /* Stop the applet */
+
+
+ public void stop()
+ {
+ }
+
+
+ /* Destroy the applet */
+
+
+ public void destroy()
+ {
+ canvas.cvsDispose();
+ }
+
+
+ /* Local GLCanvas extension class */
+
+
+ private class logoCanvas extends GLCanvas
+ implements KeyListener, MouseListener
+ {
+ byte BLACK = (byte)0;
+ byte GRAY = (byte)128;
+ byte WHITE = (byte)255;
+ int CHECKIMAGEWIDTH = 8;
+ int CHECKIMAGEHEIGHT = 8;
+ int BRICKIMAGEWIDTH = 16;
+ int BRICKIMAGEHEIGHT = 16;
+ float black[] = {0.0f, 0.0f, 0.0f};
+ float white[] = {1.0f, 1.0f, 1.0f};
+ float gray[] = {0.5f, 0.5f, 0.5f};
+ float blue[] = {0.0f, 0.0f, 1.0f};
+ int colorIndexes[] = {0, 200, 255};
+ double plane[] = {1.0f, 0.0f, -1.0f, 12.0f};
+ float yRotation = 30.0f;
+ float zTranslation = -15.0f;
+ int singleCylinder;
+ int doubleCylinder;
+ int elbow, logo;
+ byte[] image = checkImage;
+ int imageHeight = CHECKIMAGEHEIGHT;
+ int imageWidth = CHECKIMAGEWIDTH;
+ float decal[] = { (float)GL_DECAL };
+ float modulate[] = { (float)GL_MODULATE };
+ float repeat[] = { (float)GL_REPEAT };
+ float nearest[] = { (float)GL_NEAREST };
+
+ public logoCanvas(int w, int h)
+ {
+ super(w, h);
+ GLContext.gljNativeDebug = false;
+ GLContext.gljClassDebug = false;
+ }
+
+ public void preInit()
+ {
+ doubleBuffer = true;
+ stereoView = false;
+ }
+
+ public void init()
+ {
+ System.out.println("init(): " + this);
+ reshape(getSize().width, getSize().height);
+
+ float ambient[] = {0.1f, 0.1f, 0.1f, 1.0f};
+ float diffuse[] = {0.5f, 1.0f, 1.0f, 1.0f};
+ float position[] = {90.0f, 90.0f, 150.0f, 0.0f};
+ float front_mat_shininess[] = {30.0f};
+ float front_mat_specular[] = {0.2f, 0.2f, 0.2f, 1.0f};
+ float front_mat_diffuse[] = {0.5f, 0.28f, 0.38f, 1.0f};
+ float back_mat_shininess[] = {50.0f};
+ float back_mat_specular[] = {0.5f, 0.5f, 0.2f, 1.0f};
+ float back_mat_diffuse[] = {1.0f, 1.0f, 0.2f, 1.0f};
+ float lmodel_ambient[] = {1.0f, 1.0f, 1.0f, 1.0f};
+ float lmodel_twoside[] = {(float)1.0};
+
+ gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
+
+ gl.glFrontFace(GL_CW);
+
+ gl.glEnable(GL_DEPTH_TEST);
+
+ gl.glLightModelfv(GL_LIGHT_MODEL_AMBIENT, lmodel_ambient);
+ gl.glLightModelfv(GL_LIGHT_MODEL_TWO_SIDE, lmodel_twoside);
+ gl.glLightfv(GL_LIGHT0, GL_AMBIENT, ambient);
+ gl.glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse);
+ gl.glLightfv(GL_LIGHT0, GL_POSITION, position);
+ gl.glEnable(GL_LIGHTING);
+ gl.glEnable(GL_LIGHT0);
+
+ gl.glMaterialfv(GL_FRONT, GL_SHININESS, front_mat_shininess);
+ gl.glMaterialfv(GL_FRONT, GL_SPECULAR, front_mat_specular);
+ gl.glMaterialfv(GL_FRONT, GL_DIFFUSE, front_mat_diffuse);
+ gl.glMaterialfv(GL_BACK, GL_SHININESS, back_mat_shininess);
+ gl.glMaterialfv(GL_BACK, GL_SPECULAR, back_mat_specular);
+ gl.glMaterialfv(GL_BACK, GL_DIFFUSE, back_mat_diffuse);
+
+ gl.glEnable(GL_CLIP_PLANE0);
+
+ gl.glTexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, modulate);
+ gl.glTexParameterfv(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, repeat);
+ gl.glTexParameterfv(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, repeat);
+ gl.glTexParameterfv(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, nearest);
+ gl.glTexParameterfv(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, nearest);
+ gl.glTexImage2D
+ (GL_TEXTURE_2D,
+ 0,
+ 4,
+ BRICKIMAGEWIDTH,
+ BRICKIMAGEHEIGHT,
+ 0,
+ GL_RGBA,
+ GL_UNSIGNED_BYTE,
+ brickImage);
+ gl.glEnable(GL_TEXTURE_2D);
+
+ gl.glCullFace(GL_BACK);
+ gl.glEnable(GL_CULL_FACE);
+
+ BuildLists();
+
+ glj.gljCheckGL();
+
+ addKeyListener(this);
+ addMouseListener(this);
+ }
+
+ public void cvsDispose()
+ {
+ System.out.println("destroy(): " + this);
+ removeKeyListener(this);
+ super.cvsDispose();
+ }
+
+ public void reshape(int width, int height)
+ {
+ gl.glViewport(0,0,width,height);
+ gl.glMatrixMode(GL_PROJECTION);
+ gl.glLoadIdentity();
+ glu.gluPerspective(90.0f, 1.0f, 1.0f, 200.0f);
+ gl.glMatrixMode(GL_MODELVIEW);
+ }
+
+ public void display()
+ {
+ if (glj.gljMakeCurrent() == false) return;
+
+ gl.glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
+
+ gl.glPushMatrix();
+
+ gl.glTranslatef(0.0f, 0.0f, zTranslation);
+ gl.glRotatef(30.0f, 1.0f, 0.0f, 0.0f);
+ gl.glRotatef(yRotation, 0.0f, 1.0f, 0.0f);
+ gl.glClipPlane(GL_CLIP_PLANE0, plane);
+ gl.glCallList(logo);
+
+ gl.glPopMatrix();
+
+ glj.gljSwap();
+ glj.gljCheckGL();
+ glj.gljFree();
+ }
+
+ // Methods required for the implementation of KeyListener
+ public void keyPressed(KeyEvent e)
+ {
+ switch (e.getKeyCode())
+ {
+ case KeyEvent.VK_LEFT:
+ yRotation -= 0.5f;
+ repaint();
+ break;
+ case KeyEvent.VK_RIGHT:
+ yRotation += 0.5f;
+ repaint();
+ break;
+ case KeyEvent.VK_UP:
+ plane[3] -= 2.0;
+ repaint();
+ break;
+ case KeyEvent.VK_DOWN:
+ plane[3] += 2.0;
+ repaint();
+ break;
+ }
+ }
+
+ public void keyReleased(KeyEvent e)
+ {
+ }
+
+ public void keyTyped(KeyEvent e)
+ {
+ if (glj.gljMakeCurrent() == false) return;
+ boolean dorepaint = false;
+ switch ((char)e.getKeyChar())
+ {
+ case 'z':
+ zTranslation -= 1.0f;
+ dorepaint = true;
+ break;
+ case 'Z':
+ zTranslation += 1.0f;
+ dorepaint = true;
+ break;
+ case '1':
+ gl.glPolygonMode(GL_FRONT_AND_BACK, GL_POINT);
+ dorepaint = true;
+ break;
+ case '2':
+ gl.glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
+ dorepaint = true;
+ break;
+ case '3':
+ gl.glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
+ dorepaint = true;
+ break;
+ case '4':
+ gl.glEnable(GL_POLYGON_SMOOTH);
+ gl.glBlendFunc(GL_SRC_ALPHA, GL_ONE);
+ gl.glEnable(GL_BLEND);
+ gl.glDisable(GL_DEPTH_TEST);
+ dorepaint = true;
+ break;
+ case '5':
+ gl.glDisable(GL_POLYGON_SMOOTH);
+ gl.glBlendFunc(GL_ONE, GL_ZERO);
+ gl.glDisable(GL_BLEND);
+ gl.glEnable(GL_DEPTH_TEST);
+ dorepaint = true;
+ break;
+ case '6':
+ gl.glEnable(GL_DITHER);
+ dorepaint = true;
+ break;
+ case '7':
+ gl.glDisable(GL_DITHER);
+ dorepaint = true;
+ break;
+ case '8':
+ gl.glPolygonStipple(stipple);
+ gl.glEnable(GL_POLYGON_STIPPLE);
+ dorepaint = true;
+ break;
+ case '9':
+ gl.glDisable(GL_POLYGON_STIPPLE);
+ dorepaint = true;
+ break;
+ case '-':
+ gl.glShadeModel(GL_SMOOTH);
+ dorepaint = true;
+ break;
+ case '=':
+ gl.glShadeModel(GL_FLAT);
+ dorepaint = true;
+ break;
+ case 'q':
+ gl.glDisable(GL_CULL_FACE);
+ dorepaint = true;
+ break;
+ case 'w':
+ gl.glEnable(GL_CULL_FACE);
+ gl.glCullFace(GL_BACK);
+ dorepaint = true;
+ break;
+ case 'e':
+ gl.glEnable(GL_CULL_FACE);
+ gl.glCullFace(GL_FRONT);
+ dorepaint = true;
+ break;
+ case 'r':
+ gl.glFrontFace(GL_CCW);
+ dorepaint = true;
+ break;
+ case 't':
+ gl.glFrontFace(GL_CW);
+ dorepaint = true;
+ break;
+ case 'y':
+ gl.glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
+ gl.glPixelStorei(GL_UNPACK_LSB_FIRST, 0);
+ gl.glPolygonStipple(stipple);
+ dorepaint = true;
+ break;
+ case 'u':
+ gl.glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
+ gl.glPixelStorei(GL_UNPACK_LSB_FIRST, 1);
+ gl.glPolygonStipple(stipple);
+ dorepaint = true;
+ break;
+ case 'a':
+ gl.glEnable(GL_TEXTURE_2D);
+ gl.glTexParameterfv(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, repeat);
+ gl.glTexParameterfv(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, repeat);
+ gl.glTexParameterfv(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, nearest);
+ gl.glTexParameterfv(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, nearest);
+ gl.glTexImage2D
+ (GL_TEXTURE_2D,
+ 0,
+ 4,
+ BRICKIMAGEWIDTH,
+ BRICKIMAGEHEIGHT,
+ 0,
+ GL_RGBA,
+ GL_UNSIGNED_BYTE,
+ brickImage);
+ dorepaint = true;
+ break;
+ case 's':
+ gl.glEnable(GL_TEXTURE_2D);
+ gl.glTexParameterfv(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, repeat);
+ gl.glTexParameterfv(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, repeat);
+ gl.glTexParameterfv(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, nearest);
+ gl.glTexParameterfv(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, nearest);
+ gl.glTexImage2D
+ (GL_TEXTURE_2D,
+ 0,
+ 3,
+ CHECKIMAGEWIDTH,
+ CHECKIMAGEHEIGHT,
+ 0,
+ GL_RGB,
+ GL_UNSIGNED_BYTE,
+ checkImage);
+ dorepaint = true;
+ break;
+ case 'd':
+ gl.glDisable(GL_TEXTURE_2D);
+ dorepaint = true;
+ break;
+ case 'f':
+ gl.glTexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, modulate);
+ dorepaint = true;
+ break;
+ case 'g':
+ gl.glTexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, decal);
+ dorepaint = true;
+ break;
+ }
+ glj.gljFree();
+ if (dorepaint) repaint();
+ }
+
+ private void BendForward()
+ {
+ gl.glTranslatef(0.0f, 1.0f, 0.0f);
+ gl.glRotatef(90.0f, 1.0f, 0.0f, 0.0f);
+ gl.glTranslatef(0.0f, -1.0f, 0.0f);
+ }
+
+ private void BendLeft()
+ {
+ gl.glRotatef(-90.0f, 0.0f, 0.0f, 1.0f);
+ gl.glTranslatef(0.0f, 1.0f, 0.0f);
+ gl.glRotatef(90.0f, 1.0f, 0.0f, 0.0f);
+ gl.glTranslatef(0.0f, -1.0f, 0.0f);
+ }
+
+ private void BendRight()
+ {
+ gl.glRotatef(90.0f, 0.0f, 0.0f, 1.0f);
+ gl.glTranslatef(0.0f, 1.0f, 0.0f);
+ gl.glRotatef(90.0f, 1.0f, 0f, 0.0f);
+ gl.glTranslatef(0.0f, -1.0f, 0.0f);
+ }
+
+ private void BuildSingleCylinder()
+ {
+ gl.glNewList(singleCylinder, GL_COMPILE);
+ gl.glBegin(GL_TRIANGLE_STRIP);
+ gl.glNormal3fv(scp[0]); gl.glTexCoord2fv(tscp[0]); gl.glVertex3fv(scp[0]);
+ gl.glNormal3fv(scp[0]); gl.glTexCoord2fv(tscp[1]); gl.glVertex3fv(scp[1]);
+ gl.glNormal3fv(scp[2]); gl.glTexCoord2fv(tscp[2]); gl.glVertex3fv(scp[2]);
+ gl.glNormal3fv(scp[2]); gl.glTexCoord2fv(tscp[3]); gl.glVertex3fv(scp[3]);
+ gl.glNormal3fv(scp[4]); gl.glTexCoord2fv(tscp[4]); gl.glVertex3fv(scp[4]);
+ gl.glNormal3fv(scp[4]); gl.glTexCoord2fv(tscp[5]); gl.glVertex3fv(scp[5]);
+ gl.glNormal3fv(scp[6]); gl.glTexCoord2fv(tscp[6]); gl.glVertex3fv(scp[6]);
+ gl.glNormal3fv(scp[6]); gl.glTexCoord2fv(tscp[7]); gl.glVertex3fv(scp[7]);
+ gl.glNormal3fv(scp[8]); gl.glTexCoord2fv(tscp[8]); gl.glVertex3fv(scp[8]);
+ gl.glNormal3fv(scp[8]); gl.glTexCoord2fv(tscp[9]); gl.glVertex3fv(scp[9]);
+ gl.glNormal3fv(scp[10]); gl.glTexCoord2fv(tscp[10]); gl.glVertex3fv(scp[10]);
+ gl.glNormal3fv(scp[10]); gl.glTexCoord2fv(tscp[11]); gl.glVertex3fv(scp[11]);
+ gl.glNormal3fv(scp[12]); gl.glTexCoord2fv(tscp[12]); gl.glVertex3fv(scp[12]);
+ gl.glNormal3fv(scp[12]); gl.glTexCoord2fv(tscp[13]); gl.glVertex3fv(scp[13]);
+ gl.glNormal3fv(scp[14]); gl.glTexCoord2fv(tscp[14]); gl.glVertex3fv(scp[14]);
+ gl.glNormal3fv(scp[14]); gl.glTexCoord2fv(tscp[15]); gl.glVertex3fv(scp[15]);
+ gl.glNormal3fv(scp[16]); gl.glTexCoord2fv(tscp[16]); gl.glVertex3fv(scp[16]);
+ gl.glNormal3fv(scp[16]); gl.glTexCoord2fv(tscp[17]); gl.glVertex3fv(scp[17]);
+ gl.glEnd();
+ gl.glEndList();
+ }
+
+ private void BuildDoubleCylinder()
+ {
+ gl.glNewList(doubleCylinder, GL_COMPILE);
+ gl.glBegin(GL_TRIANGLE_STRIP);
+ gl.glNormal3fv(dcp[0]); gl.glTexCoord2fv(tscp[0]); gl.glVertex3fv(dcp[0]);
+ gl.glNormal3fv(dcp[0]); gl.glTexCoord2fv(tscp[1]); gl.glVertex3fv(dcp[1]);
+ gl.glNormal3fv(dcp[2]); gl.glTexCoord2fv(tscp[2]); gl.glVertex3fv(dcp[2]);
+ gl.glNormal3fv(dcp[2]); gl.glTexCoord2fv(tscp[3]); gl.glVertex3fv(dcp[3]);
+ gl.glNormal3fv(dcp[4]); gl.glTexCoord2fv(tscp[4]); gl.glVertex3fv(dcp[4]);
+ gl.glNormal3fv(dcp[4]); gl.glTexCoord2fv(tscp[5]); gl.glVertex3fv(dcp[5]);
+ gl.glNormal3fv(dcp[6]); gl.glTexCoord2fv(tscp[6]); gl.glVertex3fv(dcp[6]);
+ gl.glNormal3fv(dcp[6]); gl.glTexCoord2fv(tscp[7]); gl.glVertex3fv(dcp[7]);
+ gl.glNormal3fv(dcp[8]); gl.glTexCoord2fv(tscp[8]); gl.glVertex3fv(dcp[8]);
+ gl.glNormal3fv(dcp[8]); gl.glTexCoord2fv(tscp[9]); gl.glVertex3fv(dcp[9]);
+ gl.glNormal3fv(dcp[10]); gl.glTexCoord2fv(tscp[10]); gl.glVertex3fv(dcp[10]);
+ gl.glNormal3fv(dcp[10]); gl.glTexCoord2fv(tscp[11]); gl.glVertex3fv(dcp[11]);
+ gl.glNormal3fv(dcp[12]); gl.glTexCoord2fv(tscp[12]); gl.glVertex3fv(dcp[12]);
+ gl.glNormal3fv(dcp[12]); gl.glTexCoord2fv(tscp[13]); gl.glVertex3fv(dcp[13]);
+ gl.glNormal3fv(dcp[14]); gl.glTexCoord2fv(tscp[14]); gl.glVertex3fv(dcp[14]);
+ gl.glNormal3fv(dcp[14]); gl.glTexCoord2fv(tscp[15]); gl.glVertex3fv(dcp[15]);
+ gl.glNormal3fv(dcp[16]); gl.glTexCoord2fv(tscp[16]); gl.glVertex3fv(dcp[16]);
+ gl.glNormal3fv(dcp[16]); gl.glTexCoord2fv(tscp[17]); gl.glVertex3fv(dcp[17]);
+ gl.glEnd();
+ gl.glEndList();
+ }
+
+ private void BuildElbow()
+ {
+ gl.glNewList(elbow, GL_COMPILE);
+ gl.glBegin(GL_TRIANGLE_STRIP);
+ gl.glNormal3fv(en[0][0]); gl.glTexCoord2fv(tep[0][0]); gl.glVertex3fv(ep[0][0]);
+ gl.glNormal3fv(en[1][0]); gl.glTexCoord2fv(tep[1][0]); gl.glVertex3fv(ep[1][0]);
+ gl.glNormal3fv(en[0][1]); gl.glTexCoord2fv(tep[0][1]); gl.glVertex3fv(ep[0][1]);
+ gl.glNormal3fv(en[1][1]); gl.glTexCoord2fv(tep[1][1]); gl.glVertex3fv(ep[1][1]);
+ gl.glNormal3fv(en[0][2]); gl.glTexCoord2fv(tep[0][2]); gl.glVertex3fv(ep[0][2]);
+ gl.glNormal3fv(en[1][2]); gl.glTexCoord2fv(tep[1][2]); gl.glVertex3fv(ep[1][2]);
+ gl.glNormal3fv(en[0][3]); gl.glTexCoord2fv(tep[0][3]); gl.glVertex3fv(ep[0][3]);
+ gl.glNormal3fv(en[1][3]); gl.glTexCoord2fv(tep[1][3]); gl.glVertex3fv(ep[1][3]);
+ gl.glNormal3fv(en[0][4]); gl.glTexCoord2fv(tep[0][4]); gl.glVertex3fv(ep[0][4]);
+ gl.glNormal3fv(en[1][4]); gl.glTexCoord2fv(tep[1][4]); gl.glVertex3fv(ep[1][4]);
+ gl.glNormal3fv(en[0][5]); gl.glTexCoord2fv(tep[0][5]); gl.glVertex3fv(ep[0][5]);
+ gl.glNormal3fv(en[1][5]); gl.glTexCoord2fv(tep[1][5]); gl.glVertex3fv(ep[1][5]);
+ gl.glNormal3fv(en[0][6]); gl.glTexCoord2fv(tep[0][6]); gl.glVertex3fv(ep[0][6]);
+ gl.glNormal3fv(en[1][6]); gl.glTexCoord2fv(tep[1][6]); gl.glVertex3fv(ep[1][6]);
+ gl.glNormal3fv(en[0][7]); gl.glTexCoord2fv(tep[0][7]); gl.glVertex3fv(ep[0][7]);
+ gl.glNormal3fv(en[1][7]); gl.glTexCoord2fv(tep[1][7]); gl.glVertex3fv(ep[1][7]);
+ gl.glNormal3fv(en[0][8]); gl.glTexCoord2fv(tep[0][8]); gl.glVertex3fv(ep[0][8]);
+ gl.glNormal3fv(en[1][8]); gl.glTexCoord2fv(tep[1][8]); gl.glVertex3fv(ep[1][8]);
+ gl.glEnd();
+ gl.glBegin(GL_TRIANGLE_STRIP);
+ gl.glNormal3fv(en[1][0]); gl.glTexCoord2fv(tep[1][0]); gl.glVertex3fv(ep[1][0]);
+ gl.glNormal3fv(en[2][0]); gl.glTexCoord2fv(tep[2][0]); gl.glVertex3fv(ep[2][0]);
+ gl.glNormal3fv(en[1][1]); gl.glTexCoord2fv(tep[1][1]); gl.glVertex3fv(ep[1][1]);
+ gl.glNormal3fv(en[2][1]); gl.glTexCoord2fv(tep[2][1]); gl.glVertex3fv(ep[2][1]);
+ gl.glNormal3fv(en[1][2]); gl.glTexCoord2fv(tep[1][2]); gl.glVertex3fv(ep[1][2]);
+ gl.glNormal3fv(en[2][2]); gl.glTexCoord2fv(tep[2][2]); gl.glVertex3fv(ep[2][2]);
+ gl.glNormal3fv(en[1][3]); gl.glTexCoord2fv(tep[1][3]); gl.glVertex3fv(ep[1][3]);
+ gl.glNormal3fv(en[2][3]); gl.glTexCoord2fv(tep[2][3]); gl.glVertex3fv(ep[2][3]);
+ gl.glNormal3fv(en[1][4]); gl.glTexCoord2fv(tep[1][4]); gl.glVertex3fv(ep[1][4]);
+ gl.glNormal3fv(en[2][4]); gl.glTexCoord2fv(tep[2][4]); gl.glVertex3fv(ep[2][4]);
+ gl.glNormal3fv(en[1][5]); gl.glTexCoord2fv(tep[1][5]); gl.glVertex3fv(ep[1][5]);
+ gl.glNormal3fv(en[2][5]); gl.glTexCoord2fv(tep[2][5]); gl.glVertex3fv(ep[2][5]);
+ gl.glNormal3fv(en[1][6]); gl.glTexCoord2fv(tep[1][6]); gl.glVertex3fv(ep[1][6]);
+ gl.glNormal3fv(en[2][6]); gl.glTexCoord2fv(tep[2][6]); gl.glVertex3fv(ep[2][6]);
+ gl.glNormal3fv(en[1][7]); gl.glTexCoord2fv(tep[1][7]); gl.glVertex3fv(ep[1][7]);
+ gl.glNormal3fv(en[2][7]); gl.glTexCoord2fv(tep[2][7]); gl.glVertex3fv(ep[2][7]);
+ gl.glNormal3fv(en[1][8]); gl.glTexCoord2fv(tep[1][8]); gl.glVertex3fv(ep[1][8]);
+ gl.glNormal3fv(en[2][8]); gl.glTexCoord2fv(tep[2][8]); gl.glVertex3fv(ep[2][8]);
+ gl.glEnd();
+ gl.glBegin(GL_TRIANGLE_STRIP);
+ gl.glNormal3fv(en[2][0]); gl.glTexCoord2fv(tep[2][0]); gl.glVertex3fv(ep[2][0]);
+ gl.glNormal3fv(en[3][0]); gl.glTexCoord2fv(tep[3][0]); gl.glVertex3fv(ep[3][0]);
+ gl.glNormal3fv(en[2][1]); gl.glTexCoord2fv(tep[2][1]); gl.glVertex3fv(ep[2][1]);
+ gl.glNormal3fv(en[3][1]); gl.glTexCoord2fv(tep[3][1]); gl.glVertex3fv(ep[3][1]);
+ gl.glNormal3fv(en[2][2]); gl.glTexCoord2fv(tep[2][2]); gl.glVertex3fv(ep[2][2]);
+ gl.glNormal3fv(en[3][2]); gl.glTexCoord2fv(tep[3][2]); gl.glVertex3fv(ep[3][2]);
+ gl.glNormal3fv(en[2][3]); gl.glTexCoord2fv(tep[2][3]); gl.glVertex3fv(ep[2][3]);
+ gl.glNormal3fv(en[3][3]); gl.glTexCoord2fv(tep[3][3]); gl.glVertex3fv(ep[3][3]);
+ gl.glNormal3fv(en[2][4]); gl.glTexCoord2fv(tep[2][4]); gl.glVertex3fv(ep[2][4]);
+ gl.glNormal3fv(en[3][4]); gl.glTexCoord2fv(tep[3][4]); gl.glVertex3fv(ep[3][4]);
+ gl.glNormal3fv(en[2][5]); gl.glTexCoord2fv(tep[2][5]); gl.glVertex3fv(ep[2][5]);
+ gl.glNormal3fv(en[3][5]); gl.glTexCoord2fv(tep[3][5]); gl.glVertex3fv(ep[3][5]);
+ gl.glNormal3fv(en[2][6]); gl.glTexCoord2fv(tep[2][6]); gl.glVertex3fv(ep[2][6]);
+ gl.glNormal3fv(en[3][6]); gl.glTexCoord2fv(tep[3][6]); gl.glVertex3fv(ep[3][6]);
+ gl.glNormal3fv(en[2][7]); gl.glTexCoord2fv(tep[2][7]); gl.glVertex3fv(ep[2][7]);
+ gl.glNormal3fv(en[3][7]); gl.glTexCoord2fv(tep[3][7]); gl.glVertex3fv(ep[3][7]);
+ gl.glNormal3fv(en[2][8]); gl.glTexCoord2fv(tep[2][8]); gl.glVertex3fv(ep[2][8]);
+ gl.glNormal3fv(en[3][8]); gl.glTexCoord2fv(tep[3][8]); gl.glVertex3fv(ep[3][8]);
+ gl.glEnd();
+ gl.glBegin(GL_TRIANGLE_STRIP);
+ gl.glNormal3fv(en[3][0]); gl.glTexCoord2fv(tep[3][0]); gl.glVertex3fv(ep[3][0]);
+ gl.glNormal3fv(en[4][0]); gl.glTexCoord2fv(tep[4][0]); gl.glVertex3fv(ep[4][0]);
+ gl.glNormal3fv(en[3][1]); gl.glTexCoord2fv(tep[3][1]); gl.glVertex3fv(ep[3][1]);
+ gl.glNormal3fv(en[4][1]); gl.glTexCoord2fv(tep[4][1]); gl.glVertex3fv(ep[4][1]);
+ gl.glNormal3fv(en[3][2]); gl.glTexCoord2fv(tep[3][2]); gl.glVertex3fv(ep[3][2]);
+ gl.glNormal3fv(en[4][2]); gl.glTexCoord2fv(tep[4][2]); gl.glVertex3fv(ep[4][2]);
+ gl.glNormal3fv(en[3][3]); gl.glTexCoord2fv(tep[3][3]); gl.glVertex3fv(ep[3][3]);
+ gl.glNormal3fv(en[4][3]); gl.glTexCoord2fv(tep[4][3]); gl.glVertex3fv(ep[4][3]);
+ gl.glNormal3fv(en[3][4]); gl.glTexCoord2fv(tep[3][4]); gl.glVertex3fv(ep[3][4]);
+ gl.glNormal3fv(en[4][4]); gl.glTexCoord2fv(tep[4][4]); gl.glVertex3fv(ep[4][4]);
+ gl.glNormal3fv(en[3][5]); gl.glTexCoord2fv(tep[3][5]); gl.glVertex3fv(ep[3][5]);
+ gl.glNormal3fv(en[4][5]); gl.glTexCoord2fv(tep[4][5]); gl.glVertex3fv(ep[4][5]);
+ gl.glNormal3fv(en[3][6]); gl.glTexCoord2fv(tep[3][6]); gl.glVertex3fv(ep[3][6]);
+ gl.glNormal3fv(en[4][6]); gl.glTexCoord2fv(tep[4][6]); gl.glVertex3fv(ep[4][6]);
+ gl.glNormal3fv(en[3][7]); gl.glTexCoord2fv(tep[3][7]); gl.glVertex3fv(ep[3][7]);
+ gl.glNormal3fv(en[4][7]); gl.glTexCoord2fv(tep[4][7]); gl.glVertex3fv(ep[4][7]);
+ gl.glNormal3fv(en[3][8]); gl.glTexCoord2fv(tep[3][8]); gl.glVertex3fv(ep[3][8]);
+ gl.glNormal3fv(en[4][8]); gl.glTexCoord2fv(tep[4][8]); gl.glVertex3fv(ep[4][8]);
+ gl.glEnd();
+ gl.glBegin(GL_TRIANGLE_STRIP);
+ gl.glNormal3fv(en[4][0]); gl.glTexCoord2fv(tep[4][0]); gl.glVertex3fv(ep[4][0]);
+ gl.glNormal3fv(en[5][0]); gl.glTexCoord2fv(tep[5][0]); gl.glVertex3fv(ep[5][0]);
+ gl.glNormal3fv(en[4][1]); gl.glTexCoord2fv(tep[4][1]); gl.glVertex3fv(ep[4][1]);
+ gl.glNormal3fv(en[5][1]); gl.glTexCoord2fv(tep[5][1]); gl.glVertex3fv(ep[5][1]);
+ gl.glNormal3fv(en[4][2]); gl.glTexCoord2fv(tep[4][2]); gl.glVertex3fv(ep[4][2]);
+ gl.glNormal3fv(en[5][2]); gl.glTexCoord2fv(tep[5][2]); gl.glVertex3fv(ep[5][2]);
+ gl.glNormal3fv(en[4][3]); gl.glTexCoord2fv(tep[4][3]); gl.glVertex3fv(ep[4][3]);
+ gl.glNormal3fv(en[5][3]); gl.glTexCoord2fv(tep[5][3]); gl.glVertex3fv(ep[5][3]);
+ gl.glNormal3fv(en[4][4]); gl.glTexCoord2fv(tep[4][4]); gl.glVertex3fv(ep[4][4]);
+ gl.glNormal3fv(en[5][4]); gl.glTexCoord2fv(tep[5][4]); gl.glVertex3fv(ep[5][4]);
+ gl.glNormal3fv(en[4][5]); gl.glTexCoord2fv(tep[4][5]); gl.glVertex3fv(ep[4][5]);
+ gl.glNormal3fv(en[5][5]); gl.glTexCoord2fv(tep[5][5]); gl.glVertex3fv(ep[5][5]);
+ gl.glNormal3fv(en[4][6]); gl.glTexCoord2fv(tep[4][6]); gl.glVertex3fv(ep[4][6]);
+ gl.glNormal3fv(en[5][6]); gl.glTexCoord2fv(tep[5][6]); gl.glVertex3fv(ep[5][6]);
+ gl.glNormal3fv(en[4][7]); gl.glTexCoord2fv(tep[4][7]); gl.glVertex3fv(ep[4][7]);
+ gl.glNormal3fv(en[5][7]); gl.glTexCoord2fv(tep[5][7]); gl.glVertex3fv(ep[5][7]);
+ gl.glNormal3fv(en[4][8]); gl.glTexCoord2fv(tep[4][8]); gl.glVertex3fv(ep[4][8]);
+ gl.glNormal3fv(en[5][8]); gl.glTexCoord2fv(tep[5][8]); gl.glVertex3fv(ep[5][8]);
+ gl.glEnd();
+ gl.glBegin(GL_TRIANGLE_STRIP);
+ gl.glNormal3fv(en[5][0]); gl.glTexCoord2fv(tep[5][0]); gl.glVertex3fv(ep[5][0]);
+ gl.glNormal3fv(en[6][0]); gl.glTexCoord2fv(tep[6][0]); gl.glVertex3fv(ep[6][0]);
+ gl.glNormal3fv(en[5][1]); gl.glTexCoord2fv(tep[5][1]); gl.glVertex3fv(ep[5][1]);
+ gl.glNormal3fv(en[6][1]); gl.glTexCoord2fv(tep[6][1]); gl.glVertex3fv(ep[6][1]);
+ gl.glNormal3fv(en[5][2]); gl.glTexCoord2fv(tep[5][2]); gl.glVertex3fv(ep[5][2]);
+ gl.glNormal3fv(en[6][2]); gl.glTexCoord2fv(tep[6][2]); gl.glVertex3fv(ep[6][2]);
+ gl.glNormal3fv(en[5][3]); gl.glTexCoord2fv(tep[5][3]); gl.glVertex3fv(ep[5][3]);
+ gl.glNormal3fv(en[6][3]); gl.glTexCoord2fv(tep[6][3]); gl.glVertex3fv(ep[6][3]);
+ gl.glNormal3fv(en[5][4]); gl.glTexCoord2fv(tep[5][4]); gl.glVertex3fv(ep[5][4]);
+ gl.glNormal3fv(en[6][4]); gl.glTexCoord2fv(tep[6][4]); gl.glVertex3fv(ep[6][4]);
+ gl.glNormal3fv(en[5][5]); gl.glTexCoord2fv(tep[5][5]); gl.glVertex3fv(ep[5][5]);
+ gl.glNormal3fv(en[6][5]); gl.glTexCoord2fv(tep[6][5]); gl.glVertex3fv(ep[6][5]);
+ gl.glNormal3fv(en[5][6]); gl.glTexCoord2fv(tep[5][6]); gl.glVertex3fv(ep[5][6]);
+ gl.glNormal3fv(en[6][6]); gl.glTexCoord2fv(tep[6][6]); gl.glVertex3fv(ep[6][6]);
+ gl.glNormal3fv(en[5][7]); gl.glTexCoord2fv(tep[5][7]); gl.glVertex3fv(ep[5][7]);
+ gl.glNormal3fv(en[6][7]); gl.glTexCoord2fv(tep[6][7]); gl.glVertex3fv(ep[6][7]);
+ gl.glNormal3fv(en[5][8]); gl.glTexCoord2fv(tep[5][8]); gl.glVertex3fv(ep[5][8]);
+ gl.glNormal3fv(en[6][8]); gl.glTexCoord2fv(tep[6][8]); gl.glVertex3fv(ep[6][8]);
+ gl.glEnd();
+ gl.glEndList();
+ }
+
+ private void BuildLogo()
+ {
+ gl.glNewList(logo, GL_COMPILE);
+ gl.glTranslatef(5.5f, -3.5f, 4.5f);
+ gl.glTranslatef(0.0f, 0.0f, -7.0f);
+ gl.glCallList(doubleCylinder);
+ BendForward();
+ gl.glCallList(elbow);
+ gl.glTranslatef(0.0f, 0.0f, -7.0f);
+ gl.glCallList(doubleCylinder);
+ BendForward();
+ gl.glCallList(elbow);
+ gl.glTranslatef(0.0f, 0.0f, -5.0f);
+ gl.glCallList(singleCylinder);
+ BendRight();
+ gl.glCallList(elbow);
+ gl.glTranslatef(0.0f, 0.0f, -7.0f);
+ gl.glCallList(doubleCylinder);
+ BendForward();
+ gl.glCallList(elbow);
+ gl.glTranslatef(0.0f, 0.0f, -7.0f);
+ gl.glCallList(doubleCylinder);
+ BendForward();
+ gl.glCallList(elbow);
+ gl.glTranslatef(0.0f, 0.0f, -5.0f);
+ gl.glCallList(singleCylinder);
+ BendLeft();
+ gl.glCallList(elbow);
+ gl.glTranslatef(0.0f, 0.0f, -7.0f);
+ gl.glCallList(doubleCylinder);
+ BendForward();
+ gl.glCallList(elbow);
+ gl.glTranslatef(0.0f, 0.0f, -7.0f);
+ gl.glCallList(doubleCylinder);
+ BendForward();
+ gl.glCallList(elbow);
+ gl.glTranslatef(0.0f, 0.0f, -5.0f);
+ gl.glCallList(singleCylinder);
+ BendRight();
+ gl.glCallList(elbow);
+ gl.glTranslatef(0.0f, 0.0f, -7.0f);
+ gl.glCallList(doubleCylinder);
+ BendForward();
+ gl.glCallList(elbow);
+ gl.glTranslatef(0.0f, 0.0f, -7.0f);
+ gl.glCallList(doubleCylinder);
+ BendForward();
+ gl.glCallList(elbow);
+ gl.glTranslatef(0.0f, 0.0f, -5.0f);
+ gl.glCallList(singleCylinder);
+ BendLeft();
+ gl.glCallList(elbow);
+ gl.glTranslatef(0.0f, 0.0f, -7.0f);
+ gl.glCallList(doubleCylinder);
+ BendForward();
+ gl.glCallList(elbow);
+ gl.glTranslatef(0.0f, 0.0f, -7.0f);
+ gl.glCallList(doubleCylinder);
+ BendForward();
+ gl.glCallList(elbow);
+ gl.glTranslatef(0.0f, 0.0f, -5.0f);
+ gl.glCallList(singleCylinder);
+ BendRight();
+ gl.glCallList(elbow);
+ gl.glTranslatef(0.0f, 0.0f, -7.0f);
+ gl.glCallList(doubleCylinder);
+ BendForward();
+ gl.glCallList(elbow);
+ gl.glTranslatef(0.0f, 0.0f, -7.0f);
+ gl.glCallList(doubleCylinder);
+ BendForward();
+ gl.glCallList(elbow);
+ gl.glTranslatef(0.0f, 0.0f, -5.0f);
+ gl.glCallList(singleCylinder);
+ BendLeft();
+ gl.glCallList(elbow);
+ gl.glEndList();
+ }
+
+ private void BuildLists()
+ {
+ singleCylinder = gl.glGenLists(1);
+ doubleCylinder = gl.glGenLists(1);
+ elbow = gl.glGenLists(1);
+ logo = gl.glGenLists(1);
+ BuildSingleCylinder();
+ BuildDoubleCylinder();
+ BuildElbow();
+ BuildLogo();
+ }
+
+ // Methods required for the implementation of MouseListener
+ public void mouseEntered( MouseEvent evt )
+ {
+ Component comp = evt.getComponent();
+ if( comp.equals(this ) )
+ {
+ requestFocus();
+ }
+ }
+
+ public void mouseExited( MouseEvent evt )
+ { }
+ public void mousePressed( MouseEvent evt )
+ { }
+ public void mouseReleased( MouseEvent evt )
+ { }
+ public void mouseClicked( MouseEvent evt )
+ {
+ Component comp = evt.getComponent();
+ if( comp.equals(this ) )
+ {
+ requestFocus();
+ }
+ }
+ }
+}
diff --git a/demos/RonsDemos/logo_plugin13.html b/demos/RonsDemos/logo_plugin13.html new file mode 100644 index 0000000..45fcee6 --- /dev/null +++ b/demos/RonsDemos/logo_plugin13.html @@ -0,0 +1,76 @@ +<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.61 [en] (Win98; U) [Netscape]">
+ <title>Logo (author unknown); ported to Java by Ron Cemer</title>
+</head>
+<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#e6e6ff">
+Logo applet
+<br>Originial author unknown
+<br>Ported to Java by Ron Cemer
+<br>SEE BELOW FOR INSTRUCTIONS.
+<br>
+<!--"CONVERTED_APPLET"-->
+<!-- CONVERTER VERSION 1.3 --> +<SCRIPT LANGUAGE="JavaScript"><!-- + var _info = navigator.userAgent; var _ns = false; + var _ie = (_info.indexOf("MSIE") > 0 && _info.indexOf("Win") > 0 && _info.indexOf("Windows 3.1") < 0); +//--></SCRIPT> +<COMMENT><SCRIPT LANGUAGE="JavaScript1.1"><!-- + var _ns = (navigator.appName.indexOf("Netscape") >= 0 && ((_info.indexOf("Win") > 0 && _info.indexOf("Win16") < 0 && java.lang.System.getProperty("os.version").indexOf("3.5") < 0) || (_info.indexOf("Sun") > 0) || (_info.indexOf("Linux") > 0))); +//--></SCRIPT></COMMENT> + +<SCRIPT LANGUAGE="JavaScript"><!-- + if (_ie == true) document.writeln('<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" WIDTH = 400 HEIGHT = 400 codebase="http://java.sun.com/products/plugin/1.3/jinstall-13-win32.cab#Version=1,3,0,0"><NOEMBED><XMP>'); + else if (_ns == true) document.writeln('<EMBED type="application/x-java-applet;version=1.3" CODE = "logo.class" WIDTH = 400 HEIGHT = 400 scriptable=false pluginspage="http://java.sun.com/products/plugin/1.3/plugin-install.html"><NOEMBED><XMP>'); +//--></SCRIPT> +<APPLET CODE = "logo.class" WIDTH = 400 HEIGHT = 400></XMP> +<PARAM NAME = CODE VALUE = "logo.class" >
+ +<PARAM NAME="type" VALUE="application/x-java-applet;version=1.3"> +<PARAM NAME="scriptable" VALUE="false"> + +</APPLET> + +</NOEMBED></EMBED></OBJECT> + + +<!-- +<APPLET CODE = "logo.class" WIDTH = 400 HEIGHT = 400>
+
+
+</APPLET> +--> +<!--"END_CONVERTED_APPLET"-->
+
+<br>Click inside the window, then press any of the following keys:
+<br>Up/down arrows: move the clipping plane in or out
+<br>Left/right arrows: rotate the model
+<br>z/Z: translate (move) the model in or out
+<br>1: render points only
+<br>2: render line drawing
+<br>3: render polygons
+<br>4: enable polygon smoothing
+<br>5: disable polygon smoothing
+<br>6: enable dithering
+<br>7: disable dithering
+<br>8: enable polygon stippling
+<br>9: disable polygon stippling
+<br>-: smooth shading
+<br>=: flat shading
+<br>q: disable culling
+<br>w: cull backfaces
+<br>e: cull frontfaces
+<br>r: frontfaces are counterclockwise (CCW)
+<br>t: frontfaces are clockwise (CW)
+<br>y/u: change stippling pattern
+<br>a: enable texturing; use brick texture
+<br>s: enable texturing; use checkered texture
+<br>d: disable texturing
+<br>f: texure modulate mode
+<br>g: texure decal mode
+<br>
+<hr>
+</body>
+</html>
diff --git a/demos/RonsDemos/material.html b/demos/RonsDemos/material.html new file mode 100644 index 0000000..b740970 --- /dev/null +++ b/demos/RonsDemos/material.html @@ -0,0 +1,17 @@ +<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.61 [en] (Win98; U) [Netscape]">
+ <title>Material by Silicon Graphics; ported to Java by Ron Cemer</title>
+</head>
+<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#e6e6ff">
+Material applet
+<br>Originially written by Silicon Graphics
+<br>Ported to Java by Ron Cemer
+<br>
+<applet code="material.class" width=400 height=400>
+</applet>
+<hr>
+</body>
+</html>
diff --git a/demos/RonsDemos/material.java b/demos/RonsDemos/material.java new file mode 100644 index 0000000..2558c84 --- /dev/null +++ b/demos/RonsDemos/material.java @@ -0,0 +1,416 @@ +/**
+ * @(#) material.java
+ * @(#) author: Silicon Graphics (converted to Java by Ron Cemer)
+ */
+
+/*
+ * Copyright (c) 1993-1997, Silicon Graphics, Inc.
+ * ALL RIGHTS RESERVED
+ * Permission to use, copy, modify, and distribute this software for
+ * any purpose and without fee is hereby granted, provided that the above
+ * copyright notice appear in all copies and that both the copyright notice
+ * and this permission notice appear in supporting documentation, and that
+ * the name of Silicon Graphics, Inc. not be used in advertising
+ * or publicity pertaining to distribution of the software without specific,
+ * written prior permission.
+ *
+ * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
+ * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
+ * FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
+ * GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT,
+ * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY
+ * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION,
+ * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF
+ * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN
+ * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
+ * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * US Government Users Restricted Rights
+ * Use, duplication, or disclosure by the Government is subject to
+ * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
+ * (c)(1)(ii) of the Rights in Technical Data and Computer Software
+ * clause at DFARS 252.227-7013 and/or in similar or successor
+ * clauses in the FAR or the DOD or NASA FAR Supplement.
+ * Unpublished-- rights reserved under the copyright laws of the
+ * United States. Contractor/manufacturer is Silicon Graphics,
+ * Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311.
+ *
+ * OpenGL(R) is a registered trademark of Silicon Graphics, Inc.
+ */
+
+/*
+ * This program demonstrates the use of the GL lighting model.
+ * Several objects are drawn using different material characteristics.
+ * A single light source illuminates the objects.
+ */
+
+import java.applet.*;
+import java.awt.*;
+import java.awt.event.*;
+import java.lang.*;
+import java.util.*;
+import java.io.*;
+import java.util.*;
+import gl4java.GLContext;
+import gl4java.awt.GLCanvas;
+
+public class material extends Applet
+{
+ materialCanvas canvas = null;
+
+
+ /* Initialize the applet */
+
+
+ public void init()
+ {
+ Dimension d = getSize();
+ setLayout(new BorderLayout());
+ canvas = new materialCanvas(d.width, d.height);
+ add("Center", canvas);
+ }
+
+
+ /* Start the applet */
+
+
+ public void start()
+ {
+ }
+
+
+ /* Stop the applet */
+
+
+ public void stop()
+ {
+ }
+
+
+ /* Destroy the applet */
+
+
+ public void destroy()
+ {
+ canvas.cvsDispose();
+ }
+
+
+ /* Local GLCanvas extension class */
+
+
+ private class materialCanvas extends GLCanvas
+ {
+ public materialCanvas(int w, int h)
+ {
+ super(w, h);
+ GLContext.gljNativeDebug = false;
+ GLContext.gljClassDebug = false;
+ }
+
+ public void preInit()
+ {
+ doubleBuffer = true;
+ stereoView = false;
+ }
+
+ public void init()
+ {
+ System.out.println("init(): " + this);
+ reshape(getSize().width, getSize().height);
+
+ float ambient[] = { 0.0f, 0.0f, 0.0f, 1.0f };
+ float diffuse[] = { 1.0f, 1.0f, 1.0f, 1.0f };
+ float specular[] = { 1.0f, 1.0f, 1.0f, 1.0f };
+ float position[] = { 0.0f, 3.0f, 2.0f, 0.0f };
+ float lmodel_ambient[] = { 0.4f, 0.4f, 0.4f, 1.0f };
+ float local_view[] = { 0.0f };
+
+ gl.glClearColor(0.0f, 0.1f, 0.1f, 0.0f);
+ gl.glEnable(GL_DEPTH_TEST);
+ gl.glShadeModel(GL_SMOOTH);
+
+ gl.glLightfv(GL_LIGHT0, GL_AMBIENT, ambient);
+ gl.glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse);
+ gl.glLightfv(GL_LIGHT0, GL_POSITION, position);
+ gl.glLightModelfv(GL_LIGHT_MODEL_AMBIENT, lmodel_ambient);
+ gl.glLightModelfv(GL_LIGHT_MODEL_LOCAL_VIEWER, local_view);
+
+ gl.glEnable(GL_LIGHTING);
+ gl.glEnable(GL_LIGHT0);
+
+ glj.gljCheckGL();
+ }
+
+ public void cvsDispose()
+ {
+ System.out.println("destroy(): " + this);
+ super.cvsDispose();
+ }
+
+ public void reshape(int width, int height)
+ {
+ gl.glViewport(0,0,width,height);
+ gl.glMatrixMode(GL_PROJECTION);
+ gl.glLoadIdentity();
+ if (width <= (height * 2))
+ gl.glOrtho
+ (-6.0f,
+ 6.0f,
+ -3.0f*((float)(height*2))/(float)width,
+ 3.0f*((float)(height*2))/(float)width,
+ -10.0f,
+ 10.0f);
+ else
+ gl.glOrtho
+ (-6.0f*(float)width/((float)(height*2)),
+ 6.0f*(float)width/((float)(height*2)),
+ -3.0f,
+ 3.0f,
+ -10.0f,
+ 10.0f);
+ gl.glMatrixMode(GL_MODELVIEW);
+ gl.glLoadIdentity();
+ }
+
+ public void display()
+ {
+ if (glj.gljMakeCurrent() == false) return;
+
+ float no_mat[] = { 0.0f, 0.0f, 0.0f, 1.0f };
+ float mat_ambient[] = { 0.7f, 0.7f, 0.7f, 1.0f };
+ float mat_ambient_color[] = { 0.8f, 0.8f, 0.2f, 1.0f };
+ float mat_diffuse[] = { 0.1f, 0.5f, 0.8f, 1.0f };
+ float mat_specular[] = { 1.0f, 1.0f, 1.0f, 1.0f };
+ float no_shininess[] = { 0.0f };
+ float low_shininess[] = { 5.0f };
+ float high_shininess[] = { 100.0f };
+ float mat_emission[] = {0.3f, 0.2f, 0.2f, 0.0f};
+ int qobj;
+
+ gl.glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+ /* draw sphere in first row, first column
+ * diffuse reflection only; no ambient or specular
+ */
+ gl.glPushMatrix();
+ gl.glTranslatef (-3.75f, 3.0f, 0.0f);
+ gl.glMaterialfv(GL_FRONT, GL_AMBIENT, no_mat);
+ gl.glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse);
+ gl.glMaterialfv(GL_FRONT, GL_SPECULAR, no_mat);
+ gl.glMaterialfv(GL_FRONT, GL_SHININESS, no_shininess);
+ gl.glMaterialfv(GL_FRONT, GL_EMISSION, no_mat);
+ qobj = glu.gluNewQuadric();
+ glu.gluQuadricOrientation(qobj,GLU_OUTSIDE);
+ glu.gluQuadricNormals(qobj,GLU_SMOOTH);
+ glu.gluQuadricTexture(qobj,false);
+ glu.gluSphere(qobj,1.0f,16,16);
+ glu.gluDeleteQuadric(qobj);
+ gl.glPopMatrix();
+
+ /* draw sphere in first row, second column
+ * diffuse and specular reflection; low shininess; no ambient
+ */
+ gl.glPushMatrix();
+ gl.glTranslatef(-1.25f, 3.0f, 0.0f);
+ gl.glMaterialfv(GL_FRONT, GL_AMBIENT, no_mat);
+ gl.glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse);
+ gl.glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular);
+ gl.glMaterialfv(GL_FRONT, GL_SHININESS, low_shininess);
+ gl.glMaterialfv(GL_FRONT, GL_EMISSION, no_mat);
+ qobj = glu.gluNewQuadric();
+ glu.gluQuadricOrientation(qobj,GLU_OUTSIDE);
+ glu.gluQuadricNormals(qobj,GLU_SMOOTH);
+ glu.gluQuadricTexture(qobj,false);
+ glu.gluSphere(qobj,1.0f,16,16);
+ glu.gluDeleteQuadric(qobj);
+ gl.glPopMatrix();
+
+ /* draw sphere in first row, third column
+ * diffuse and specular reflection; high shininess; no ambient
+ */
+ gl.glPushMatrix();
+ gl.glTranslatef(1.25f, 3.0f, 0.0f);
+ gl.glMaterialfv(GL_FRONT, GL_AMBIENT, no_mat);
+ gl.glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse);
+ gl.glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular);
+ gl.glMaterialfv(GL_FRONT, GL_SHININESS, high_shininess);
+ gl.glMaterialfv(GL_FRONT, GL_EMISSION, no_mat);
+ qobj = glu.gluNewQuadric();
+ glu.gluQuadricOrientation(qobj,GLU_OUTSIDE);
+ glu.gluQuadricNormals(qobj,GLU_SMOOTH);
+ glu.gluQuadricTexture(qobj,false);
+ glu.gluSphere(qobj,1.0f,16,16);
+ glu.gluDeleteQuadric(qobj);
+ gl.glPopMatrix();
+
+ /* draw sphere in first row, fourth column
+ * diffuse reflection; emission; no ambient or specular reflection
+ */
+ gl.glPushMatrix();
+ gl.glTranslatef(3.75f, 3.0f, 0.0f);
+ gl.glMaterialfv(GL_FRONT, GL_AMBIENT, no_mat);
+ gl.glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse);
+ gl.glMaterialfv(GL_FRONT, GL_SPECULAR, no_mat);
+ gl.glMaterialfv(GL_FRONT, GL_SHININESS, no_shininess);
+ gl.glMaterialfv(GL_FRONT, GL_EMISSION, mat_emission);
+ qobj = glu.gluNewQuadric();
+ glu.gluQuadricOrientation(qobj,GLU_OUTSIDE);
+ glu.gluQuadricNormals(qobj,GLU_SMOOTH);
+ glu.gluQuadricTexture(qobj,false);
+ glu.gluSphere(qobj,1.0f,16,16);
+ glu.gluDeleteQuadric(qobj);
+ gl.glPopMatrix();
+
+ /* draw sphere in second row, first column
+ * ambient and diffuse reflection; no specular
+ */
+ gl.glPushMatrix();
+ gl.glTranslatef(-3.75f, 0.0f, 0.0f);
+ gl.glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient);
+ gl.glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse);
+ gl.glMaterialfv(GL_FRONT, GL_SPECULAR, no_mat);
+ gl.glMaterialfv(GL_FRONT, GL_SHININESS, no_shininess);
+ gl.glMaterialfv(GL_FRONT, GL_EMISSION, no_mat);
+ qobj = glu.gluNewQuadric();
+ glu.gluQuadricOrientation(qobj,GLU_OUTSIDE);
+ glu.gluQuadricNormals(qobj,GLU_SMOOTH);
+ glu.gluQuadricTexture(qobj,false);
+ glu.gluSphere(qobj,1.0f,16,16);
+ glu.gluDeleteQuadric(qobj);
+ gl.glPopMatrix();
+
+ /* draw sphere in second row, second column
+ * ambient, diffuse and specular reflection; low shininess
+ */
+ gl.glPushMatrix();
+ gl.glTranslatef(-1.25f, 0.0f, 0.0f);
+ gl.glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient);
+ gl.glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse);
+ gl.glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular);
+ gl.glMaterialfv(GL_FRONT, GL_SHININESS, low_shininess);
+ gl.glMaterialfv(GL_FRONT, GL_EMISSION, no_mat);
+ qobj = glu.gluNewQuadric();
+ glu.gluQuadricOrientation(qobj,GLU_OUTSIDE);
+ glu.gluQuadricNormals(qobj,GLU_SMOOTH);
+ glu.gluQuadricTexture(qobj,false);
+ glu.gluSphere(qobj,1.0f,16,16);
+ glu.gluDeleteQuadric(qobj);
+ gl.glPopMatrix();
+
+ /* draw sphere in second row, third column
+ * ambient, diffuse and specular reflection; high shininess
+ */
+ gl.glPushMatrix();
+ gl.glTranslatef(1.25f, 0.0f, 0.0f);
+ gl.glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient);
+ gl.glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse);
+ gl.glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular);
+ gl.glMaterialfv(GL_FRONT, GL_SHININESS, high_shininess);
+ gl.glMaterialfv(GL_FRONT, GL_EMISSION, no_mat);
+ qobj = glu.gluNewQuadric();
+ glu.gluQuadricOrientation(qobj,GLU_OUTSIDE);
+ glu.gluQuadricNormals(qobj,GLU_SMOOTH);
+ glu.gluQuadricTexture(qobj,false);
+ glu.gluSphere(qobj,1.0f,16,16);
+ glu.gluDeleteQuadric(qobj);
+ gl.glPopMatrix();
+
+ /* draw sphere in second row, fourth column
+ * ambient and diffuse reflection; emission; no specular
+ */
+ gl.glPushMatrix();
+ gl.glTranslatef(3.75f, 0.0f, 0.0f);
+ gl.glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient);
+ gl.glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse);
+ gl.glMaterialfv(GL_FRONT, GL_SPECULAR, no_mat);
+ gl.glMaterialfv(GL_FRONT, GL_SHININESS, no_shininess);
+ gl.glMaterialfv(GL_FRONT, GL_EMISSION, mat_emission);
+ qobj = glu.gluNewQuadric();
+ glu.gluQuadricOrientation(qobj,GLU_OUTSIDE);
+ glu.gluQuadricNormals(qobj,GLU_SMOOTH);
+ glu.gluQuadricTexture(qobj,false);
+ glu.gluSphere(qobj,1.0f,16,16);
+ glu.gluDeleteQuadric(qobj);
+ gl.glPopMatrix();
+
+ /* draw sphere in third row, first column
+ * colored ambient and diffuse reflection; no specular
+ */
+ gl.glPushMatrix();
+ gl.glTranslatef(-3.75f, -3.0f, 0.0f);
+ gl.glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient_color);
+ gl.glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse);
+ gl.glMaterialfv(GL_FRONT, GL_SPECULAR, no_mat);
+ gl.glMaterialfv(GL_FRONT, GL_SHININESS, no_shininess);
+ gl.glMaterialfv(GL_FRONT, GL_EMISSION, no_mat);
+ qobj = glu.gluNewQuadric();
+ glu.gluQuadricOrientation(qobj,GLU_OUTSIDE);
+ glu.gluQuadricNormals(qobj,GLU_SMOOTH);
+ glu.gluQuadricTexture(qobj,false);
+ glu.gluSphere(qobj,1.0f,16,16);
+ glu.gluDeleteQuadric(qobj);
+ gl.glPopMatrix();
+
+ /* draw sphere in third row, second column
+ * colored ambient, diffuse and specular reflection; low shininess
+ */
+ gl.glPushMatrix();
+ gl.glTranslatef(-1.25f, -3.0f, 0.0f);
+ gl.glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient_color);
+ gl.glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse);
+ gl.glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular);
+ gl.glMaterialfv(GL_FRONT, GL_SHININESS, low_shininess);
+ gl.glMaterialfv(GL_FRONT, GL_EMISSION, no_mat);
+ qobj = glu.gluNewQuadric();
+ glu.gluQuadricOrientation(qobj,GLU_OUTSIDE);
+ glu.gluQuadricNormals(qobj,GLU_SMOOTH);
+ glu.gluQuadricTexture(qobj,false);
+ glu.gluSphere(qobj,1.0f,16,16);
+ glu.gluDeleteQuadric(qobj);
+ gl.glPopMatrix();
+
+ /* draw sphere in third row, third column
+ * colored ambient, diffuse and specular reflection; high shininess
+ */
+ gl.glPushMatrix();
+ gl.glTranslatef(1.25f, -3.0f, 0.0f);
+ gl.glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient_color);
+ gl.glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse);
+ gl.glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular);
+ gl.glMaterialfv(GL_FRONT, GL_SHININESS, high_shininess);
+ gl.glMaterialfv(GL_FRONT, GL_EMISSION, no_mat);
+ qobj = glu.gluNewQuadric();
+ glu.gluQuadricOrientation(qobj,GLU_OUTSIDE);
+ glu.gluQuadricNormals(qobj,GLU_SMOOTH);
+ glu.gluQuadricTexture(qobj,false);
+ glu.gluSphere(qobj,1.0f,16,16);
+ glu.gluDeleteQuadric(qobj);
+ gl.glPopMatrix();
+
+ /* draw sphere in third row, fourth column
+ * colored ambient and diffuse reflection; emission; no specular
+ */
+ gl.glPushMatrix();
+ gl.glTranslatef(3.75f, -3.0f, 0.0f);
+ gl.glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient_color);
+ gl.glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse);
+ gl.glMaterialfv(GL_FRONT, GL_SPECULAR, no_mat);
+ gl.glMaterialfv(GL_FRONT, GL_SHININESS, no_shininess);
+ gl.glMaterialfv(GL_FRONT, GL_EMISSION, mat_emission);
+ qobj = glu.gluNewQuadric();
+ glu.gluQuadricOrientation(qobj,GLU_OUTSIDE);
+ glu.gluQuadricNormals(qobj,GLU_SMOOTH);
+ glu.gluQuadricTexture(qobj,false);
+ glu.gluSphere(qobj,1.0f,16,16);
+ glu.gluDeleteQuadric(qobj);
+ gl.glPopMatrix();
+
+ glj.gljSwap();
+ glj.gljCheckGL();
+ glj.gljFree();
+ }
+ }
+}
diff --git a/demos/RonsDemos/material_plugin13.html b/demos/RonsDemos/material_plugin13.html new file mode 100644 index 0000000..07b01bb --- /dev/null +++ b/demos/RonsDemos/material_plugin13.html @@ -0,0 +1,48 @@ +<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.61 [en] (Win98; U) [Netscape]">
+ <title>Material by Silicon Graphics; ported to Java by Ron Cemer</title>
+</head>
+<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#e6e6ff">
+Material applet
+<br>Originially written by Silicon Graphics
+<br>Ported to Java by Ron Cemer
+<br>
+<!--"CONVERTED_APPLET"-->
+<!-- CONVERTER VERSION 1.3 --> +<SCRIPT LANGUAGE="JavaScript"><!-- + var _info = navigator.userAgent; var _ns = false; + var _ie = (_info.indexOf("MSIE") > 0 && _info.indexOf("Win") > 0 && _info.indexOf("Windows 3.1") < 0); +//--></SCRIPT> +<COMMENT><SCRIPT LANGUAGE="JavaScript1.1"><!-- + var _ns = (navigator.appName.indexOf("Netscape") >= 0 && ((_info.indexOf("Win") > 0 && _info.indexOf("Win16") < 0 && java.lang.System.getProperty("os.version").indexOf("3.5") < 0) || (_info.indexOf("Sun") > 0) || (_info.indexOf("Linux") > 0))); +//--></SCRIPT></COMMENT> + +<SCRIPT LANGUAGE="JavaScript"><!-- + if (_ie == true) document.writeln('<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" WIDTH = 400 HEIGHT = 400 codebase="http://java.sun.com/products/plugin/1.3/jinstall-13-win32.cab#Version=1,3,0,0"><NOEMBED><XMP>'); + else if (_ns == true) document.writeln('<EMBED type="application/x-java-applet;version=1.3" CODE = "material.class" WIDTH = 400 HEIGHT = 400 scriptable=false pluginspage="http://java.sun.com/products/plugin/1.3/plugin-install.html"><NOEMBED><XMP>'); +//--></SCRIPT> +<APPLET CODE = "material.class" WIDTH = 400 HEIGHT = 400></XMP> +<PARAM NAME = CODE VALUE = "material.class" >
+ +<PARAM NAME="type" VALUE="application/x-java-applet;version=1.3"> +<PARAM NAME="scriptable" VALUE="false"> + +</APPLET> + +</NOEMBED></EMBED></OBJECT> + + +<!-- +<APPLET CODE = "material.class" WIDTH = 400 HEIGHT = 400>
+
+
+</APPLET> +--> +<!--"END_CONVERTED_APPLET"-->
+
+<hr>
+</body>
+</html>
diff --git a/demos/RonsDemos/mipmap.html b/demos/RonsDemos/mipmap.html new file mode 100644 index 0000000..e61d18e --- /dev/null +++ b/demos/RonsDemos/mipmap.html @@ -0,0 +1,17 @@ +<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.61 [en] (Win98; U) [Netscape]">
+ <title>Mipmap by Silicon Graphics; ported to Java by Ron Cemer</title>
+</head>
+<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#e6e6ff">
+Mipmap applet
+<br>Originially written by Silicon Graphics
+<br>Ported to Java by Ron Cemer
+<br>
+<applet code="mipmap.class" width=400 height=400>
+</applet>
+<hr>
+</body>
+</html>
diff --git a/demos/RonsDemos/mipmap.java b/demos/RonsDemos/mipmap.java new file mode 100644 index 0000000..7d5f233 --- /dev/null +++ b/demos/RonsDemos/mipmap.java @@ -0,0 +1,317 @@ +/**
+ * @(#) mipmap.java
+ * @(#) author: Silicon Graphics, Inc. (converted to Java by Ron Cemer)
+ */
+
+/*
+ * Copyright (c) 1993-1997, Silicon Graphics, Inc.
+ * ALL RIGHTS RESERVED
+ * Permission to use, copy, modify, and distribute this software for
+ * any purpose and without fee is hereby granted, provided that the above
+ * copyright notice appear in all copies and that both the copyright notice
+ * and this permission notice appear in supporting documentation, and that
+ * the name of Silicon Graphics, Inc. not be used in advertising
+ * or publicity pertaining to distribution of the software without specific,
+ * written prior permission.
+ *
+ * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
+ * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
+ * FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
+ * GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT,
+ * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY
+ * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION,
+ * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF
+ * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN
+ * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
+ * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * US Government Users Restricted Rights
+ * Use, duplication, or disclosure by the Government is subject to
+ * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
+ * (c)(1)(ii) of the Rights in Technical Data and Computer Software
+ * clause at DFARS 252.227-7013 and/or in similar or successor
+ * clauses in the FAR or the DOD or NASA FAR Supplement.
+ * Unpublished-- rights reserved under the copyright laws of the
+ * United States. Contractor/manufacturer is Silicon Graphics,
+ * Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311.
+ *
+ * OpenGL(R) is a registered trademark of Silicon Graphics, Inc.
+ */
+
+/* mipmap.c
+ * This program demonstrates using mipmaps for texture maps.
+ * To overtly show the effect of mipmaps, each mipmap reduction
+ * level has a solidly colored, contrasting texture image.
+ * Thus, the quadrilateral which is drawn is drawn with several
+ * different colors.
+ */
+
+import java.applet.*;
+import java.awt.*;
+import java.awt.event.*;
+import java.lang.*;
+import java.util.*;
+import java.io.*;
+import java.util.*;
+import gl4java.GLContext;
+import gl4java.awt.GLCanvas;
+
+public class mipmap extends Applet
+{
+ mipmapCanvas canvas = null;
+
+
+ /* Initialize the applet */
+
+
+ public void init()
+ {
+ Dimension d = getSize();
+ setLayout(new BorderLayout());
+ canvas = new mipmapCanvas(d.width, d.height);
+ add("Center", canvas);
+ }
+
+
+ /* Start the applet */
+
+
+ public void start()
+ {
+ }
+
+
+ /* Stop the applet */
+
+
+ public void stop()
+ {
+ }
+
+
+ /* Destroy the applet */
+
+
+ public void destroy()
+ {
+ canvas.cvsDispose();
+ }
+
+
+ /* Local GLCanvas extension class */
+
+
+ private class mipmapCanvas extends GLCanvas
+ {
+ byte mipmapImage32[] = new byte[32*32*4];
+ byte mipmapImage16[] = new byte[16*16*4];
+ byte mipmapImage8[] = new byte[8*8*4];
+ byte mipmapImage4[] = new byte[4*4*4];
+ byte mipmapImage2[] = new byte[2*2*4];
+ byte mipmapImage1[] = new byte[1*1*4];
+ int texName;
+
+ public mipmapCanvas(int w, int h)
+ {
+ super(w, h);
+ GLContext.gljNativeDebug = false;
+ GLContext.gljClassDebug = false;
+ }
+
+ public void preInit()
+ {
+ doubleBuffer = true;
+ stereoView = false;
+ }
+
+ public void init()
+ {
+ System.out.println("init(): " + this);
+ reshape(getSize().width, getSize().height);
+
+ gl.glEnable(GL_DEPTH_TEST);
+ gl.glShadeModel(GL_FLAT);
+
+ gl.glTranslatef(0.0f, 0.0f, -3.6f);
+ makeImages();
+ gl.glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
+
+ int tnbuf[] = new int[1];
+ gl.glGenTextures(1, tnbuf);
+ texName = tnbuf[0];
+ gl.glBindTexture(GL_TEXTURE_2D, texName);
+ gl.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
+ gl.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
+ gl.glTexParameteri
+ (GL_TEXTURE_2D,
+ GL_TEXTURE_MAG_FILTER,
+ GL_NEAREST);
+ gl.glTexParameteri
+ (GL_TEXTURE_2D,
+ GL_TEXTURE_MIN_FILTER,
+ GL_NEAREST_MIPMAP_NEAREST);
+ gl.glTexImage2D
+ (GL_TEXTURE_2D,
+ 0,
+ GL_RGBA,
+ 32,
+ 32,
+ 0,
+ GL_RGBA,
+ GL_UNSIGNED_BYTE,
+ mipmapImage32);
+ gl.glTexImage2D
+ (GL_TEXTURE_2D,
+ 1,
+ GL_RGBA,
+ 16,
+ 16,
+ 0,
+ GL_RGBA,
+ GL_UNSIGNED_BYTE,
+ mipmapImage16);
+ gl.glTexImage2D
+ (GL_TEXTURE_2D,
+ 2,
+ GL_RGBA,
+ 8,
+ 8,
+ 0,
+ GL_RGBA,
+ GL_UNSIGNED_BYTE,
+ mipmapImage8);
+ gl.glTexImage2D
+ (GL_TEXTURE_2D,
+ 3,
+ GL_RGBA,
+ 4,
+ 4,
+ 0,
+ GL_RGBA,
+ GL_UNSIGNED_BYTE,
+ mipmapImage4);
+ gl.glTexImage2D
+ (GL_TEXTURE_2D,
+ 4,
+ GL_RGBA,
+ 2,
+ 2,
+ 0,
+ GL_RGBA,
+ GL_UNSIGNED_BYTE,
+ mipmapImage2);
+ gl.glTexImage2D
+ (GL_TEXTURE_2D,
+ 5,
+ GL_RGBA,
+ 1,
+ 1,
+ 0,
+ GL_RGBA,
+ GL_UNSIGNED_BYTE,
+ mipmapImage1);
+
+ gl.glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL);
+ gl.glEnable(GL_TEXTURE_2D);
+
+ glj.gljCheckGL();
+ }
+
+ public void cvsDispose()
+ {
+ System.out.println("destroy(): " + this);
+ super.cvsDispose();
+ }
+
+ public void reshape(int width, int height)
+ {
+ gl.glViewport(0,0,width,height);
+ gl.glMatrixMode(GL_PROJECTION);
+ gl.glLoadIdentity();
+ glu.gluPerspective(60.0f,(float)width/(float)height,1.0f,30000.0f);
+ gl.glMatrixMode(GL_MODELVIEW);
+ gl.glLoadIdentity();
+ }
+
+ public void display()
+ {
+ if (glj.gljMakeCurrent() == false) return;
+
+ gl.glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+ gl.glBindTexture(GL_TEXTURE_2D, texName);
+ gl.glBegin(GL_QUADS);
+ gl.glTexCoord2f(0.0f,0.0f); gl.glVertex3f(-2.0f,-1.0f,0.0f);
+ gl.glTexCoord2f(0.0f,8.0f); gl.glVertex3f(-2.0f,1.0f,0.0f);
+ gl.glTexCoord2f(8.0f,8.0f); gl.glVertex3f(2000.0f,1.0f,-6000.0f);
+ gl.glTexCoord2f(8.0f,0.0f); gl.glVertex3f(2000.0f,-1.0f,-6000.0f);
+ gl.glEnd();
+ gl.glFlush();
+
+ glj.gljSwap();
+ glj.gljCheckGL();
+ glj.gljFree();
+ }
+
+ private void makeImages()
+ {
+ int i, j, idx;
+
+ for (idx = i = 0; i < 32; i++)
+ {
+ for (j = 0; j < 32; j++)
+ {
+ mipmapImage32[idx++] = (byte)255;
+ mipmapImage32[idx++] = (byte)255;
+ mipmapImage32[idx++] = (byte)0;
+ mipmapImage32[idx++] = (byte)255;
+ }
+ }
+ for (idx = i = 0; i < 16; i++)
+ {
+ for (j = 0; j < 16; j++)
+ {
+ mipmapImage16[idx++] = (byte)255;
+ mipmapImage16[idx++] = (byte)0;
+ mipmapImage16[idx++] = (byte)255;
+ mipmapImage16[idx++] = (byte)255;
+ }
+ }
+ for (idx = i = 0; i < 8; i++)
+ {
+ for (j = 0; j < 8; j++)
+ {
+ mipmapImage8[idx++] = (byte)255;
+ mipmapImage8[idx++] = (byte)0;
+ mipmapImage8[idx++] = (byte)0;
+ mipmapImage8[idx++] = (byte)255;
+ }
+ }
+ for (idx = i = 0; i < 4; i++)
+ {
+ for (j = 0; j < 4; j++)
+ {
+ mipmapImage4[idx++] = (byte)0;
+ mipmapImage4[idx++] = (byte)255;
+ mipmapImage4[idx++] = (byte)0;
+ mipmapImage4[idx++] = (byte)255;
+ }
+ }
+ for (idx = i = 0; i < 2; i++)
+ {
+ for (j = 0; j < 2; j++)
+ {
+ mipmapImage2[idx++] = (byte)0;
+ mipmapImage2[idx++] = (byte)0;
+ mipmapImage2[idx++] = (byte)255;
+ mipmapImage2[idx++] = (byte)255;
+ }
+ }
+ mipmapImage1[0] = (byte)255;
+ mipmapImage1[1] = (byte)255;
+ mipmapImage1[2] = (byte)255;
+ mipmapImage1[3] = (byte)255;
+ }
+ }
+}
diff --git a/demos/RonsDemos/mipmap_plugin13.html b/demos/RonsDemos/mipmap_plugin13.html new file mode 100644 index 0000000..f197e77 --- /dev/null +++ b/demos/RonsDemos/mipmap_plugin13.html @@ -0,0 +1,48 @@ +<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.61 [en] (Win98; U) [Netscape]">
+ <title>Mipmap by Silicon Graphics; ported to Java by Ron Cemer</title>
+</head>
+<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#e6e6ff">
+Mipmap applet
+<br>Originially written by Silicon Graphics
+<br>Ported to Java by Ron Cemer
+<br>
+<!--"CONVERTED_APPLET"-->
+<!-- CONVERTER VERSION 1.3 --> +<SCRIPT LANGUAGE="JavaScript"><!-- + var _info = navigator.userAgent; var _ns = false; + var _ie = (_info.indexOf("MSIE") > 0 && _info.indexOf("Win") > 0 && _info.indexOf("Windows 3.1") < 0); +//--></SCRIPT> +<COMMENT><SCRIPT LANGUAGE="JavaScript1.1"><!-- + var _ns = (navigator.appName.indexOf("Netscape") >= 0 && ((_info.indexOf("Win") > 0 && _info.indexOf("Win16") < 0 && java.lang.System.getProperty("os.version").indexOf("3.5") < 0) || (_info.indexOf("Sun") > 0) || (_info.indexOf("Linux") > 0))); +//--></SCRIPT></COMMENT> + +<SCRIPT LANGUAGE="JavaScript"><!-- + if (_ie == true) document.writeln('<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" WIDTH = 400 HEIGHT = 400 codebase="http://java.sun.com/products/plugin/1.3/jinstall-13-win32.cab#Version=1,3,0,0"><NOEMBED><XMP>'); + else if (_ns == true) document.writeln('<EMBED type="application/x-java-applet;version=1.3" CODE = "mipmap.class" WIDTH = 400 HEIGHT = 400 scriptable=false pluginspage="http://java.sun.com/products/plugin/1.3/plugin-install.html"><NOEMBED><XMP>'); +//--></SCRIPT> +<APPLET CODE = "mipmap.class" WIDTH = 400 HEIGHT = 400></XMP> +<PARAM NAME = CODE VALUE = "mipmap.class" >
+ +<PARAM NAME="type" VALUE="application/x-java-applet;version=1.3"> +<PARAM NAME="scriptable" VALUE="false"> + +</APPLET> + +</NOEMBED></EMBED></OBJECT> + + +<!-- +<APPLET CODE = "mipmap.class" WIDTH = 400 HEIGHT = 400>
+
+
+</APPLET> +--> +<!--"END_CONVERTED_APPLET"-->
+
+<hr>
+</body>
+</html>
diff --git a/demos/RonsDemos/molehill.html b/demos/RonsDemos/molehill.html new file mode 100644 index 0000000..361f5b1 --- /dev/null +++ b/demos/RonsDemos/molehill.html @@ -0,0 +1,17 @@ +<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.61 [en] (Win98; U) [Netscape]">
+ <title>Molehill by unknown author; ported to Java by Ron Cemer</title>
+</head>
+<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#e6e6ff">
+Molehill applet
+<br>Originial author unknown
+<br>Ported to Java by Ron Cemer
+<br>
+<applet code="molehill.class" width=400 height=400>
+</applet>
+<hr>
+</body>
+</html>
diff --git a/demos/RonsDemos/molehill.java b/demos/RonsDemos/molehill.java new file mode 100644 index 0000000..8dbe12e --- /dev/null +++ b/demos/RonsDemos/molehill.java @@ -0,0 +1,286 @@ +/**
+ * @(#) molehill.java
+ * @(#) author: unknown (converted to Java by Ron Cemer)
+ */
+
+import java.applet.*;
+import java.awt.*;
+import java.awt.event.*;
+import java.lang.*;
+import java.util.*;
+import java.io.*;
+import java.util.*;
+import gl4java.GLContext;
+import gl4java.awt.GLCanvas;
+
+public class molehill extends Applet
+{
+ molehillCanvas canvas = null;
+
+
+ /* Initialize the applet */
+
+
+ public void init()
+ {
+ Dimension d = getSize();
+ setLayout(new BorderLayout());
+ canvas = new molehillCanvas(d.width, d.height);
+ add("Center", canvas);
+ }
+
+
+ /* Start the applet */
+
+
+ public void start()
+ {
+ }
+
+
+ /* Stop the applet */
+
+
+ public void stop()
+ {
+ }
+
+
+ /* Destroy the applet */
+
+
+ public void destroy()
+ {
+ canvas.cvsDispose();
+ }
+
+
+ public static void main( String args[] )
+ {
+ Frame mainFrame = new Frame("molehill");
+
+ molehill applet = new molehill();
+
+ applet.setSize(400, 400);
+ applet.init();
+ applet.start();
+
+ mainFrame.add(applet);
+
+ mainFrame.pack();
+ mainFrame.setVisible(true);
+ }
+
+ /* Local GLCanvas extension class */
+
+
+ private class molehillCanvas extends GLCanvas
+ {
+ float mat_red_diffuse[] = { 0.7f, 0.0f, 0.1f, 1.0f };
+ float mat_green_diffuse[] = { 0.0f, 0.7f, 0.1f, 1.0f };
+ float mat_blue_diffuse[] = { 0.0f, 0.1f, 0.7f, 1.0f };
+ float mat_yellow_diffuse[] = { 0.7f, 0.8f, 0.1f, 1.0f };
+ float mat_specular[] = { 1.0f, 1.0f, 1.0f, 1.0f };
+ float mat_shininess[] = { 100.0f };
+ float knots[] = { 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f, 1.0f };
+ float pts1[] = new float[4*4*3];
+ float pts2[] = new float[4*4*3];
+ float pts3[] = new float[4*4*3];
+ float pts4[] = new float[4*4*3];
+ int nurb;
+ int u, v;
+
+ public molehillCanvas(int w, int h)
+ {
+ super(w, h);
+ GLContext.gljNativeDebug = false;
+ GLContext.gljClassDebug = false;
+ }
+
+ public void preInit()
+ {
+ doubleBuffer = true;
+ stereoView = false;
+ }
+
+ public void init()
+ {
+ System.out.println("init(): " + this);
+ reshape(getSize().width, getSize().height);
+
+ gl.glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular);
+ gl.glMaterialfv(GL_FRONT, GL_SHININESS, mat_shininess);
+ gl.glEnable(GL_LIGHTING);
+ gl.glEnable(GL_LIGHT0);
+ gl.glEnable(GL_DEPTH_TEST);
+ gl.glEnable(GL_AUTO_NORMAL);
+ gl.glEnable(GL_NORMALIZE);
+ nurb = glu.gluNewNurbsRenderer();
+ glu.gluNurbsProperty(nurb, GLU_SAMPLING_TOLERANCE, 25.0f);
+ glu.gluNurbsProperty(nurb, GLU_DISPLAY_MODE, GLU_FILL);
+
+ /* Build control points for NURBS mole hills. */
+ for(u=0; u<4; u++)
+ {
+ for(v=0; v<4; v++)
+ {
+ /* Red. */
+ pts1[(u*12)+(v*3)+0] = 2.0f*((float)u);
+ pts1[(u*12)+(v*3)+1] = 2.0f*((float)v);
+ if((u==1 || u == 2) && (v == 1 || v == 2))
+ pts1[(u*12)+(v*3)+2] = 6.0f; /* Stretch up middle. */
+ else
+ pts1[(u*12)+(v*3)+2] = 0.0f;
+
+ /* Green. */
+ pts2[(u*12)+(v*3)+0] = 2.0f*((float)u - 3.0f);
+ pts2[(u*12)+(v*3)+1] = 2.0f*((float)v - 3.0f);
+ if((u==1 || u == 2) && (v == 1 || v == 2))
+ if(u == 1 && v == 1)
+ pts2[(u*12)+(v*3)+2] = 15.0f; /* Pull hard on single middle square. */
+ else
+ pts2[(u*12)+(v*3)+2] = -2.0f; /* Push down on other middle squares. */
+ else
+ pts2[(u*12)+(v*3)+2] = 0.0f;
+
+ /* Blue. */
+ pts3[(u*12)+(v*3)+0] = 2.0f*((float)u - 3.0f);
+ pts3[(u*12)+(v*3)+1] = 2.0f*((float)v);
+ if((u==1 || u == 2) && (v == 1 || v == 2))
+ if(u == 1 && v == 2)
+ pts3[(u*12)+(v*3)+2] = 11.0f; /* Pull up on single middple square. */
+ else
+ pts3[(u*12)+(v*3)+2] = 2.0f; /* Pull up slightly on other middle squares. */
+ else
+ pts3[(u*12)+(v*3)+2] = 0.0f;
+
+ /* Yellow. */
+ pts4[(u*12)+(v*3)+0] = 2.0f*((float)u);
+ pts4[(u*12)+(v*3)+1] = 2.0f*((float)v - 3.0f);
+ if((u==1 || u == 2 || u == 3) && (v == 1 || v == 2))
+ if(v == 1)
+ pts4[(u*12)+(v*3)+2] = -2.0f; /* Push down front middle and right squares. */
+ else
+ pts4[(u*12)+(v*3)+2] = 5.0f; /* Pull up back middle and right squares. */
+ else
+ pts4[(u*12)+(v*3)+2] = 0.0f;
+ }
+ }
+
+ /* Stretch up red's far right corner. */
+ pts1[(3*12)+(3*3)+2] = 6;
+ /* Pull down green's near left corner a little. */
+ pts2[(0*12)+(0*3)+2] = -2;
+ /* Turn up meeting of four corners. */
+ pts1[(0*12)+(0*3)+2] = 1;
+ pts2[(3*12)+(3*3)+2] = 1;
+ pts3[(3*12)+(0*3)+2] = 1;
+ pts4[(0*12)+(3*3)+2] = 1;
+
+ gl.glMatrixMode(GL_PROJECTION);
+ glu.gluPerspective(55.0f, 1.0f, 2.0f, 24.0f);
+ gl.glMatrixMode(GL_MODELVIEW);
+ gl.glTranslatef(0.0f, 0.0f, -15.0f);
+ gl.glRotatef(330.0f, 1.0f, 0.0f, 0.0f);
+
+ gl.glNewList(1, GL_COMPILE);
+
+ /* Render red hill. */
+ gl.glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_red_diffuse);
+ glu.gluBeginSurface(nurb);
+ glu.gluNurbsSurface
+ (nurb,
+ 8,
+ knots,
+ 8,
+ knots,
+ (4 * 3),
+ 3,
+ pts1,
+ 4,
+ 4,
+ GL_MAP2_VERTEX_3);
+ glu.gluEndSurface(nurb);
+
+ /* Render green hill. */
+ gl.glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_green_diffuse);
+ glu.gluBeginSurface(nurb);
+ glu.gluNurbsSurface
+ (nurb,
+ 8,
+ knots,
+ 8,
+ knots,
+ (4 * 3),
+ 3,
+ pts2,
+ 4,
+ 4,
+ GL_MAP2_VERTEX_3);
+ glu.gluEndSurface(nurb);
+
+ /* Render blue hill. */
+ gl.glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_blue_diffuse);
+ glu.gluBeginSurface(nurb);
+ glu.gluNurbsSurface
+ (nurb,
+ 8,
+ knots,
+ 8,
+ knots,
+ (4 * 3),
+ 3,
+ pts3,
+ 4,
+ 4,
+ GL_MAP2_VERTEX_3);
+ glu.gluEndSurface(nurb);
+
+ /* Render yellow hill. */
+ gl.glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_yellow_diffuse);
+ glu.gluBeginSurface(nurb);
+ glu.gluNurbsSurface
+ (nurb,
+ 8,
+ knots,
+ 8,
+ knots,
+ (4 * 3),
+ 3,
+ pts4,
+ 4,
+ 4,
+ GL_MAP2_VERTEX_3);
+ glu.gluEndSurface(nurb);
+
+ gl.glEndList();
+
+ glj.gljCheckGL();
+ }
+
+ public void cvsDispose()
+ {
+ System.out.println("destroy(): " + this);
+ super.cvsDispose();
+ }
+
+ public void reshape(int width, int height)
+ {
+ gl.glViewport(0,0,width,height);
+ gl.glMatrixMode(GL_PROJECTION);
+ }
+
+ public void display()
+ {
+ if (glj.gljMakeCurrent() == false) return;
+
+ gl.glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+ gl.glCallList(1);
+ gl.glFlush();
+
+ glj.gljSwap();
+ glj.gljCheckGL();
+ glj.gljFree();
+ }
+ }
+}
diff --git a/demos/RonsDemos/molehill_plugin13.html b/demos/RonsDemos/molehill_plugin13.html new file mode 100644 index 0000000..5ce9215 --- /dev/null +++ b/demos/RonsDemos/molehill_plugin13.html @@ -0,0 +1,48 @@ +<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.61 [en] (Win98; U) [Netscape]">
+ <title>Molehill by unknown author; ported to Java by Ron Cemer</title>
+</head>
+<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#e6e6ff">
+Molehill applet
+<br>Originial author unknown
+<br>Ported to Java by Ron Cemer
+<br>
+<!--"CONVERTED_APPLET"-->
+<!-- CONVERTER VERSION 1.3 --> +<SCRIPT LANGUAGE="JavaScript"><!-- + var _info = navigator.userAgent; var _ns = false; + var _ie = (_info.indexOf("MSIE") > 0 && _info.indexOf("Win") > 0 && _info.indexOf("Windows 3.1") < 0); +//--></SCRIPT> +<COMMENT><SCRIPT LANGUAGE="JavaScript1.1"><!-- + var _ns = (navigator.appName.indexOf("Netscape") >= 0 && ((_info.indexOf("Win") > 0 && _info.indexOf("Win16") < 0 && java.lang.System.getProperty("os.version").indexOf("3.5") < 0) || (_info.indexOf("Sun") > 0) || (_info.indexOf("Linux") > 0))); +//--></SCRIPT></COMMENT> + +<SCRIPT LANGUAGE="JavaScript"><!-- + if (_ie == true) document.writeln('<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" WIDTH = 400 HEIGHT = 400 codebase="http://java.sun.com/products/plugin/1.3/jinstall-13-win32.cab#Version=1,3,0,0"><NOEMBED><XMP>'); + else if (_ns == true) document.writeln('<EMBED type="application/x-java-applet;version=1.3" CODE = "molehill.class" WIDTH = 400 HEIGHT = 400 scriptable=false pluginspage="http://java.sun.com/products/plugin/1.3/plugin-install.html"><NOEMBED><XMP>'); +//--></SCRIPT> +<APPLET CODE = "molehill.class" WIDTH = 400 HEIGHT = 400></XMP> +<PARAM NAME = CODE VALUE = "molehill.class" >
+ +<PARAM NAME="type" VALUE="application/x-java-applet;version=1.3"> +<PARAM NAME="scriptable" VALUE="false"> + +</APPLET> + +</NOEMBED></EMBED></OBJECT> + + +<!-- +<APPLET CODE = "molehill.class" WIDTH = 400 HEIGHT = 400>
+
+
+</APPLET> +--> +<!--"END_CONVERTED_APPLET"-->
+
+<hr>
+</body>
+</html>
diff --git a/demos/RonsDemos/moth.html b/demos/RonsDemos/moth.html new file mode 100644 index 0000000..020ab04 --- /dev/null +++ b/demos/RonsDemos/moth.html @@ -0,0 +1,19 @@ +<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.61 [en] (Win98; U) [Netscape]">
+ <title>Moth by Robert Doyle; ported to Java by Ron Cemer</title>
+</head>
+<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#e6e6ff">
+Moth applet
+<br>Originially written by Silicon Graphics
+<br>Ported to Java by Ron Cemer
+<br>Click the left mouse button within the window to pause/resume simulation.
+<br>Click the right mouse button within the window to restart simulation.
+<br>
+<applet code="moth.class" width=400 height=400>
+</applet>
+<hr>
+</body>
+</html>
diff --git a/demos/RonsDemos/moth.java b/demos/RonsDemos/moth.java new file mode 100644 index 0000000..c12a4a9 --- /dev/null +++ b/demos/RonsDemos/moth.java @@ -0,0 +1,1149 @@ +/**
+ * @(#) moth.java
+ * @(#) author: Robert Doyle (converted to Java by Ron Cemer)
+ */
+
+/*
+ "moth" by Robert Doyle, Naval Research Laboratory, Washington, DC.
+ Scene objects are built into display lists in the 'init()' method.
+ Objects are assembled and motion described in the 'display()' method.
+*/
+
+import java.applet.*;
+import java.awt.*;
+import java.awt.event.*;
+import java.lang.*;
+import java.util.*;
+import java.io.*;
+import java.util.*;
+import gl4java.GLContext;
+import gl4java.awt.GLAnimCanvas;
+import gl4java.applet.SimpleGLAnimApplet1;
+
+public class moth extends SimpleGLAnimApplet1
+{
+
+ /* Initialize the applet */
+
+
+ public void init()
+ {
+ super.init();
+ Dimension d = getSize();
+ canvas = new mothCanvas(d.width, d.height);
+ add("Center", canvas);
+ }
+
+
+ /* Local GLAnimCanvas extension class */
+
+
+ private class mothCanvas extends GLAnimCanvas implements MouseListener
+ {
+ float wall_color[] = {1.0f, 1.0f, 1.0f, 1.0f};
+ float wall_ambient[] = {0.5f, 0.5f, 0.5f, 1.0f};
+ float floor_color[] = {0.5f, 1.0f, 0.5f, 0.5f};
+ float column_color[] = {1.0f, 0.0f, 0.0f, 1.0f};
+ float column_ambient[] = {0.25f, 0.0f, 0.0f, 1.0f};
+
+ float panel_color[] = {0.1f, 0.1f, 1.0f, 1.0f};
+ float panel_ambient[] = {0.01f, 0.01f, 0.3f, 1.0f};
+
+ float lamp_ambient[] = {1.0f, 1.0f, 1.0f, 1.0f};
+ float lamp_diffuse[] = {1.0f, 1.0f, 1.0f, 1.0f};
+ float lamp_specular[] = {1.0f, 1.0f, 1.0f, 1.0f};
+ float lamp_post_diffuse[] = {0.8f, 0.0f, 0.0f, 1.0f};
+ float lamp_post_specular[] = {0.8f, 0.0f, 0.0f, 1.0f};
+ float lamp_post_ambient[] = {0.25f, 0.0f, 0.0f, 1.0f};
+
+ float satellite_diffuse[] = {1.0f, 0.69f, 0.0f, 1.0f};
+ float satellite_shiny[] = {128.0f};
+ float satellite_specular[] = {1.0f, 1.0f, 1.0f, 1.0f};
+ float satellite_ambient[] = {0.37f, 0.25f, 0.0f, 1.0f};
+
+ float cube_color[] = {1.0f, 1.0f, 0.0f, 1.0f};
+ float cube_shiny[] = {99.0f};
+ float cube_specular[] = {0.9f, 0.9f, 0.9f, 1.0f};
+ float cube_ambient[] = {0.1f, 0.1f, 0.1f, 1.0f};
+
+ float shadow_ambient[] = {0.0f, 0.0f, 0.0f, 1.0f};
+ float shadow_diffuse[] = {0.0f, 0.0f, 0.0f, 0.3f};
+ float shadow_shiny[] = {0.0f};
+ float shadow_specular[] = {0.0f, 0.0f, 0.0f, 1.0f};
+
+ int column = 3;
+ int ground_shadow_matrix = 16;
+ int left_wall_shadow_matrix = 17;
+ int ground = 30;
+ int left_wall = 40;
+ int right_wall = 50;
+ int four_columns = 7;
+ int two_columns = 32;
+ int satellite1 = 301;
+ int satellite2 = 302;
+ int panel1 = 303;
+ int panel2 = 304;
+
+ float default_Tx = -0.01f;
+ float default_Ty = -0.01f;
+ float default_Tz = -0.02f;
+
+ float default_mvt_x = -15.0f;
+ float default_mvt_y = -15.0f;
+ float default_mvt_z = -30.7f;
+
+ float default_mvr_d = 150.0f;
+
+ float Tx = default_Tx;
+ float Ty = default_Ty;
+ float Tz = default_Tz;
+
+ float mvt_x = default_mvt_x;
+ float mvt_y = default_mvt_y;
+ float mvt_z = default_mvt_z;
+
+ float mvr_d = default_mvr_d;
+
+ float mvr_x = 1.0f;
+ float mvr_y = -1.0f;
+ float mvr_z = -1.0f;
+
+ float Rx = 0.1f;
+
+ float cubeXform[] = new float[16];
+ float column1Xform[] = new float[16];
+ float column2Xform[] = new float[16];
+ float column3Xform[] = new float[16];
+ float four_columnsXform[] = new float[16];
+
+ float shadowMat_ground[] = new float[16];
+ float shadowMat_left[] = new float[16];
+ float shadowMat_back[] = new float[16];
+ float shadowMat_column[] = new float[16];
+ float shadowMat_right[] = new float[16];
+
+ float shadowMat1_ground[] = new float[16];
+ float shadowMat1_left[] = new float[16];
+ float shadowMat1_back[] = new float[16];
+ float shadowMat1_right[] = new float[16];
+
+ int tick = -1;
+
+ boolean moving = true;
+
+ float lightPos[] = {1.0f, 2.5f, 3.0f, 1.0f};
+
+ float light1Pos[] = {0.0f, 1.6f, -5.0f, 1.0f};
+ float light1Amb[] = {1.0f, 1.0f, 1.0f, 1.0f};
+ float light1Diff[] = {1.0f, 1.0f, 1.0f, 1.0f};
+ float light1Spec[] = {1.0f, 1.0f, 1.0f, 1.0f};
+
+ float leftPlane[] = {1.0f, 0.0f, 0.0f, 4.88f}; /* X = -4.88 */
+ float rightPlane[] = {-1.0f, 0.0f, 0.0f, 4.88f}; /* X = 4.98 */
+ float groundPlane[] = {0.0f, 1.0f, 0.0f, 1.450f}; /* Y = -1.480 */
+ float columnPlane[] = {0.0f, 0.0f, 1.0f, 0.899f}; /* Z = -0.899 */
+ float backPlane[] = {0.0f, 0.0f, 1.0f, 8.98f}; /* Z = -8.98 */
+
+ final float S = 0.7071f;
+ final float NS = 0.382683f;
+ final float NC = 0.923880f;
+
+ /* satellite body. */
+ float oct_vertices[][][] =
+ {
+ {
+ {0.0f, 0.0f, 0.0f, 1.0f},
+ {0.0f, 1.0f, 0.0f, 1.0f},
+ {-S, S, 0.0f, 1.0f}},
+
+ {
+ {0.0f, 0.0f, 0.0f, 1.0f},
+ {-S, S, 0.0f, 1.0f},
+ {-1.0f, 0.0f, 0.0f, 1.0f}},
+
+ {
+ {0.0f, 0.0f, 0.0f, 1.0f},
+ {-1.0f, 0.0f, 0.0f, 1.0f},
+ {-S, -S, 0.0f, 1.0f}},
+
+ {
+ {0.0f, 0.0f, 0.0f, 1.0f},
+ {-S, -S, 0.0f, 1.0f},
+ {0.0f, -1.0f, 0.0f, 1.0f}},
+
+ {
+ {0.0f, 0.0f, 0.0f, 1.0f},
+ {0.0f, -1.0f, 0.0f, 1.0f},
+ {S, -S, 0.0f, 1.0f}},
+
+ {
+
+ {0.0f, 0.0f, 0.0f, 1.0f},
+ {S, -S, 0.0f, 1.0f},
+ {1.0f, 0.0f, 0.0f, 1.0f}},
+
+ {
+ {0.0f, 0.0f, 0.0f, 1.0f},
+ {1.0f, 0.0f, 0.0f, 1.0f},
+ {S, S, 0.0f, 1.0f}},
+
+ {
+ {0.0f, 0.0f, 0.0f, 1.0f},
+ {S, S, 0.0f, 1.0f},
+ {0.0f, 1.0f, 0.0f, 1.0f}}
+
+ };
+
+ float oct_side_vertices[][][] =
+ {
+ {
+ {-S, S, 0.0f, 1.0f},
+ {0.0f, 1.0f, 0.0f, 1.0f},
+ {0.0f, 1.0f, -1.0f, 1.0f},
+ {-S, S, -1.0f, 1.0f}},
+
+ {
+ {-1.0f, 0.0f, 0.0f, 1.0f},
+ {-S, S, 0.0f, 1.0f},
+ {-S, S, -1.0f, 1.0f},
+ {-1.0f, 0.0f, -1.0f, 1.0f}},
+
+ {
+ {-S, -S, 0.0f, 1.0f},
+ {-1.0f, 0.0f, 0.0f, 1.0f},
+ {-1.0f, 0.0f, -1.0f, 1.0f},
+ {-S, -S, -1.0f, 1.0f}},
+
+ {
+ {0.0f, -1.0f, 0.0f, 1.0f},
+ {-S, -S, 0.0f, 1.0f},
+ {-S, -S, -1.0f, 1.0f},
+ {0.0f, -1.0f, -1.0f, 1.0f}},
+
+ {
+ {S, -S, 0.0f, 1.0f},
+ {0.0f, -1.0f, 0.0f, 1.0f},
+ {0.0f, -1.0f, -1.0f, 1.0f},
+ {S, -S, -1.0f, 1.0f}},
+
+ {
+ {1.0f, 0.0f, 0.0f, 1.0f},
+ {S, -S, 0.0f, 1.0f},
+ {S, -S, -1.0f, 1.0f},
+ {1.0f, 0.0f, -1.0f, 1.0f}},
+
+ {
+ {S, S, 0.0f, 1.0f},
+ {1.0f, 0.0f, 0.0f, 1.0f},
+ {1.0f, 0.0f, -1.0f, 1.0f},
+ {S, S, -1.0f, 1.0f}},
+
+ {
+ {0.0f, 1.0f, 0.0f, 1.0f},
+ {S, S, 0.0f, 1.0f},
+ {S, S, -1.0f, 1.0f},
+ {0.0f, 1.0f, -1.0f, 1.0f}}
+
+ };
+
+ float oct_side_normals[][] =
+ {
+ {-NS, NC, 0.0f},
+ {-NC, NS, 0.0f},
+ {-NC, -NS, 0.0f},
+ {-NS, -NC, 0.0f},
+ {NS, -NC, 0.0f},
+ {NC, -NS, 0.0f},
+ {NC, NS, 0.0f},
+ {NS, NC, 0.0f}
+ };
+
+ float cube_vertexes[][][] =
+ {
+ {
+ {-1.0f, -1.0f, -1.0f, 1.0f},
+ {-1.0f, -1.0f, 1.0f, 1.0f},
+ {-1.0f, 1.0f, 1.0f, 1.0f},
+ {-1.0f, 1.0f, -1.0f, 1.0f}},
+
+ {
+ {1.0f, 1.0f, 1.0f, 1.0f},
+ {1.0f, -1.0f, 1.0f, 1.0f},
+ {1.0f, -1.0f, -1.0f, 1.0f},
+ {1.0f, 1.0f, -1.0f, 1.0f}},
+
+ {
+ {-1.0f, -1.0f, -1.0f, 1.0f},
+ {1.0f, -1.0f, -1.0f, 1.0f},
+ {1.0f, -1.0f, 1.0f, 1.0f},
+ {-1.0f, -1.0f, 1.0f, 1.0f}},
+
+ {
+ {1.0f, 1.0f, 1.0f, 1.0f},
+ {1.0f, 1.0f, -1.0f, 1.0f},
+ {-1.0f, 1.0f, -1.0f, 1.0f},
+ {-1.0f, 1.0f, 1.0f, 1.0f}},
+
+ {
+ {-1.0f, -1.0f, -1.0f, 1.0f},
+ {-1.0f, 1.0f, -1.0f, 1.0f},
+ {1.0f, 1.0f, -1.0f, 1.0f},
+ {1.0f, -1.0f, -1.0f, 1.0f}},
+
+ {
+ {1.0f, 1.0f, 1.0f, 1.0f},
+ {-1.0f, 1.0f, 1.0f, 1.0f},
+ {-1.0f, -1.0f, 1.0f, 1.0f},
+ {1.0f, -1.0f, 1.0f, 1.0f}}
+ };
+
+ float cube_normals[][] =
+ {
+ {-1.0f, 0.0f, 0.0f, 0.0f},
+ {1.0f, 0.0f, 0.0f, 0.0f},
+ {0.0f, -1.0f, 0.0f, 0.0f},
+ {0.0f, 1.0f, 0.0f, 0.0f},
+ {0.0f, 0.0f, -1.0f, 0.0f},
+ {0.0f, 0.0f, 1.0f, 0.0f}
+ };
+
+ public mothCanvas(int w, int h)
+ {
+ super(w, h);
+ GLContext.gljNativeDebug = false;
+ GLContext.gljClassDebug = false;
+ setAnimateFps(30.0);
+ }
+
+ public void preInit()
+ {
+ doubleBuffer = true;
+ stereoView = false;
+ }
+
+ public void init()
+ {
+ System.out.println("init(): " + this);
+ reshape(getSize().width, getSize().height);
+
+ /*** Initial light position is declared in the display function ***/
+
+ gl.glLightfv(GL_LIGHT1, GL_AMBIENT, light1Amb);
+ gl.glLightfv(GL_LIGHT1, GL_DIFFUSE, light1Diff);
+ gl.glLightfv(GL_LIGHT1, GL_SPECULAR, light1Spec);
+ gl.glEnable(GL_LIGHT1);
+
+ gl.glEnable(GL_LIGHTING);
+
+ gl.glLightf(GL_LIGHT1, GL_QUADRATIC_ATTENUATION, 0.07f); /* try 0.07 w/ 24 bit color */
+
+ /*....Shadow Matrices For Floor, Left Wall, Back Wall, and Right Wall......*/
+
+ /* For light0 */
+
+ myShadowMatrix(groundPlane, lightPos, shadowMat_ground);
+ myShadowMatrix(leftPlane, lightPos, shadowMat_left);
+ myShadowMatrix(columnPlane, lightPos, shadowMat_column);
+ myShadowMatrix(backPlane, lightPos, shadowMat_back);
+ myShadowMatrix(rightPlane, lightPos, shadowMat_right);
+
+ /* For light1 */
+
+ myShadowMatrix(groundPlane, light1Pos, shadowMat1_ground);
+ myShadowMatrix(leftPlane, light1Pos, shadowMat1_left);
+ myShadowMatrix(backPlane, light1Pos, shadowMat1_back);
+ myShadowMatrix(rightPlane, light1Pos, shadowMat1_right);
+
+ /*sssssssssssssssss Make Satellite Body and Shadow ssssssssssssssssssssssss*/
+
+ gl.glNewList(satellite1, GL_COMPILE);
+ gl.glPushMatrix();
+ drawSatellite(satellite_diffuse, satellite_ambient, satellite_specular, satellite_shiny);
+ gl.glPopMatrix();
+ gl.glEndList();
+ gl.glNewList(satellite2, GL_COMPILE);
+ gl.glPushMatrix();
+ drawSatellite(shadow_diffuse, shadow_ambient, shadow_specular, shadow_shiny);
+ gl.glPopMatrix();
+ gl.glEndList();
+
+ /*ppppppppppppppppppppppppppp Make Solar Panels and Shadows pppppppppppppppppp*/
+
+ gl.glNewList(panel1, GL_COMPILE);
+ gl.glPushMatrix();
+ drawPanels(panel_color, panel_ambient);
+ gl.glPopMatrix();
+ gl.glEndList();
+
+ gl.glNewList(panel2, GL_COMPILE);
+ gl.glPushMatrix();
+ drawPanels(shadow_diffuse, shadow_ambient);
+ gl.glPopMatrix();
+ gl.glEndList();
+
+ /*========= Make Floor ==============*/
+
+ gl.glNewList(ground, GL_COMPILE);
+ gl.glPushMatrix();
+ gl.glPushAttrib(GL_LIGHTING_BIT);
+ gl.glMaterialfv(GL_FRONT, GL_DIFFUSE, floor_color);
+ gl.glMaterialfv(GL_FRONT, GL_AMBIENT, shadow_ambient);
+ gl.glTranslatef(0.0f, -1.5f, -5.0f);
+ gl.glRotatef(-90.0f, 1.0f, 0.0f, 0.0f);
+ gl.glScalef(5.0f, 5.0f, 1.0f);
+ drawGround(); /* draw ground */
+ gl.glPopAttrib();
+ gl.glPopMatrix();
+ gl.glEndList();
+
+ /*@@@@@@@@@@ Make Lamp Post and Lamp @@@@@@@@@@@@*/
+
+ gl.glNewList(21, GL_COMPILE);
+ gl.glPushMatrix();
+ gl.glPushAttrib(GL_LIGHTING_BIT);
+ gl.glMaterialfv(GL_FRONT, GL_AMBIENT, lamp_post_specular);
+ gl.glTranslatef(0.0f, -0.1f, -5.0f);
+ gl.glScalef(0.07f, 1.45f, 0.07f);
+ drawCube(lamp_post_diffuse, lamp_post_ambient); /* draw lamp post */
+ gl.glPopAttrib();
+ gl.glPopMatrix();
+ gl.glPushMatrix();
+ gl.glTranslatef(0.0f, -1.45f, -5.0f);
+ gl.glScalef(0.3f, 0.05f, 0.3f);
+ drawCube(wall_color, cube_ambient); /* draw lamp post base */
+ gl.glPopMatrix();
+ gl.glEndList();
+
+ gl.glNewList(22, GL_COMPILE);
+ gl.glPushMatrix();
+ gl.glPushAttrib(GL_LIGHTING_BIT);
+ gl.glMaterialfv(GL_FRONT, GL_AMBIENT, lamp_ambient);
+ gl.glMaterialfv(GL_FRONT, GL_DIFFUSE, lamp_diffuse);
+ gl.glMaterialfv(GL_FRONT, GL_SPECULAR, lamp_specular);
+ gl.glTranslatef(0.0f, 1.6f, -5.0f);
+
+ /* draw lamp */
+ int qobj = glu.gluNewQuadric();
+ glu.gluQuadricOrientation(qobj,GLU_OUTSIDE);
+ glu.gluQuadricNormals(qobj,GLU_SMOOTH);
+ glu.gluQuadricTexture(qobj,false);
+ glu.gluSphere(qobj,0.3f,20,20);
+ glu.gluDeleteQuadric(qobj);
+
+ gl.glPopAttrib();
+ gl.glPopMatrix();
+ gl.glEndList();
+
+ /*** Lamp post base shadow ***/
+
+ gl.glNewList(501, GL_COMPILE);
+ gl.glPushMatrix();
+ gl.glPushAttrib(GL_LIGHTING_BIT);
+ gl.glMaterialfv(GL_FRONT, GL_AMBIENT, shadow_ambient);
+ gl.glMaterialfv(GL_FRONT, GL_DIFFUSE, shadow_diffuse);
+ gl.glMaterialfv(GL_FRONT, GL_SPECULAR, shadow_specular);
+ gl.glMaterialfv(GL_FRONT, GL_SHININESS, shadow_shiny);
+ gl.glTranslatef(0.0f, -1.49f, -5.0f);
+ gl.glRotatef(-90.0f, 1.0f, 0.0f, 0.0f);
+ gl.glScalef(0.7f, 0.7f, 1.0f);
+ drawOct();
+ gl.glPopAttrib();
+ gl.glPopMatrix();
+ gl.glEndList();
+
+ /*||||||||||| Make Left Wall |||||||||||||*/
+
+ gl.glNewList(left_wall, GL_COMPILE);
+ gl.glPushMatrix();
+ gl.glPushAttrib(GL_LIGHTING_BIT);
+ gl.glMaterialfv(GL_FRONT, GL_DIFFUSE, wall_color);
+ gl.glMaterialfv(GL_FRONT, GL_AMBIENT, wall_ambient);
+ gl.glTranslatef(0.0f, -1.5f, 0.0f);
+ gl.glTranslatef(0.0f, 1.2f, 0.0f);
+ gl.glTranslatef(0.0f, 0.0f, -5.0f);
+ gl.glTranslatef(-5.0f, 0.0f, 0.0f);
+ gl.glRotatef(90.0f, 0.0f, 1.0f, 0.0f);
+ gl.glScalef(4.5f, 1.2f, 1.0f);
+ gl.glNormal3f(0.0f, 0.0f, 1.0f);
+ drawGround(); /* draw left wall */
+ gl.glPopAttrib();
+ gl.glPopMatrix();
+ gl.glEndList();
+
+ /*\\\\\\\\\\\\\ Make Right Wall \\\\\\\\\\\\\\\\\\\*/
+
+ gl.glNewList(right_wall, GL_COMPILE);
+ gl.glPushMatrix();
+ gl.glPushAttrib(GL_LIGHTING_BIT);
+ gl.glMaterialfv(GL_FRONT, GL_DIFFUSE, wall_color);
+ gl.glMaterialfv(GL_FRONT, GL_AMBIENT, wall_ambient);
+ gl.glTranslatef(0.0f, -1.5f, 0.0f);
+ gl.glTranslatef(0.0f, 1.2f, 0.0f);
+
+ gl.glTranslatef(0.0f, 0.0f, -5.0f);
+ gl.glTranslatef(5.0f, 0.0f, 0.0f);
+ gl.glRotatef(270.0f, 0.0f, 1.0f, 0.0f);
+
+ gl.glScalef(4.5f, 1.2f, 1.0f);
+ gl.glNormal3f(0.0f, 0.0f, 1.0f);
+ drawGround(); /* draw right wall */
+ gl.glPopAttrib();
+ gl.glPopMatrix();
+ gl.glEndList();
+
+ /*[[[[[[[[[[[ Build Columns ]]]]]]]]]]]*/
+
+ gl.glPushMatrix();
+ gl.glNewList(1, GL_COMPILE);
+ gl.glPushMatrix();
+ gl.glScalef(0.4f, 1.4f, 0.4f);
+ drawCube(column_color, column_ambient); /* draw column1 */
+ gl.glPopMatrix();
+ gl.glEndList();
+
+ gl.glNewList(2, GL_COMPILE);
+ gl.glPushMatrix();
+ gl.glTranslatef(0.0f, -1.45f, 0.0f);
+ gl.glScalef(0.5f, 0.1f, 0.5f);
+ drawCube(wall_color, cube_ambient); /* draw base */
+ gl.glPopMatrix();
+ gl.glPushMatrix();
+ gl.glTranslatef(0.0f, 1.45f, 0.0f);
+ gl.glScalef(0.5f, 0.1f, 0.5f);
+ drawCube(wall_color, cube_ambient); /* draw top */
+ gl.glPopMatrix();
+ gl.glEndList();
+ gl.glPopMatrix();
+
+ gl.glNewList(column, GL_COMPILE);
+ gl.glPushMatrix();
+ gl.glCallList(1);
+ gl.glCallList(2);
+ gl.glPopMatrix();
+ gl.glEndList();
+
+ /***** Place columns at front of scene. *****/
+
+ gl.glNewList(4, GL_COMPILE);
+ gl.glPushMatrix();
+ gl.glTranslatef(-5.0f, 0.0f, -0.5f);
+ gl.glCallList(column);
+ gl.glPopMatrix();
+ gl.glEndList();
+
+ gl.glNewList(5, GL_COMPILE);
+ gl.glPushMatrix();
+ gl.glTranslatef(-1.75f, 0.0f, -0.5f);
+ gl.glCallList(column);
+ gl.glPopMatrix();
+ gl.glEndList();
+
+ gl.glNewList(6, GL_COMPILE);
+ gl.glPushMatrix();
+ gl.glTranslatef(1.75f, 0.0f, -0.5f);
+ gl.glCallList(column);
+ gl.glPopMatrix();
+ gl.glEndList();
+
+ gl.glNewList(17, GL_COMPILE);
+ gl.glPushMatrix();
+ gl.glTranslatef(5.0f, 0.0f, -0.5f);
+ gl.glCallList(column);
+ gl.glPopMatrix();
+ gl.glEndList();
+
+ /*** Get the modelview matrix once ***/
+ gl.glPushMatrix();
+ gl.glRotatef(-mvr_d, mvr_x, mvr_y, mvr_z);
+ gl.glTranslatef(-mvt_x, -mvt_y, -mvt_z);
+ gl.glGetFloatv(GL_MODELVIEW_MATRIX, four_columnsXform);
+ gl.glPopMatrix();
+
+ gl.glNewList(four_columns, GL_COMPILE);
+ gl.glPushMatrix();
+ gl.glCallList(4);
+ gl.glCallList(5);
+ gl.glCallList(6);
+ gl.glCallList(17);
+ gl.glPopMatrix();
+ gl.glEndList();
+
+ /***** Make two columns for sides of scene *****/
+
+ gl.glNewList(two_columns, GL_COMPILE);
+ gl.glPushMatrix();
+ gl.glRotatef(90.0f, 0.0f, 1.0f, 0.0f);
+ gl.glTranslatef(5.0f, 0.0f, -5.0f);
+ gl.glPushMatrix();
+ gl.glTranslatef(0.0f, 0.0f, -0.3f);
+ gl.glCallList(column);
+ gl.glPopMatrix();
+ gl.glPushMatrix();
+ gl.glTranslatef(0.0f, 0.0f, 10.3f);
+ gl.glCallList(column);
+ gl.glPopMatrix();
+ gl.glPopMatrix();
+ gl.glEndList();
+
+ /* .......................Make shadows .........................*/
+
+ gl.glPushMatrix();
+ gl.glNewList(8, GL_COMPILE);
+ gl.glPushMatrix();
+ gl.glScalef(0.4f, 1.4f, 0.4f);
+ drawCube(shadow_diffuse, shadow_ambient); /* draw column1 */
+ gl.glPopMatrix();
+ gl.glEndList();
+
+
+ gl.glNewList(9, GL_COMPILE);
+ gl.glPushMatrix();
+ gl.glTranslatef(0.0f, -1.45f, 0.0f);
+ gl.glScalef(0.5f, 0.1f, 0.5f);
+ drawCube(shadow_diffuse, shadow_ambient); /* draw base. */
+ gl.glPopMatrix();
+ gl.glPushMatrix();
+ gl.glTranslatef(0.0f, 1.45f, 0.0f);
+ gl.glScalef(0.5f, 0.1f, 0.5f);
+ drawCube(shadow_diffuse, shadow_ambient); /* draw top. */
+ gl.glPopMatrix();
+ gl.glEndList();
+ gl.glPopMatrix();
+
+ gl.glNewList(10, GL_COMPILE);
+ gl.glPushMatrix();
+ gl.glCallList(8);
+ gl.glCallList(9);
+ gl.glPopMatrix();
+ gl.glEndList();
+
+ gl.glNewList(11, GL_COMPILE);
+ gl.glPushMatrix();
+ gl.glTranslatef(-5.0f, 0.0f, -0.5f);
+ gl.glCallList(10);
+ gl.glPopMatrix();
+ gl.glEndList();
+
+ gl.glNewList(12, GL_COMPILE);
+ gl.glPushMatrix();
+ gl.glTranslatef(-1.75f, 0.0f, -0.5f);
+ gl.glCallList(10);
+ gl.glPopMatrix();
+ gl.glEndList();
+
+ gl.glNewList(13, GL_COMPILE);
+ gl.glPushMatrix();
+ gl.glTranslatef(1.75f, 0.0f, -0.5f);
+ gl.glCallList(10);
+ gl.glPopMatrix();
+ gl.glEndList();
+
+ gl.glNewList(14, GL_COMPILE);
+ gl.glPushMatrix();
+ gl.glTranslatef(5.0f, 0.0f, -0.5f);
+ gl.glCallList(10);
+ gl.glPopMatrix();
+ gl.glEndList();
+
+ gl.glNewList(15, GL_COMPILE);
+ gl.glPushMatrix();
+ gl.glCallList(11);
+ gl.glCallList(12);
+ gl.glCallList(13);
+ gl.glCallList(14);
+ gl.glPopMatrix();
+ gl.glEndList();
+
+ gl.glNewList(100, GL_COMPILE);
+ gl.glPushMatrix();
+ gl.glMultMatrixf(shadowMat_ground);
+ gl.glTranslatef(-mvt_x, -mvt_y, -mvt_z); /* correct for modelview matrix */
+ gl.glRotatef(-mvr_d, mvr_x, mvr_y, mvr_z);
+ gl.glMultMatrixf(four_columnsXform);
+ gl.glCallList(15);
+ gl.glPopMatrix();
+ gl.glEndList();
+
+ gl.glNewList(101, GL_COMPILE);
+ gl.glPushMatrix();
+ gl.glMultMatrixf(shadowMat_left);
+ gl.glTranslatef(-mvt_x, -mvt_y, -mvt_z); /* correct for modelview matrix */
+ gl.glRotatef(-mvr_d, mvr_x, mvr_y, mvr_z);
+ gl.glMultMatrixf(four_columnsXform);
+ gl.glCallList(15);
+ gl.glPopMatrix();
+ gl.glEndList();
+
+ gl.glNewList(102, GL_COMPILE);
+ gl.glPushMatrix();
+ gl.glMultMatrixf(shadowMat_back);
+ gl.glRotatef(-mvr_d, mvr_x, mvr_y, mvr_z);
+ gl.glTranslatef(-mvt_x, -mvt_y, -mvt_z); /* correct for modelview matrix */
+ gl.glMultMatrixf(four_columnsXform);
+ gl.glCallList(15);
+ gl.glPopMatrix();
+ gl.glEndList();
+
+ gl.glNewList(103, GL_COMPILE);
+ gl.glPushMatrix();
+ gl.glMultMatrixf(shadowMat_right);
+ gl.glRotatef(-mvr_d, mvr_x, mvr_y, mvr_z);
+ gl.glTranslatef(-mvt_x, -mvt_y, -mvt_z); /* correct for modelview matrix */
+ gl.glMultMatrixf(four_columnsXform);
+ gl.glCallList(15);
+ gl.glPopMatrix();
+ gl.glEndList();
+
+ glj.gljCheckGL();
+
+ addMouseListener(this);
+ }
+
+ public void doCleanup()
+ {
+ System.out.println("destroy(): " + this);
+ removeMouseListener(this);
+ }
+
+ public void reshape(int width, int height)
+ {
+ gl.glViewport(0,0,width,height);
+ gl.glMatrixMode(GL_PROJECTION);
+
+
+ gl.glMatrixMode(GL_PROJECTION);
+ gl.glLoadIdentity();
+
+ gl.glFrustum(-0.9f, 0.9f, -0.9f, 0.9f, 1.0f, 35.0f);
+
+ gl.glMatrixMode(GL_MODELVIEW);
+ gl.glLoadIdentity();
+
+ gl.glEnable(GL_NORMALIZE);
+ gl.glEnable(GL_CULL_FACE);
+ gl.glCullFace(GL_BACK); /* double your fun */
+ gl.glShadeModel(GL_SMOOTH);
+ gl.glDepthFunc(GL_LESS);
+ gl.glDepthMask(true);
+ gl.glEnable(GL_DEPTH_TEST);
+ }
+
+ public void display()
+ {
+ if (glj.gljMakeCurrent() == false) return;
+
+ tick++;
+ if (tick >= 60) tick = 0;
+
+ gl.glPushMatrix();
+
+ gl.glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+ gl.glLoadIdentity();
+
+ /*@@@@@@ Rotation and Translation of Entire Scene @@@@@*/
+
+ if (mvt_x < 0.0f && mvt_y < 0.0f)
+ {
+ gl.glTranslatef(mvt_x ,mvt_y ,mvt_z );
+ mvt_x = mvt_x - Tx;
+ mvt_y = mvt_y - Ty;
+ mvt_z = mvt_z - Tz;
+
+ gl.glRotatef(mvr_d, mvr_x, mvr_y, mvr_z);
+ mvr_d = mvr_d - Rx;
+ }
+ else
+ gl.glTranslatef(0.0f, 0.0f ,mvt_z);
+
+ /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
+
+ gl.glPushMatrix();
+ gl.glLightfv(GL_LIGHT1, GL_POSITION, light1Pos);
+ gl.glPopMatrix();
+
+ /*______________________ Draw Floor _______________________*/
+
+ gl.glPushMatrix();
+ gl.glCallList(ground);
+ gl.glPopMatrix();
+
+ /*@@@@@@@@@ Draw Lamp Post amd Lamp @@@@@@@@@@*/
+
+ gl.glPushMatrix();
+ gl.glCallList(21);
+ gl.glPopMatrix();
+
+ gl.glPushMatrix();
+ gl.glCallList(22);
+ gl.glPopMatrix();
+
+ gl.glPushMatrix();
+ gl.glEnable(GL_BLEND);
+ gl.glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+ gl.glCallList(501);
+ gl.glDisable(GL_BLEND);
+ gl.glPopMatrix();
+
+ /*||||||||||||||||||| Draw Left Wall ||||||||||||||||||*/
+
+ gl.glCallList(left_wall);
+
+ /*\\\\\\\\\\\\\\\\ Draw Right Wall \\\\\\\\\\\\\\*/
+
+ gl.glCallList(right_wall);
+
+ /*[[[[[[[[[[[[[[[[[[[ Draw Columns ]]]]]]]]]]]]]]]]]]]*/
+
+ /***** Place columns at front of scene. *****/
+
+ gl.glCallList(four_columns);
+
+ /***** Place columns at back of scene. *****/
+
+ gl.glPushMatrix();
+ gl.glTranslatef(0.0f, 0.0f, -9.0f);
+ gl.glCallList(four_columns);
+ gl.glPopMatrix();
+
+ /***** Place columns at centers of left and right walls. *****/
+
+ gl.glCallList(two_columns);
+
+ /************************* CUBE ***********************/
+
+ gl.glMaterialf(GL_FRONT, GL_SHININESS, 99.0f);
+ gl.glMaterialfv(GL_FRONT, GL_SPECULAR, cube_specular);
+
+ gl.glPushMatrix();
+ gl.glTranslatef(0.0f, 0.0f, -5.0f);
+ gl.glRotatef((360.0f / (30 * 2)) * tick, 0, 1, 0);
+ gl.glPushMatrix();
+ gl.glTranslatef(0.0f, 0.2f, 2.0f);
+ gl.glRotatef((360.0f / (30 * 1)) * tick, 1, 0, 0);
+ gl.glRotatef((360.0f / (30 * 2)) * tick, 0, 1, 0);
+ gl.glRotatef((360.0f / (30 * 4)) * tick, 0, 0, 1);
+
+ gl.glGetFloatv(GL_MODELVIEW_MATRIX, cubeXform);
+
+ gl.glCallList(satellite1);
+ gl.glCallList(panel1);
+
+ gl.glPopMatrix();
+ gl.glPopMatrix();
+
+ gl.glMaterialf(GL_FRONT, GL_SHININESS, 0.0f);
+ gl.glMaterialfv(GL_FRONT, GL_SPECULAR, shadow_specular);
+
+ /*................... CUBE SHADOWS .............................*/
+
+ gl.glEnable(GL_BLEND);
+ gl.glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+
+ gl.glPushMatrix();
+ gl.glMultMatrixf(shadowMat1_ground);
+ gl.glRotatef(-mvr_d, mvr_x, mvr_y, mvr_z);
+ gl.glTranslatef(-mvt_x, -mvt_y, -mvt_z); /* correct for modelview matrix */
+ gl.glMultMatrixf(cubeXform);
+
+
+ gl.glCallList(satellite2);
+ gl.glTranslatef(0.0f, -.040f, 0.0f);
+ gl.glCallList(panel2);
+ gl.glPopMatrix();
+
+ /* Shadow left wall only if cube is in front of left wall. */
+ if((tick*6) >= 220 && (tick*6) <= 320)
+ {
+ gl.glPushMatrix();
+ gl.glMultMatrixf(shadowMat1_left);
+ gl.glRotatef(-mvr_d, mvr_x, mvr_y, mvr_z);
+ gl.glTranslatef(-mvt_x, -mvt_y, -mvt_z); /* correct for modelview matrix */
+ gl.glMultMatrixf(cubeXform);
+ drawSatellite(shadow_diffuse, shadow_ambient, shadow_specular, shadow_shiny); /* draw left shadow */
+ drawPanels(shadow_diffuse, shadow_ambient);
+ gl.glPopMatrix();
+ }
+
+ /* Shadow back wall only if cube is in front of back wall. */
+ if((tick*6) >= 125 && (tick*6) <= 330)
+ {
+ gl.glPushMatrix();
+ gl.glMultMatrixf(shadowMat1_back);
+ gl.glRotatef(-mvr_d, mvr_x, mvr_y, mvr_z);
+ gl.glTranslatef(-mvt_x, -mvt_y, -mvt_z); /* correct for modelview matrix */
+ gl.glMultMatrixf(cubeXform);
+ drawSatellite(shadow_diffuse, shadow_ambient, shadow_specular, shadow_shiny); /* draw back wall shadow */
+ drawPanels(shadow_diffuse, shadow_ambient);
+ gl.glPopMatrix();
+ }
+
+ /* Shadow right wall only if cube is in front of right wall. */
+ if((tick*6) >= 40 && (tick*6) <= 145)
+ {
+ gl.glPushMatrix();
+ gl.glMultMatrixf(shadowMat1_right);
+ gl.glRotatef(-mvr_d, mvr_x, mvr_y, mvr_z);
+ gl.glTranslatef(-mvt_x, -mvt_y, -mvt_z); /* correct for modelview matrix */
+ gl.glMultMatrixf(cubeXform);
+ drawSatellite(shadow_diffuse, shadow_ambient, shadow_specular, shadow_shiny); /* draw right wall shadow */
+ drawPanels(shadow_diffuse, shadow_ambient);
+ gl.glPopMatrix();
+ }
+
+ gl.glDisable(GL_BLEND);
+
+ gl.glPopMatrix(); /* Clear the matrix stack */
+
+ glj.gljSwap();
+ glj.gljCheckGL();
+ glj.gljFree();
+
+ //if (!isSuspended()) repaint(); // Animate at full speed.
+ }
+
+ // Methods required for the implementation of MouseListener
+ public void mouseEntered( MouseEvent evt )
+ {
+ }
+
+ public void mouseExited( MouseEvent evt )
+ {
+ }
+
+ public void mousePressed( MouseEvent evt )
+ {
+ if ((evt.getModifiers() & evt.BUTTON3_MASK) != 0)
+ {
+ Tx = default_Tx;
+ Ty = default_Ty;
+ Tz = default_Tz;
+
+ mvt_x = default_mvt_x;
+ mvt_y = default_mvt_y;
+ mvt_z = default_mvt_z;
+
+ mvr_d = default_mvr_d;
+
+ tick = -1;
+
+ setSuspended(false);
+ moving = true;
+ }
+ else
+ {
+ setSuspended(moving);
+ moving = !moving;
+ }
+ }
+
+ public void mouseReleased( MouseEvent evt )
+ {
+ }
+
+ public void mouseClicked( MouseEvent evt )
+ {
+ }
+ /*%%%%%%%%%%%%%%%%%%%% DRAW CUBE %%%%%%%%%%%%%%%%%%*/
+
+ private void drawCube(float color[], float ambient[])
+ {
+ gl.glMaterialfv(GL_FRONT, GL_DIFFUSE, color);
+ gl.glMaterialfv(GL_FRONT, GL_AMBIENT, ambient);
+
+ for (int i = 0; i < 6; ++i)
+ {
+ gl.glNormal3fv(cube_normals[i]);
+ gl.glBegin(GL_POLYGON);
+ gl.glVertex4fv(cube_vertexes[i][0]);
+ gl.glVertex4fv(cube_vertexes[i][1]);
+ gl.glVertex4fv(cube_vertexes[i][2]);
+ gl.glVertex4fv(cube_vertexes[i][3]);
+ gl.glEnd();
+ }
+ }
+
+ /*OOOOOOOOOOO DRAW OCTOGON TOP OOOOOOOOOOOOO*/
+
+ private void drawOct()
+ {
+ for (int i = 0; i < 8; ++i)
+ {
+ gl.glNormal3f(0.0f, 0.0f, 1.0f);
+ gl.glBegin(GL_TRIANGLE_FAN);
+ gl.glVertex4fv(oct_vertices[i][0]);
+ gl.glVertex4fv(oct_vertices[i][1]);
+ gl.glVertex4fv(oct_vertices[i][2]);
+ gl.glEnd();
+ }
+ }
+
+ /*oooooooooooDRAW OCTOGON SIDES ooooooooo*/
+
+ private void drawOctSides()
+ {
+ for (int i = 0; i < 8; ++i)
+ {
+ gl.glNormal3fv(oct_side_normals[i]);
+ gl.glBegin(GL_POLYGON);
+ gl.glVertex4fv(oct_side_vertices[i][0]);
+ gl.glVertex4fv(oct_side_vertices[i][1]);
+ gl.glVertex4fv(oct_side_vertices[i][2]);
+ gl.glVertex4fv(oct_side_vertices[i][3]);
+ gl.glEnd();
+ }
+ }
+
+ /*SSSSSSSSSSSSSSSS DRAW SATELLITE BODY SSSSSSSSSSSSSSSSSSS*/
+
+ private void drawSatellite(float diffuse[], float ambient[], float specular[], float shiny[])
+ {
+ gl.glMaterialfv(GL_FRONT, GL_DIFFUSE, diffuse);
+ gl.glMaterialfv(GL_FRONT, GL_AMBIENT, ambient);
+ gl.glMaterialfv(GL_FRONT, GL_SPECULAR, specular);
+ gl.glMaterialfv(GL_FRONT, GL_SHININESS, shiny);
+
+ gl.glPushMatrix();
+ gl.glScalef(0.3f, 0.3f, 0.9f);
+ gl.glPushMatrix();
+ drawOctSides();
+ gl.glPopMatrix();
+
+ gl.glPushMatrix();
+ gl.glTranslatef(0.0f, 0.0f, 0.0f);
+ drawOct();
+ gl.glPopMatrix();
+ gl.glPushMatrix();
+ gl.glRotatef(180f, 1.0f, 0.0f, 0.0f);
+ gl.glTranslatef(0.0f, 0.0f, 1.0f);
+ drawOct();
+ gl.glPopMatrix();
+ gl.glPopMatrix();
+ }
+
+ /*PPPPPPPPPPPPPPPP DRAW SOLAR PANELS PPPPPPPPPPPP*/
+
+ private void drawPanels(float color[], float ambient[])
+ {
+ gl.glMaterialfv(GL_FRONT, GL_DIFFUSE, color);
+ gl.glMaterialfv(GL_FRONT, GL_AMBIENT, ambient);
+
+ gl.glPushMatrix();
+ gl.glTranslatef(0.95f, 0.0f, -0.45f);
+ gl.glRotatef(45.0f, 1.0f, 0.0f, 0.0f);
+ gl.glScalef(0.65f, 0.20f, 0.02f);
+ drawCube(color, ambient);
+ gl.glPopMatrix();
+ gl.glPushMatrix();
+ gl.glTranslatef(-0.95f, 0.0f, -0.45f);
+ gl.glRotatef(45.0f, 1.0f, 0.0f, 0.0f);
+ gl.glScalef(0.65f, 0.20f, 0.02f);
+ drawCube(color, ambient);
+ gl.glPopMatrix();
+ }
+
+ /*################ DRAW FLOOR ################*/
+
+ private void drawFloor(float f_color[], float ambient[])
+ {
+
+ gl.glMaterialfv(GL_FRONT, GL_DIFFUSE, f_color);
+ gl.glMaterialfv(GL_FRONT, GL_AMBIENT, ambient);
+
+ gl.glBegin(GL_QUADS);
+ gl.glVertex3f(-1.0f, -1.0f, 0.0f);
+ gl.glVertex3f(1.0f, -1.0f, 0.0f);
+ gl.glVertex3f(1.0f, 1.0f, 0.0f);
+ gl.glVertex3f(-1.0f, 1.0f, 0.0f);
+ gl.glEnd();
+ }
+
+ /*||||||||||||||| DRAW GROUND |||||||||||||||||*/
+
+ /* Ground coordinates are in drawGround() below. Subdivision */
+ /* of triangles id done by subDivide(). */
+
+ private void subDivide(float u1[], float u2[], float u3[], int depth)
+ {
+ float u12[] = new float[3];
+ float u23[] = new float[3];
+ float u31[] = new float[3];
+
+ if (depth == 0)
+ {
+ gl.glBegin(GL_POLYGON);
+ gl.glNormal3f(0.0f, 0.0f, 1.0f); gl.glVertex3fv(u1);
+ gl.glNormal3f(0.0f, 0.0f, 1.0f); gl.glVertex3fv(u2);
+ gl.glNormal3f(0.0f, 0.0f, 1.0f); gl.glVertex3fv(u3);
+ gl.glEnd();
+ return;
+ }
+
+ for (int i = 0; i < 3; i++)
+ {
+ u12[i] = (u1[i] + u2[i]) / 2.0f;
+ u23[i] = (u2[i] + u3[i]) / 2.0f;
+ u31[i] = (u3[i] + u1[i]) / 2.0f;
+ }
+ subDivide(u1, u12, u31, depth - 1);
+ subDivide(u2, u23, u12, depth - 1);
+ subDivide(u3, u31, u23, depth - 1);
+ subDivide(u12, u23, u31, depth - 1);
+ }
+
+ private void drawGround()
+ {
+ /* Use two subdivided triangles for the unscaled 1X1 square. */
+ /* Subdivide to this depth: */
+
+ int maxdepth = 2;
+
+ /* Coordinates of first triangle: */
+
+ float u1[] = {-1.0f, -1.0f, 0.0f};
+ float u2[] = {1.0f, -1.0f, 0.0f};
+ float u3[] = {1.0f, 1.0f, 0.0f};
+
+ /* Coordinates of second triangle: */
+
+ float v1[] = {-1.0f, -1.0f, 0.0f};
+ float v2[] = {1.0f, 1.0f, 0.0f};
+ float v3[] = {-1.0f, 1.0f, 0.0f};
+
+ subDivide(u1, u2, u3, maxdepth);
+ subDivide(v1, v2, v3, maxdepth);
+ }
+
+ /* Matrix for shadow. From Mark Kilgard's "scube". */
+
+ private void myShadowMatrix(float ground[], float light[], float shadowMat[])
+ {
+ float dot;
+
+ dot =
+ ground[0] * light[0] +
+ ground[1] * light[1] +
+ ground[2] * light[2] +
+ ground[3] * light[3];
+
+ shadowMat[0] = dot - light[0] * ground[0];
+ shadowMat[4] = -light[0] * ground[1];
+ shadowMat[8] = -light[0] * ground[2];
+ shadowMat[12] = -light[0] * ground[3];
+
+ shadowMat[1] = -light[1] * ground[0];
+ shadowMat[5] = dot - light[1] * ground[1];
+ shadowMat[9] = -light[1] * ground[2];
+ shadowMat[13] = -light[1] * ground[3];
+
+ shadowMat[2] = -light[2] * ground[0];
+ shadowMat[6] = -light[2] * ground[1];
+ shadowMat[10] = dot - light[2] * ground[2];
+ shadowMat[14] = -light[2] * ground[3];
+
+ shadowMat[3] = -light[3] * ground[0];
+ shadowMat[7] = -light[3] * ground[1];
+ shadowMat[11] = -light[3] * ground[2];
+ shadowMat[15] = dot - light[3] * ground[3];
+ }
+ }
+}
diff --git a/demos/RonsDemos/moth_plugin13.html b/demos/RonsDemos/moth_plugin13.html new file mode 100644 index 0000000..b10d99e --- /dev/null +++ b/demos/RonsDemos/moth_plugin13.html @@ -0,0 +1,50 @@ +<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.61 [en] (Win98; U) [Netscape]">
+ <title>Moth by Robert Doyle; ported to Java by Ron Cemer</title>
+</head>
+<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#e6e6ff">
+Moth applet
+<br>Originially written by Silicon Graphics
+<br>Ported to Java by Ron Cemer
+<br>Click the left mouse button within the window to pause/resume simulation.
+<br>Click the right mouse button within the window to restart simulation.
+<br>
+<!--"CONVERTED_APPLET"-->
+<!-- CONVERTER VERSION 1.3 --> +<SCRIPT LANGUAGE="JavaScript"><!-- + var _info = navigator.userAgent; var _ns = false; + var _ie = (_info.indexOf("MSIE") > 0 && _info.indexOf("Win") > 0 && _info.indexOf("Windows 3.1") < 0); +//--></SCRIPT> +<COMMENT><SCRIPT LANGUAGE="JavaScript1.1"><!-- + var _ns = (navigator.appName.indexOf("Netscape") >= 0 && ((_info.indexOf("Win") > 0 && _info.indexOf("Win16") < 0 && java.lang.System.getProperty("os.version").indexOf("3.5") < 0) || (_info.indexOf("Sun") > 0) || (_info.indexOf("Linux") > 0))); +//--></SCRIPT></COMMENT> + +<SCRIPT LANGUAGE="JavaScript"><!-- + if (_ie == true) document.writeln('<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" WIDTH = 400 HEIGHT = 400 codebase="http://java.sun.com/products/plugin/1.3/jinstall-13-win32.cab#Version=1,3,0,0"><NOEMBED><XMP>'); + else if (_ns == true) document.writeln('<EMBED type="application/x-java-applet;version=1.3" CODE = "moth.class" WIDTH = 400 HEIGHT = 400 scriptable=false pluginspage="http://java.sun.com/products/plugin/1.3/plugin-install.html"><NOEMBED><XMP>'); +//--></SCRIPT> +<APPLET CODE = "moth.class" WIDTH = 400 HEIGHT = 400></XMP> +<PARAM NAME = CODE VALUE = "moth.class" >
+ +<PARAM NAME="type" VALUE="application/x-java-applet;version=1.3"> +<PARAM NAME="scriptable" VALUE="false"> + +</APPLET> + +</NOEMBED></EMBED></OBJECT> + + +<!-- +<APPLET CODE = "moth.class" WIDTH = 400 HEIGHT = 400>
+
+
+</APPLET> +--> +<!--"END_CONVERTED_APPLET"-->
+
+<hr>
+</body>
+</html>
diff --git a/demos/RonsDemos/movelight.html b/demos/RonsDemos/movelight.html new file mode 100644 index 0000000..a323355 --- /dev/null +++ b/demos/RonsDemos/movelight.html @@ -0,0 +1,20 @@ +<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.61 [en] (Win98; U) [Netscape]">
+ <title>Movelight by Silicon Graphics; ported to Java by Ron Cemer</title>
+</head>
+<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#e6e6ff">
+Movelight applet
+<br>Originially written by Silicon Graphics
+<br>Ported to Java by Ron Cemer
+<br>
+<hr>Each time you click inside the window, the light source will rotate to
+<br>a new position.
+<br>
+<applet code="movelight.class" width=400 height=400>
+</applet>
+<hr>
+</body>
+</html>
diff --git a/demos/RonsDemos/movelight.java b/demos/RonsDemos/movelight.java new file mode 100644 index 0000000..bb983d9 --- /dev/null +++ b/demos/RonsDemos/movelight.java @@ -0,0 +1,322 @@ +/**
+ * @(#) movelight.java
+ * @(#) author: Silicon Graphics (converted to Java by Ron Cemer)
+ */
+
+/*
+ * Copyright (c) 1993-1997, Silicon Graphics, Inc.
+ * ALL RIGHTS RESERVED
+ * Permission to use, copy, modify, and distribute this software for
+ * any purpose and without fee is hereby granted, provided that the above
+ * copyright notice appear in all copies and that both the copyright notice
+ * and this permission notice appear in supporting documentation, and that
+ * the name of Silicon Graphics, Inc. not be used in advertising
+ * or publicity pertaining to distribution of the software without specific,
+ * written prior permission.
+ *
+ * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
+ * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
+ * FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
+ * GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT,
+ * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY
+ * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION,
+ * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF
+ * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN
+ * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
+ * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * US Government Users Restricted Rights
+ * Use, duplication, or disclosure by the Government is subject to
+ * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
+ * (c)(1)(ii) of the Rights in Technical Data and Computer Software
+ * clause at DFARS 252.227-7013 and/or in similar or successor
+ * clauses in the FAR or the DOD or NASA FAR Supplement.
+ * Unpublished-- rights reserved under the copyright laws of the
+ * United States. Contractor/manufacturer is Silicon Graphics,
+ * Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311.
+ *
+ * OpenGL(R) is a registered trademark of Silicon Graphics, Inc.
+ */
+
+/*
+ * movelight.java
+ * This applet demonstrates when to issue lighting and
+ * transformation commands to render a model with a light
+ * which is moved by a modeling transformation (rotate or
+ * translate). The light position is reset after the modeling
+ * transformation is called. The eye position does not change.
+ *
+ * A torus is drawn using a grey material characteristic.
+ * A single light source illuminates the object.
+ *
+ * Interaction: pressing the left mouse button alters
+ * the modeling transformation (x rotation) by 30 degrees.
+ * The scene is then redrawn with the light in a new position.
+ */
+
+import java.applet.*;
+import java.awt.*;
+import java.awt.event.*;
+import java.lang.*;
+import java.util.*;
+import java.io.*;
+import java.util.*;
+import gl4java.GLContext;
+import gl4java.awt.GLCanvas;
+
+public class movelight extends Applet
+{
+ private static final float boxnormals[][] =
+ {
+ {-1.0f, 0.0f, 0.0f},
+ {0.0f, 1.0f, 0.0f},
+ {1.0f, 0.0f, 0.0f},
+ {0.0f, -1.0f, 0.0f},
+ {0.0f, 0.0f, 1.0f},
+ {0.0f, 0.0f, -1.0f}
+ };
+ private static final int boxfaces[][] =
+ {
+ {0, 1, 2, 3},
+ {3, 2, 6, 7},
+ {7, 6, 5, 4},
+ {4, 5, 1, 0},
+ {5, 6, 2, 1},
+ {7, 4, 0, 3}
+ };
+
+ movelightCanvas canvas = null;
+
+
+ /* Initialize the applet */
+
+
+ public void init()
+ {
+ Dimension d = getSize();
+ setLayout(new BorderLayout());
+ canvas = new movelightCanvas(d.width, d.height);
+ add("Center", canvas);
+ }
+
+
+ /* Start the applet */
+
+
+ public void start()
+ {
+ }
+
+
+ /* Stop the applet */
+
+
+ public void stop()
+ {
+ }
+
+
+ /* Destroy the applet */
+
+
+ public void destroy()
+ {
+ canvas.cvsDispose();
+ }
+
+
+ /* Local GLCanvas extension class */
+
+
+ private class movelightCanvas extends GLCanvas implements MouseListener
+ {
+ private static final float M_PI = 3.14159265359f;
+
+ private int spin = 0;
+
+ public movelightCanvas(int w, int h)
+ {
+ super(w, h);
+ GLContext.gljNativeDebug = false;
+ GLContext.gljClassDebug = false;
+ }
+
+ public void preInit()
+ {
+ doubleBuffer = true;
+ stereoView = false;
+ }
+
+ public void init()
+ {
+ System.out.println("init(): " + this);
+ reshape(getSize().width, getSize().height);
+
+ gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
+ gl.glShadeModel(GL_SMOOTH);
+ gl.glEnable(GL_LIGHTING);
+ gl.glEnable(GL_LIGHT0);
+ gl.glEnable(GL_DEPTH_TEST);
+
+ glj.gljCheckGL();
+
+ addMouseListener(this);
+ }
+
+ public void cvsDispose()
+ {
+ System.out.println("destroy(): " + this);
+ removeMouseListener(this);
+ super.cvsDispose();
+ }
+
+ public void reshape(int width, int height)
+ {
+ gl.glViewport(0,0,width,height);
+ gl.glMatrixMode(GL_PROJECTION);
+ gl.glLoadIdentity();
+ glu.gluPerspective(40.0f,(float)width/(float)height,1.0f,20.0f);
+ gl.glMatrixMode(GL_MODELVIEW);
+ gl.glLoadIdentity();
+ }
+
+ public void display()
+ {
+ if (glj.gljMakeCurrent() == false) return;
+
+ float position[] = { 0.0f, 0.0f, 1.5f, 1.0f };
+
+ gl.glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+ gl.glPushMatrix();
+ glu.gluLookAt(0.0f, 0.0f, 5.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f);
+
+ gl.glPushMatrix();
+ gl.glRotated((double)spin, 1.0, 0.0, 0.0);
+ gl.glLightfv(GL_LIGHT0, GL_POSITION, position);
+
+ gl.glTranslated(0.0, 0.0, 1.5);
+ gl.glDisable(GL_LIGHTING);
+ gl.glColor3f(0.0f, 1.0f, 1.0f);
+ glutWireCube(0.1f);
+ gl.glEnable(GL_LIGHTING);
+ gl.glPopMatrix();
+
+ glutSolidTorus(0.275f, 0.85f, 8, 15);
+ gl.glPopMatrix();
+ gl.glFlush();
+
+ glj.gljSwap();
+ glj.gljCheckGL();
+ glj.gljFree();
+ }
+
+ // Imported from glut.
+ private void glutWireCube(float size)
+ {
+ drawBox(size, GL_LINE_LOOP);
+ }
+
+ // Imported from glut.
+ private void glutSolidTorus
+ (float innerRadius,
+ float outerRadius,
+ int nsides,
+ int rings)
+ {
+ doughnut(innerRadius, outerRadius, nsides, rings);
+ }
+
+ // Imported from glut.
+ private void drawBox(float size, int type)
+ {
+ float v[][] = new float[8][3];
+ int i;
+
+ v[0][0] = v[1][0] = v[2][0] = v[3][0] = -size / 2;
+ v[4][0] = v[5][0] = v[6][0] = v[7][0] = size / 2;
+ v[0][1] = v[1][1] = v[4][1] = v[5][1] = -size / 2;
+ v[2][1] = v[3][1] = v[6][1] = v[7][1] = size / 2;
+ v[0][2] = v[3][2] = v[4][2] = v[7][2] = -size / 2;
+ v[1][2] = v[2][2] = v[5][2] = v[6][2] = size / 2;
+
+ for (i = 5; i >= 0; i--)
+ {
+ gl.glBegin(type);
+ gl.glNormal3fv(boxnormals[i]);
+ gl.glVertex3fv(v[boxfaces[i][0]]);
+ gl.glVertex3fv(v[boxfaces[i][1]]);
+ gl.glVertex3fv(v[boxfaces[i][2]]);
+ gl.glVertex3fv(v[boxfaces[i][3]]);
+ gl.glEnd();
+ }
+ }
+
+ // Imported from glut.
+ private void doughnut(float r, float R, int nsides, int rings)
+ {
+ int i, j;
+ float theta, phi, theta1;
+ float cosTheta, sinTheta;
+ float cosTheta1, sinTheta1;
+ float ringDelta, sideDelta;
+
+ ringDelta = 2.0f * M_PI / rings;
+ sideDelta = 2.0f * M_PI / nsides;
+
+ theta = 0.0f;
+ cosTheta = 1.0f;
+ sinTheta = 0.0f;
+ for (i = rings - 1; i >= 0; i--)
+ {
+ theta1 = theta + ringDelta;
+ cosTheta1 = (float)Math.cos(theta1);
+ sinTheta1 = (float)Math.sin(theta1);
+ gl.glBegin(GL_QUAD_STRIP);
+ phi = 0.0f;
+ for (j = nsides; j >= 0; j--)
+ {
+ float cosPhi, sinPhi, dist;
+
+ phi += sideDelta;
+ cosPhi = (float)Math.cos(phi);
+ sinPhi = (float)Math.sin(phi);
+ dist = R + r * cosPhi;
+
+ gl.glNormal3f(cosTheta1 * cosPhi, -sinTheta1 * cosPhi, sinPhi);
+ gl.glVertex3f(cosTheta1 * dist, -sinTheta1 * dist, r * sinPhi);
+ gl.glNormal3f(cosTheta * cosPhi, -sinTheta * cosPhi, sinPhi);
+ gl.glVertex3f(cosTheta * dist, -sinTheta * dist, r * sinPhi);
+ }
+ gl.glEnd();
+ theta = theta1;
+ cosTheta = cosTheta1;
+ sinTheta = sinTheta1;
+ }
+ }
+
+ // Methods required for the implementation of MouseListener
+ public void mouseEntered( MouseEvent evt )
+ {
+ }
+
+ public void mouseExited( MouseEvent evt )
+ {
+ }
+
+ public void mousePressed( MouseEvent evt )
+ {
+ spin = (spin + 30) % 360;
+ repaint();
+ }
+
+ public void mouseReleased( MouseEvent evt )
+ {
+ }
+
+ public void mouseClicked( MouseEvent evt )
+ {
+ }
+ }
+}
diff --git a/demos/RonsDemos/movelight_plugin13.html b/demos/RonsDemos/movelight_plugin13.html new file mode 100644 index 0000000..2c0d494 --- /dev/null +++ b/demos/RonsDemos/movelight_plugin13.html @@ -0,0 +1,51 @@ +<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.61 [en] (Win98; U) [Netscape]">
+ <title>Movelight by Silicon Graphics; ported to Java by Ron Cemer</title>
+</head>
+<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#e6e6ff">
+Movelight applet
+<br>Originially written by Silicon Graphics
+<br>Ported to Java by Ron Cemer
+<br>
+<hr>Each time you click inside the window, the light source will rotate to
+<br>a new position.
+<br>
+<!--"CONVERTED_APPLET"-->
+<!-- CONVERTER VERSION 1.3 --> +<SCRIPT LANGUAGE="JavaScript"><!-- + var _info = navigator.userAgent; var _ns = false; + var _ie = (_info.indexOf("MSIE") > 0 && _info.indexOf("Win") > 0 && _info.indexOf("Windows 3.1") < 0); +//--></SCRIPT> +<COMMENT><SCRIPT LANGUAGE="JavaScript1.1"><!-- + var _ns = (navigator.appName.indexOf("Netscape") >= 0 && ((_info.indexOf("Win") > 0 && _info.indexOf("Win16") < 0 && java.lang.System.getProperty("os.version").indexOf("3.5") < 0) || (_info.indexOf("Sun") > 0) || (_info.indexOf("Linux") > 0))); +//--></SCRIPT></COMMENT> + +<SCRIPT LANGUAGE="JavaScript"><!-- + if (_ie == true) document.writeln('<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" WIDTH = 400 HEIGHT = 400 codebase="http://java.sun.com/products/plugin/1.3/jinstall-13-win32.cab#Version=1,3,0,0"><NOEMBED><XMP>'); + else if (_ns == true) document.writeln('<EMBED type="application/x-java-applet;version=1.3" CODE = "movelight.class" WIDTH = 400 HEIGHT = 400 scriptable=false pluginspage="http://java.sun.com/products/plugin/1.3/plugin-install.html"><NOEMBED><XMP>'); +//--></SCRIPT> +<APPLET CODE = "movelight.class" WIDTH = 400 HEIGHT = 400></XMP> +<PARAM NAME = CODE VALUE = "movelight.class" >
+ +<PARAM NAME="type" VALUE="application/x-java-applet;version=1.3"> +<PARAM NAME="scriptable" VALUE="false"> + +</APPLET> + +</NOEMBED></EMBED></OBJECT> + + +<!-- +<APPLET CODE = "movelight.class" WIDTH = 400 HEIGHT = 400>
+
+
+</APPLET> +--> +<!--"END_CONVERTED_APPLET"-->
+
+<hr>
+</body>
+</html>
diff --git a/demos/RonsDemos/nonAnimApplet.skel b/demos/RonsDemos/nonAnimApplet.skel new file mode 100644 index 0000000..a1697d2 --- /dev/null +++ b/demos/RonsDemos/nonAnimApplet.skel @@ -0,0 +1,120 @@ +/**
+ * Skeleton for non-animated applets (applets which redraw once each
+ * time the repaint() method is called, but do not continually animate
+ * automatically).
+ */
+
+/**
+ * @(#) [place applet name here].java
+ * @(#) author: [place author here] (converted to Java by Ron Cemer)
+ */
+
+import java.applet.*;
+import java.awt.*;
+import java.awt.event.*;
+import java.lang.*;
+import java.util.*;
+import java.io.*;
+import java.util.*;
+import gl4java.GLContext;
+import gl4java.awt.GLCanvas;
+
+public class myapplet extends Applet
+{
+ myappletCanvas canvas = null;
+
+
+ /* Initialize the applet */
+
+
+ public void init()
+ {
+ Dimension d = getSize();
+ setLayout(new BorderLayout());
+ canvas = new myappletCanvas(d.width, d.height);
+ add("Center", canvas);
+ }
+
+
+ /* Start the applet */
+
+
+ public void start()
+ {
+ }
+
+
+ /* Stop the applet */
+
+
+ public void stop()
+ {
+ }
+
+
+ /* Destroy the applet */
+
+
+ public void destroy()
+ {
+ canvas.destroy();
+ }
+
+
+ /* Local GLCanvas extension class */
+
+
+ private class myappletCanvas extends GLCanvas
+ {
+ public myappletCanvas(int w, int h)
+ {
+ super(w, h);
+ GLContext.gljNativeDebug = false;
+ GLContext.gljClassDebug = false;
+ }
+
+ public void preInit()
+ {
+ doubleBuffer = true;
+ stereoView = false;
+ }
+
+ public void init()
+ {
+ System.out.println("init(): " + this);
+ reshape(getSize().width, getSize().height);
+
+// Put OpenGL initialization code here.
+
+ glj.gljCheckGL();
+ }
+
+ public void destroy()
+ {
+ System.out.println("destroy(): " + this);
+
+// Put any special takedown code here.
+
+ cvsDispose();
+ }
+
+ public void reshape(int width, int height)
+ {
+ gl.glViewport(0,0,width,height);
+
+// Put any custom reshape code here.
+
+ }
+
+ public void display()
+ {
+ if (glj.gljMakeCurrent(true) == false) return;
+
+// Put drawing code here.
+
+ glj.gljSwap();
+ glj.gljCheckGL();
+ glj.gljFree();
+ }
+ }
+}
diff --git a/demos/RonsDemos/particle.html b/demos/RonsDemos/particle.html new file mode 100644 index 0000000..ec8231d --- /dev/null +++ b/demos/RonsDemos/particle.html @@ -0,0 +1,26 @@ +<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.61 [en] (Win98; U) [Netscape]">
+ <title>Particle by Nate Robins; ported to Java by Ron Cemer</title>
+</head>
+<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#e6e6ff">
+Particle applet
+<br>Originially written by Nate Robins
+<br>Ported to Java by Ron Cemer
+<br>Drag the mouse inside the window to rotate the view.
+<br>Click inside the window, then press any of the following keys:
+<br>W/w: waterfall mode
+<br>F/f: fountain mode
+<br>S/s: toggle sphere collision
+<br>L/l: toggle between points lines
+<br>P/p: increase/decrease point size
+<br>+/-: increase/decrease number of particles
+<br>R/r: reset view rotation
+<br>
+<applet code="particle.class" width=400 height=400>
+</applet>
+<hr>
+</body>
+</html>
diff --git a/demos/RonsDemos/particle.java b/demos/RonsDemos/particle.java new file mode 100644 index 0000000..2369b00 --- /dev/null +++ b/demos/RonsDemos/particle.java @@ -0,0 +1,613 @@ +/**
+ * @(#) particle.java
+ * @(#) author: Nate Robins (converted to Java by Ron Cemer)
+ */
+
+/*
+ particle
+ Nate Robins, 1997
+
+ An example of a simple particle system.
+ */
+
+import java.applet.*;
+import java.awt.*;
+import java.awt.event.*;
+import java.lang.*;
+import java.util.*;
+import java.io.*;
+import java.util.*;
+import gl4java.GLContext;
+import gl4java.awt.GLAnimCanvas;
+import gl4java.applet.SimpleGLAnimApplet1;
+
+public class particle extends SimpleGLAnimApplet1
+{
+ private static final int PS_WATERFALL = 0, PS_FOUNTAIN = 1;
+ private static Random random = null;
+
+ /* Initialize the applet */
+
+
+ public void init()
+ {
+ super.init();
+ Dimension d = getSize();
+ canvas = new particleCanvas(d.width, d.height);
+ add("Center", canvas);
+ canvas.requestFocus();
+ random = new Random(System.currentTimeMillis());
+ }
+
+
+ private class PSsphere
+ {
+ protected float x, y, z;
+ protected float radius, radiussquared;
+
+ public PSsphere(float x, float y, float z, float radius)
+ {
+ this.x = x;
+ this.y = y;
+ this.z = z;
+ this.radius = radius;
+ radiussquared = radius*radius;
+ }
+ }
+
+ private class PSparticle
+ {
+ private final float PS_GRAVITY = -9.8f;
+
+ protected float position[] = new float[3]; /* current position */
+ protected float previous[] = new float[3]; /* previous position */
+ protected float velocity[] = new float[3]; /* velocity (magnitude & direction) */
+ protected float dampening = 0.0f; /* % of energy lost on collision */
+ protected boolean alive = false; /* is this particle alive? */
+
+ public PSparticle()
+ {
+ velocity[0] = previous[0] = position[0] = 0.0f;
+ velocity[1] = previous[1] = position[1] = 0.0f;
+ velocity[2] = previous[2] = position[2] = 0.0f;
+ dampening = 0.0f;
+ alive = false;
+ }
+
+ public PSparticle(float dt, int type)
+ {
+ if (type == PS_WATERFALL)
+ {
+ velocity[0] = (random.nextFloat()-0.5f);
+ velocity[1] = 0.0f;
+ velocity[2] = 0.5f*random.nextFloat();
+ position[0] = 0.0f;
+ position[1] = 2.0f;
+ position[2] = 0.0f;
+ dampening = 0.45f*random.nextFloat();
+ }
+ else if (type == PS_FOUNTAIN)
+ {
+ velocity[0] = 2.0f*(random.nextFloat()-0.5f);
+ velocity[1] = 6.0f;
+ velocity[2] = 2.0f*(random.nextFloat()-0.5f);
+ position[0] = 0.0f;
+ position[1] = 0.0f;
+ position[2] = 0.0f;
+ dampening = 0.35f*random.nextFloat();
+ }
+ previous[0] = position[0];
+ previous[1] = position[1];
+ previous[2] = position[2];
+ alive = true;
+ psTimeStep(2.0f*dt*random.nextFloat());
+ }
+
+ public void psTimeStep(float dt)
+ {
+ if (!alive) return;
+
+ velocity[1] += PS_GRAVITY*dt;
+
+ previous[0] = position[0];
+ previous[1] = position[1];
+ previous[2] = position[2];
+
+ position[0] += velocity[0]*dt;
+ position[1] += velocity[1]*dt;
+ position[2] += velocity[2]*dt;
+ }
+
+ /* psBounce: the particle has gone past (or exactly hit) the
+ ground plane, so calculate the time at which the particle
+ actually intersected the ground plane (s). essentially, this
+ just rolls back time to when the particle hit the ground plane,
+ then starts time again from then.
+
+ - - o A (previous position)
+ | | \
+ | s \ o (position it _should_ be at) -
+ t | \ / | t - s
+ | - ------X-------- -
+ | \
+ - o B (new position)
+
+ A + V*s = 0 or s = -A/V
+
+ to calculate where the particle should be:
+
+ A + V*t + V*(t-s)*d
+
+ where d is a damping factor which accounts for the loss
+ of energy due to the bounce. */
+ public void psBounce(float dt)
+ {
+ if (!alive) return;
+
+ /* since we know it is the ground plane, we only need to
+ calculate s for a single dimension. */
+ float s = -previous[1]/velocity[1];
+
+ position[0] =
+ (previous[0] + velocity[0]*s + velocity[0]*(dt-s)*dampening);
+ position[1] =
+ -velocity[1] * (dt-s) * dampening; /* reflect */
+ position[2] =
+ (previous[2] + velocity[2]*s + velocity[2]*(dt-s)*dampening);
+
+ /* damp the reflected velocity (since the particle hit
+ something, it lost some energy) */
+ velocity[0] *= dampening;
+ velocity[1] *= -dampening; /* reflect */
+ velocity[2] *= dampening;
+ }
+
+ public void psCollide(PSsphere sphere)
+ {
+ if (!alive) return;
+
+ float vx = position[0] - sphere.x;
+ float vy = position[1] - sphere.y;
+ float vz = position[2] - sphere.z;
+ float distance, distancesquared;
+
+ // Use distancesquared and radiussquared for comparison,
+ // eliminating the sqrt() call unless it is absolutely
+ // necessary, since it is time-consuming.
+ distancesquared = (vx*vx + vy*vy + vz*vz);
+ if (distancesquared < sphere.radiussquared)
+ {
+ distance = (float)Math.sqrt(distancesquared);
+ position[0] = sphere.x+(vx/distance)*sphere.radius;
+ position[1] = sphere.y+(vy/distance)*sphere.radius;
+ position[2] = sphere.z+(vz/distance)*sphere.radius;
+ previous[0] = position[0];
+ previous[1] = position[1];
+ previous[2] = position[2];
+ velocity[0] = vx/distance;
+ velocity[1] = vy/distance;
+ velocity[2] = vz/distance;
+ }
+ }
+ }
+
+
+ /* Local GLAnimCanvas extension class */
+
+
+ private class particleCanvas extends GLAnimCanvas
+ implements MouseListener, MouseMotionListener, KeyListener
+ {
+ private static final float M_PI = 3.14159265359f;
+
+ private MatrixFuncs mtxfuncs = null;
+ private int prevMouseX, prevMouseY;
+ private boolean mouseRButtonDown = false;
+ private float rot_matrix[] =
+ {
+ 1.0f, 0.0f, 0.0f, 0.0f,
+ 0.0f, 1.0f, 0.0f, 0.0f,
+ 0.0f, 0.0f, 1.0f, 0.0f,
+ 0.0f, 0.0f, 0.0f, 1.0f
+ };
+
+ private PSparticle[] particles = null;
+ private PSsphere sphere = new PSsphere(0.0f,1.0f,0.0f,0.25f);
+ private int num_particles = 5000;
+ private int living = 0; /* index to end of live particles */
+ private int type = PS_WATERFALL;
+ private boolean use_lines = false;
+ private boolean do_sphere = false;
+ private float flow = 500.0f;
+ private float slow_down = 1.0f;
+ private int point_size = 3;
+ private int sphere_list = 0;
+
+ public particleCanvas(int w, int h)
+ {
+ super(w, h);
+ GLContext.gljNativeDebug = false;
+ GLContext.gljClassDebug = false;
+ setAnimateFps(30.0);
+
+ mtxfuncs = new MatrixFuncs();
+ }
+
+ public void preInit()
+ {
+ doubleBuffer = true;
+ stereoView = false;
+ }
+
+ public void init()
+ {
+ System.out.println("init(): " + this);
+ reshape(getSize().width, getSize().height);
+
+ setInitialRotation();
+
+ particles = new PSparticle[num_particles];
+ for (int i = 0; i < num_particles; i++)
+ particles[i] = new PSparticle();
+
+ sphere_list = gl.glGenLists(1);
+ gl.glNewList(sphere_list,GL_COMPILE);
+ gl.glColor3ub((byte)0, (byte)255, (byte)128);
+ int qobj = glu.gluNewQuadric();
+ glu.gluQuadricOrientation(qobj,GLU_OUTSIDE);
+ glu.gluQuadricNormals(qobj,GLU_SMOOTH);
+ glu.gluQuadricTexture(qobj,false);
+ glu.gluSphere(qobj,sphere.radius, 16, 16);
+ glu.gluDeleteQuadric(qobj);
+ gl.glEndList();
+
+ glj.gljCheckGL();
+
+ addMouseListener(this);
+ addMouseMotionListener(this);
+ addKeyListener(this);
+ }
+
+ public void doCleanup()
+ {
+ System.out.println("destroy(): " + this);
+ removeMouseListener(this);
+ removeMouseMotionListener(this);
+ removeKeyListener(this);
+ }
+
+ public void reshape(int width, int height)
+ {
+ gl.glViewport(0,0,width,height);
+
+ float black[] = { 0, 0, 0, 0 };
+
+ gl.glMatrixMode(GL_PROJECTION);
+ gl.glLoadIdentity();
+ glu.gluPerspective(60, 1, 0.1, 1000);
+ gl.glMatrixMode(GL_MODELVIEW);
+ gl.glLoadIdentity();
+ glu.gluLookAt(0, 1, 3, 0, 1, 0, 0, 1, 0);
+ gl.glFogfv(GL_FOG_COLOR, black);
+ gl.glFogf(GL_FOG_START, 2.5f);
+ gl.glFogf(GL_FOG_END, 4f);
+ gl.glEnable(GL_FOG);
+ gl.glFogi(GL_FOG_MODE, GL_LINEAR);
+ gl.glPointSize(point_size);
+ gl.glEnable(GL_POINT_SMOOTH);
+ gl.glEnable(GL_BLEND);
+ gl.glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+ gl.glEnable(GL_COLOR_MATERIAL);
+ gl.glEnable(GL_DEPTH_TEST);
+ gl.glEnable(GL_LIGHT0);
+
+ timedelta();
+ }
+
+ public void display()
+ {
+ if (glj.gljMakeCurrent() == false) return;
+
+ gl.glPushMatrix();
+ gl.glMultMatrixf(rot_matrix);
+
+ // Update particles.
+
+ float dt = timedelta();
+ float truedt = dt;
+
+ /* slow the simulation if we can't keep the frame rate up
+ around 10 fps */
+ if (dt > 0.1f)
+ slow_down = 0.75f;
+ else if (dt < 0.1f)
+ slow_down = 1.0f;
+ dt *= slow_down;
+
+ /* resurrect a few particles */
+ for (int i = 0; i < flow*dt; i++)
+ {
+ particles[living] = new PSparticle(dt,type);
+ living++;
+ if (living >= num_particles) living = 0;
+ }
+
+ for (int i = 0; i < num_particles; i++)
+ {
+ particles[i].psTimeStep(dt);
+ /* collision with sphere? */
+ if (do_sphere) particles[i].psCollide(sphere);
+ /* collision with ground? */
+ if (particles[i].position[1] <= 0.0f)
+ particles[i].psBounce(dt);
+ /* dead particle? */
+ if ( (particles[i].position[1] < 0.1f)
+ && (Math.abs(particles[i].velocity[1]) < 0.2f) )
+ particles[i].alive = false;
+ }
+
+ // Draw the scene.
+
+ gl.glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
+
+ gl.glEnable(GL_LIGHTING);
+ if (do_sphere)
+ {
+ gl.glPushMatrix();
+ gl.glTranslatef(sphere.x, sphere.y, sphere.z);
+ gl.glCallList(sphere_list);
+ gl.glPopMatrix();
+ }
+ gl.glDisable(GL_LIGHTING);
+
+ gl.glColor3ub((byte)0, (byte)128, (byte)255);
+ gl.glBegin(GL_QUADS);
+ gl.glVertex3f(-2f, 0f, -2f);
+ gl.glVertex3f(-2f, 0f, 2f);
+ gl.glVertex3f(2f, 0f, 2f);
+ gl.glVertex3f(2f, 0f, -2f);
+ gl.glEnd();
+
+ float r, g;
+ if (!use_lines)
+ {
+ gl.glBegin(GL_POINTS);
+ for (int i = 0; i < num_particles; i++)
+ {
+ if (!particles[i].alive) continue;
+ r = particles[i].position[1]/2.1f*255f;
+ g = 128.0f+(r*0.5f);
+ gl.glColor3ub((byte)r, (byte)g, (byte)255);
+ gl.glVertex3fv(particles[i].position);
+ }
+ gl.glEnd();
+ }
+ else
+ {
+ gl.glBegin(GL_LINES);
+ for (int i = 0; i < num_particles; i++)
+ {
+ if (!particles[i].alive) continue;
+ r = particles[i].previous[1]/2.1f*255f;
+ g = 128.0f+(r*0.5f);
+ gl.glColor3ub((byte)r, (byte)g, (byte)255);
+ gl.glVertex3fv(particles[i].previous);
+ r = particles[i].position[1]/2.1f*255f;
+ g = 128.0f+(r*0.5f);
+ gl.glColor3ub((byte)r, (byte)g, (byte)255);
+ gl.glVertex3fv(particles[i].position);
+ }
+ gl.glEnd();
+ }
+
+ gl.glPopMatrix();
+
+ glj.gljSwap();
+ glj.gljCheckGL();
+ glj.gljFree();
+
+ //if (!isSuspended()) repaint(); // Animate at full speed.
+ }
+
+ /* timedelta: returns the number of seconds that have elapsed
+ since the previous call to the function. */
+ private long timedelta_prev = 0L;
+ private float timedelta()
+ {
+ long current = System.currentTimeMillis();
+ if (timedelta_prev == 0L) timedelta_prev = current;
+ long delta = current-timedelta_prev;
+ timedelta_prev = current;
+ return ((float)delta) * 0.001f;
+ }
+
+ // Reset the rotation matrix to the default view.
+ private void setInitialRotation()
+ {
+ for (int i = 0; i < 16; i++)
+ rot_matrix[i] = ((i % 5) == 0) ? 1.0f : 0.0f;
+ }
+
+ private void fixRotationMatrix()
+ {
+ // Fix any problems with the rotation matrix.
+ rot_matrix[3] =
+ rot_matrix[7] =
+ rot_matrix[11] =
+ rot_matrix[12] =
+ rot_matrix[13] =
+ rot_matrix[14] = 0.0f;
+ rot_matrix[15] = 1.0f;
+ float fac;
+ if ((fac = (float)Math.sqrt
+ ((rot_matrix[0]*rot_matrix[0]) +
+ (rot_matrix[4]*rot_matrix[4]) +
+ (rot_matrix[8]*rot_matrix[8]))) != 1.0f)
+ {
+ if (fac != 0.0f)
+ {
+ fac = 1.0f/fac;
+ rot_matrix[0] *= fac;
+ rot_matrix[4] *= fac;
+ rot_matrix[8] *= fac;
+ }
+ }
+ if ((fac = (float)Math.sqrt
+ ((rot_matrix[1]*rot_matrix[1]) +
+ (rot_matrix[5]*rot_matrix[5]) +
+ (rot_matrix[9]*rot_matrix[9]))) != 1.0f)
+ {
+ if (fac != 0.0f)
+ {
+ fac = 1.0f/fac;
+ rot_matrix[1] *= fac;
+ rot_matrix[5] *= fac;
+ rot_matrix[9] *= fac;
+ }
+ }
+ if ((fac = (float)Math.sqrt
+ ((rot_matrix[2]*rot_matrix[2]) +
+ (rot_matrix[6]*rot_matrix[6]) +
+ (rot_matrix[10]*rot_matrix[10]))) != 1.0f)
+ {
+ if (fac != 0.0f)
+ {
+ fac = 1.0f/fac;
+ rot_matrix[2] *= fac;
+ rot_matrix[6] *= fac;
+ rot_matrix[10] *= fac;
+ }
+ }
+ }
+
+ // Methods required for the implementation of MouseListener
+ public void mouseEntered( MouseEvent evt )
+ {
+ Component comp = evt.getComponent();
+ if( comp.equals(this ) )
+ {
+ requestFocus();
+ }
+ }
+
+ public void mouseClicked( MouseEvent evt )
+ {
+ Component comp = evt.getComponent();
+ if( comp.equals(this ) )
+ {
+ requestFocus();
+ }
+ }
+
+ public void mouseExited( MouseEvent evt )
+ {
+ }
+
+ public void mousePressed( MouseEvent evt )
+ {
+ prevMouseX = evt.getX();
+ prevMouseY = evt.getY();
+ if ((evt.getModifiers() & evt.BUTTON3_MASK) != 0)
+ {
+ mouseRButtonDown = true;
+ evt.consume();
+ }
+ }
+
+ public void mouseReleased( MouseEvent evt )
+ {
+ if ((evt.getModifiers() & evt.BUTTON3_MASK) != 0)
+ {
+ mouseRButtonDown = false;
+ evt.consume();
+ }
+ }
+
+ // Methods required for the implementation of MouseMotionListener
+ public void mouseDragged( MouseEvent evt )
+ {
+ int x = evt.getX();
+ int y = evt.getY();
+ float thetaX = (float)(x-prevMouseX)*(360.0f/(float)getSize().width);
+ float thetaY = (float)(prevMouseY-y)*(360.0f/(float)getSize().height);
+ float mtxbuf[] = new float[16];
+ float mtxbuf2[] = new float[16];
+
+ prevMouseX = x;
+ prevMouseY = y;
+ if ( (thetaX != 0.0f) || (thetaY != 0.0f) )
+ {
+ mtxfuncs.rotateAroundY(((float)thetaX),mtxbuf);
+ if (mouseRButtonDown)
+ mtxfuncs.rotateAroundZ(thetaY,mtxbuf2);
+ else
+ mtxfuncs.rotateAroundX(-thetaY,mtxbuf2);
+ mtxfuncs.multiplyMatrices(mtxbuf2,mtxbuf,mtxbuf);
+ mtxfuncs.multiplyMatrices(rot_matrix,mtxbuf,rot_matrix);
+ fixRotationMatrix();
+ }
+ evt.consume();
+ }
+
+ public void mouseMoved( MouseEvent evt )
+ {
+ }
+
+ // Methods required for the implementation of KeyListener
+ public void keyPressed(KeyEvent e)
+ {
+ }
+
+ public void keyReleased(KeyEvent e)
+ {
+ }
+
+ public void keyTyped(KeyEvent e)
+ {
+ if (glj.gljMakeCurrent() == false) return;
+ switch ((char)e.getKeyChar())
+ {
+ case 'W':
+ case 'w':
+ type = PS_WATERFALL;
+ break;
+ case 'F':
+ case 'f':
+ type = PS_FOUNTAIN;
+ break;
+ case 'S':
+ case 's':
+ do_sphere = !do_sphere;
+ break;
+ case 'L':
+ case 'l':
+ use_lines = !use_lines;
+ break;
+ case 'P':
+ point_size++;
+ gl.glPointSize(point_size);
+ break;
+ case 'p':
+ point_size--;
+ if (point_size < 1) point_size = 1;
+ gl.glPointSize(point_size);
+ break;
+ case '+':
+ flow += 100;
+ if (flow > num_particles) flow = num_particles;
+ System.out.println(flow + " particles/second");
+ break;
+ case '-':
+ flow -= 100;
+ if (flow < 0) flow = 0;
+ System.out.println(flow + " particles/second");
+ break;
+ case 'R':
+ case 'r':
+ setInitialRotation();
+ break;
+ }
+ glj.gljFree();
+ }
+ }
+}
diff --git a/demos/RonsDemos/particle_plugin13.html b/demos/RonsDemos/particle_plugin13.html new file mode 100644 index 0000000..84268df --- /dev/null +++ b/demos/RonsDemos/particle_plugin13.html @@ -0,0 +1,57 @@ +<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.61 [en] (Win98; U) [Netscape]">
+ <title>Particle by Nate Robins; ported to Java by Ron Cemer</title>
+</head>
+<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#e6e6ff">
+Particle applet
+<br>Originially written by Nate Robins
+<br>Ported to Java by Ron Cemer
+<br>Drag the mouse inside the window to rotate the view.
+<br>Click inside the window, then press any of the following keys:
+<br>W/w: waterfall mode
+<br>F/f: fountain mode
+<br>S/s: toggle sphere collision
+<br>L/l: toggle between points lines
+<br>P/p: increase/decrease point size
+<br>+/-: increase/decrease number of particles
+<br>R/r: reset view rotation
+<br>
+<!--"CONVERTED_APPLET"-->
+<!-- CONVERTER VERSION 1.3 --> +<SCRIPT LANGUAGE="JavaScript"><!-- + var _info = navigator.userAgent; var _ns = false; + var _ie = (_info.indexOf("MSIE") > 0 && _info.indexOf("Win") > 0 && _info.indexOf("Windows 3.1") < 0); +//--></SCRIPT> +<COMMENT><SCRIPT LANGUAGE="JavaScript1.1"><!-- + var _ns = (navigator.appName.indexOf("Netscape") >= 0 && ((_info.indexOf("Win") > 0 && _info.indexOf("Win16") < 0 && java.lang.System.getProperty("os.version").indexOf("3.5") < 0) || (_info.indexOf("Sun") > 0) || (_info.indexOf("Linux") > 0))); +//--></SCRIPT></COMMENT> + +<SCRIPT LANGUAGE="JavaScript"><!-- + if (_ie == true) document.writeln('<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" WIDTH = 400 HEIGHT = 400 codebase="http://java.sun.com/products/plugin/1.3/jinstall-13-win32.cab#Version=1,3,0,0"><NOEMBED><XMP>'); + else if (_ns == true) document.writeln('<EMBED type="application/x-java-applet;version=1.3" CODE = "particle.class" WIDTH = 400 HEIGHT = 400 scriptable=false pluginspage="http://java.sun.com/products/plugin/1.3/plugin-install.html"><NOEMBED><XMP>'); +//--></SCRIPT> +<APPLET CODE = "particle.class" WIDTH = 400 HEIGHT = 400></XMP> +<PARAM NAME = CODE VALUE = "particle.class" >
+ +<PARAM NAME="type" VALUE="application/x-java-applet;version=1.3"> +<PARAM NAME="scriptable" VALUE="false"> + +</APPLET> + +</NOEMBED></EMBED></OBJECT> + + +<!-- +<APPLET CODE = "particle.class" WIDTH = 400 HEIGHT = 400>
+
+
+</APPLET> +--> +<!--"END_CONVERTED_APPLET"-->
+
+<hr>
+</body>
+</html>
diff --git a/demos/RonsDemos/pointblast.html b/demos/RonsDemos/pointblast.html new file mode 100644 index 0000000..d469a51 --- /dev/null +++ b/demos/RonsDemos/pointblast.html @@ -0,0 +1,19 @@ +<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.61 [en] (Win98; U) [Netscape]">
+ <title>Pointblast by Mark J. Kilgard; ported to Java by Ron Cemer</title>
+</head>
+<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#e6e6ff">
+Pointblast applet
+<br>Originially written by Mark J. Kilgard
+<br>Ported to Java by Ron Cemer
+<br>Drag the mouse within the window to spin the image.
+<br>Right-click within the window for a menu of options.
+<br>
+<applet code="pointblast.class" width=400 height=400>
+</applet>
+<hr>
+</body>
+</html>
diff --git a/demos/RonsDemos/pointblast.java b/demos/RonsDemos/pointblast.java new file mode 100644 index 0000000..08570d1 --- /dev/null +++ b/demos/RonsDemos/pointblast.java @@ -0,0 +1,664 @@ +/**
+ * @(#) pointblast.java
+ * @(#) author: Mark J. Kilgard (converted to Java by Ron Cemer)
+ */
+
+/* Copyright (c) Mark J. Kilgard, 1997. */
+
+/* This program is freely distributable without licensing fees
+ and is provided without guarantee or warrantee expressed or
+ implied. This program is -not- in the public domain. */
+
+/* This example demonstrates how to render particle effects
+ with OpenGL. A cloud of pinkish/orange particles explodes with the
+ particles bouncing off the ground. When the EXT_point_parameters
+ is present , the particle size is attenuated based on eye distance. */
+
+import java.applet.*;
+import java.awt.*;
+import java.awt.event.*;
+import java.lang.*;
+import java.util.*;
+import java.io.*;
+import java.util.*;
+import gl4java.GLContext;
+import gl4java.awt.GLAnimCanvas;
+import gl4java.applet.SimpleGLAnimApplet1;
+
+public class pointblast extends SimpleGLAnimApplet1
+{
+ /* Initialize the applet */
+
+
+ public void init()
+ {
+ super.init();
+ Dimension d = getSize();
+ canvas = new pointblastCanvas(d.width, d.height);
+ add("Center", canvas);
+ }
+
+
+ /* Local GLAnimCanvas extension class */
+
+
+ private class pointblastCanvas extends GLAnimCanvas
+ implements MouseListener, MouseMotionListener, ActionListener
+ {
+ private final double M_PI = 3.14159265;
+
+ private final String MENU_PAUSE = "Pause";
+ private final String MENU_RESUME = "Resume";
+ private final String MENU_RESET_TIME = "Reset time";
+// private final String MENU_CONSTANT = "Constant";
+// private final String MENU_LINEAR = "Linear";
+// private final String MENU_QUADRATIC = "Quadratic";
+ private final String MENU_BLEND_ON = "Blend on";
+ private final String MENU_BLEND_OFF = "Blend off";
+// private final String MENU_THRESHOLD_1 = "Threshold 1";
+// private final String MENU_THRESHOLD_10 = "Threshold 10";
+ private final String MENU_POINT_SMOOTH_ON = "Point smooth on";
+ private final String MENU_POINT_SMOOTH_OFF = "Point smooth off";
+ private final String MENU_POINT_SIZE_2 = "Point size 2";
+ private final String MENU_POINT_SIZE_4 = "Point size 4";
+ private final String MENU_POINT_SIZE_8 = "Point size 8";
+ private final String MENU_ENABLE_SPIN = "Enable spin";
+ private final String MENU_DISABLE_SPIN = "Disable spin";
+ private final String MENU_200_POINTS = "200 points";
+ private final String MENU_500_POINTS = "500 points";
+ private final String MENU_1000_POINTS = "1000 points";
+ private final String MENU_2000_POINTS = "2000 points";
+ private final String MENU_ENABLE_TEXTURING = "Enable texturing";
+ private final String MENU_DISABLE_TEXTURING = "Disable texturing";
+ private final String MENU_LINEAR_TEXTURE_FILTERING = "Linear texture filtering";
+ private final String MENU_POINT_TEXTURE_FILTERING = "Point texture filtering";
+
+ private PopupMenu menu = null;
+ private boolean menu_showing = false;
+ private boolean save_suspended = false;
+
+ private float angle = -150; /* in degrees */
+ private boolean spin = false;
+ private boolean moving = false;
+ private int begin;
+ private boolean newModel = true;
+ private float theTime;
+ private boolean repeat = true;
+ private boolean blend = true;
+ private boolean texturing = true;
+// private boolean useMipmaps = true;
+ private boolean linearFiltering = true;
+
+ private float constant[] = { 1.0f/5.0f, 0.0f, 0.0f };
+ private float linear[] = { 0.0f, 1.0f/5.0f, 0.0f };
+ private float theQuad[] = { 0.25f, 0.0f, 1.0f/60.0f };
+
+ private final int MAX_POINTS = 2000;
+
+ private int numPoints = 200;
+
+ private float pointList[][] = new float[MAX_POINTS][3];
+ private float pointTime[] = new float[MAX_POINTS];
+ private float pointVelocity[][] = new float[MAX_POINTS][2];
+ private float pointDirection[][] = new float[MAX_POINTS][2];
+ private int colorList[] = new int[MAX_POINTS];
+ private boolean motion = false;
+
+ private Random random = new Random(System.currentTimeMillis());
+
+ private final float MEAN_VELOCITY = 3.0f;
+ private final float GRAVITY = 2.0f;
+ private final float TIME_DELTA = 0.025f; /* The speed of time. */
+
+ /* Modeling units of ground extent in each X and Z direction. */
+ private final int EDGE = 12;
+
+ private final float colorSet[][] =
+ {
+ /* Shades of red. */
+ { 0.7f, 0.2f, 0.4f, 0.5f },
+ { 0.8f, 0.0f, 0.7f, 0.5f },
+ { 1.0f, 0.0f, 0.0f, 0.5f },
+ { 0.9f, 0.3f, 0.6f, 0.5f },
+ { 1.0f, 0.4f, 0.0f, 0.5f },
+ { 1.0f, 0.0f, 0.5f, 0.5f }
+ };
+ private final int NUM_COLORS = colorSet.length;
+ private final int DEAD = NUM_COLORS;
+
+ public pointblastCanvas(int w, int h)
+ {
+ super(w, h);
+ GLContext.gljNativeDebug = false;
+ GLContext.gljClassDebug = false;
+ setAnimateFps(30.0);
+ }
+
+ public void preInit()
+ {
+ doubleBuffer = true;
+ stereoView = false;
+ }
+
+ public void init()
+ {
+ System.out.println("init(): " + this);
+ reshape(getSize().width, getSize().height);
+
+ gl.glShadeModel(GL_FLAT);
+ gl.glEnable(GL_DEPTH_TEST);
+ gl.glEnable(GL_POINT_SMOOTH);
+ gl.glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+ gl.glPointSize(8.0f);
+// gl.glPointParameterfvEXT(GL_DISTANCE_ATTENUATION_EXT, theQuad);
+ gl.glMatrixMode(GL_PROJECTION);
+ glu.gluPerspective
+ (/* field of view in degree */ 40.0,
+ /* aspect ratio */ 1.0,
+ /* Z near */ 0.5,
+ /* Z far */ 40.0);
+ gl.glMatrixMode(GL_MODELVIEW);
+ glu.gluLookAt
+ (0.0f, 1.0f, 8.0f, /* eye location */
+ 0.0f, 1.0f, 0.0f, /* center is at (0,0,0) */
+ 0.0f, 1.0f, 0.0f); /* up is in postivie Y direction */
+ gl.glPushMatrix(); /* dummy push so we can pop on model
+ recalc */
+ makePointList();
+ makeFloorTexture();
+
+ glj.gljCheckGL();
+
+ menu = new PopupMenu("Options");
+ menu.add(MENU_PAUSE);
+ menu.add(MENU_RESUME);
+ menu.add(MENU_RESET_TIME);
+// menu.add(MENU_CONSTANT);
+// menu.add(MENU_LINEAR);
+// menu.add(MENU_QUADRATIC);
+ menu.add(MENU_BLEND_ON);
+ menu.add(MENU_BLEND_OFF);
+// menu.add(MENU_THRESHOLD_1);
+// menu.add(MENU_THRESHOLD_10);
+ menu.add(MENU_POINT_SMOOTH_ON);
+ menu.add(MENU_POINT_SMOOTH_OFF);
+ menu.add(MENU_POINT_SIZE_2);
+ menu.add(MENU_POINT_SIZE_4);
+ menu.add(MENU_POINT_SIZE_8);
+ menu.add(MENU_ENABLE_SPIN);
+ menu.add(MENU_DISABLE_SPIN);
+ menu.add(MENU_200_POINTS);
+ menu.add(MENU_500_POINTS);
+ menu.add(MENU_1000_POINTS);
+ menu.add(MENU_2000_POINTS);
+ menu.add(MENU_ENABLE_TEXTURING);
+ menu.add(MENU_DISABLE_TEXTURING);
+ menu.add(MENU_LINEAR_TEXTURE_FILTERING);
+ menu.add(MENU_POINT_TEXTURE_FILTERING);
+ menu.addActionListener(this);
+ add(menu);
+
+ addMouseListener(this);
+ addMouseMotionListener(this);
+ }
+
+ public void doCleanup()
+ {
+ System.out.println("destroy(): " + this);
+ removeMouseListener(this);
+ removeMouseMotionListener(this);
+ menu.removeActionListener(this);
+ }
+
+ public void reshape(int width, int height)
+ {
+ gl.glViewport(0,0,width,height);
+ }
+
+ public void display()
+ {
+ if (glj.gljMakeCurrent() == false) return;
+
+ if (!isSuspended())
+ {
+ if (spin)
+ {
+ angle += 0.3f;
+ newModel = true;
+ }
+ updatePointList();
+ }
+
+ gl.glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+ if (newModel) recalcModelView();
+
+ gl.glDepthMask(false);
+
+ /* Draw the floor. */
+ if (texturing) gl.glEnable(GL_TEXTURE_2D);
+ gl.glColor3f(0.5f, 1.0f, 0.5f);
+ gl.glBegin(GL_QUADS);
+ gl.glTexCoord2f(0.0f, 0.0f);
+ gl.glVertex3f(-EDGE, -0.05f, -EDGE);
+ gl.glTexCoord2f(20.0f, 0.0f);
+ gl.glVertex3f(EDGE, -0.05f, -EDGE);
+ gl.glTexCoord2f(20.0f, 20.0f);
+ gl.glVertex3f(EDGE, -0.05f, EDGE);
+ gl.glTexCoord2f(0.0f, 20.0f);
+ gl.glVertex3f(-EDGE, -0.05f, EDGE);
+ gl.glEnd();
+
+ /* Allow particles to blend with each other. */
+ gl.glDepthMask(true);
+
+ if (blend) gl.glEnable(GL_BLEND);
+
+ if (texturing) gl.glDisable(GL_TEXTURE_2D);
+ gl.glBegin(GL_POINTS);
+ for (int i = 0; i < numPoints; i++)
+ {
+ /* Draw alive particles. */
+ int c = colorList[i];
+ if ( (c < 0) || (c >= DEAD) ) continue;
+ gl.glColor4fv(colorSet[colorList[i]]);
+ gl.glVertex3fv(pointList[i]);
+ }
+ gl.glEnd();
+
+ gl.glDisable(GL_BLEND);
+
+ glj.gljSwap();
+ glj.gljCheckGL();
+ glj.gljFree();
+
+ //if (!isSuspended()) repaint(); // Animate at full speed.
+ }
+
+ // Methods required for the implementation of MouseListener
+ public void mouseEntered(MouseEvent evt)
+ {
+ }
+
+ public void mouseExited(MouseEvent evt)
+ {
+ }
+
+ public void mousePressed(MouseEvent evt)
+ {
+ // If user presses right mouse button within canvas area,
+ // suspend animation and pop up menu.
+ // If menu was already popped up and user presses either
+ // mouse button within canvas area, resume animation
+ // because the menu will have been removed automatically.
+ if (!menu_showing)
+ {
+ if ((evt.getModifiers() & evt.BUTTON3_MASK) != 0)
+ {
+ menu_showing = true;
+ save_suspended = isSuspended();
+ if (!save_suspended)
+ {
+ setSuspended(true);
+ repaint(100);
+ try
+ {
+ Thread.currentThread().sleep(200);
+ }
+ catch (Exception e)
+ { }
+ }
+ menu.show(this,evt.getX(),evt.getY());
+ }
+ else
+ {
+ // Must be left button.
+ moving = true;
+ begin = evt.getX();
+ }
+ }
+ else
+ {
+ menu_showing = false;
+ setSuspended(save_suspended);
+ }
+ }
+
+ public void mouseReleased(MouseEvent evt)
+ {
+ if ((evt.getModifiers() & evt.BUTTON3_MASK) == 0)
+ {
+ // Must be left button.
+ moving = false;
+ }
+ }
+
+ public void mouseClicked(MouseEvent evt)
+ {
+ }
+
+ // Methods required for the implementation of MouseMotionListener
+ public void mouseDragged(MouseEvent evt)
+ {
+ if (moving)
+ {
+ int x = evt.getX();
+ angle = angle + (x - begin);
+ begin = x;
+ newModel = true;
+ if (isSuspended()) repaint();
+ }
+ }
+
+ public void mouseMoved(MouseEvent evt)
+ {
+ }
+
+ // Method required for the implementation of ActionListener
+ public void actionPerformed(ActionEvent evt)
+ {
+ if (glj.gljMakeCurrent() == false) return;
+ boolean dorepaint = false;
+ String c = evt.getActionCommand();
+ if (c.equals(MENU_PAUSE))
+ {
+ if (menu_showing)
+ save_suspended = true;
+ else if (!isSuspended())
+ setSuspended(true);
+ dorepaint = true;
+ }
+ else if (c.equals(MENU_RESUME))
+ {
+ if (menu_showing)
+ save_suspended = false;
+ else if (isSuspended())
+ setSuspended(false);
+ dorepaint = true;
+ }
+ else if (c.equals(MENU_RESET_TIME))
+ {
+ makePointList();
+ dorepaint = true;
+ }
+// else if (c.equals(MENU_CONSTANT))
+// {
+// gl.glPointParameterfvEXT(GL_DISTANCE_ATTENUATION_EXT, constant);
+// dorepaint = true;
+// }
+// else if (c.equals(MENU_LINEAR))
+// {
+// gl.glPointParameterfvEXT(GL_DISTANCE_ATTENUATION_EXT, linear);
+// dorepaint = true;
+// }
+// else if (c.equals(MENU_QUADRATIC))
+// {
+// gl.glPointParameterfvEXT(GL_DISTANCE_ATTENUATION_EXT, theQuad);
+// dorepaint = true;
+// }
+ else if (c.equals(MENU_BLEND_ON))
+ {
+ blend = true;
+ dorepaint = true;
+ }
+ else if (c.equals(MENU_BLEND_OFF))
+ {
+ blend = false;
+ dorepaint = true;
+ }
+// else if (c.equals(MENU_THRESHOLD_1))
+// {
+// gl.glPointParameterfEXT(GL_POINT_FADE_THRESHOLD_SIZE_EXT, 1.0f);
+// dorepaint = true;
+// }
+// else if (c.equals(MENU_THRESHOLD_10))
+// {
+// gl.glPointParameterfEXT(GL_POINT_FADE_THRESHOLD_SIZE_EXT, 10.0f);
+// dorepaint = true;
+// }
+ else if (c.equals(MENU_POINT_SMOOTH_ON))
+ {
+ gl.glEnable(GL_POINT_SMOOTH);
+ dorepaint = true;
+ }
+ else if (c.equals(MENU_POINT_SMOOTH_OFF))
+ {
+ gl.glDisable(GL_POINT_SMOOTH);
+ dorepaint = true;
+ }
+ else if (c.equals(MENU_POINT_SIZE_2))
+ {
+ gl.glPointSize(2.0f);
+ dorepaint = true;
+ }
+ else if (c.equals(MENU_POINT_SIZE_4))
+ {
+ gl.glPointSize(4.0f);
+ dorepaint = true;
+ }
+ else if (c.equals(MENU_POINT_SIZE_8))
+ {
+ gl.glPointSize(8.0f);
+ dorepaint = true;
+ }
+ else if (c.equals(MENU_ENABLE_SPIN))
+ {
+ spin = true;
+ dorepaint = true;
+ }
+ else if (c.equals(MENU_DISABLE_SPIN))
+ {
+ spin = false;
+ dorepaint = true;
+ }
+ else if (c.equals(MENU_200_POINTS))
+ {
+ numPoints = 200;
+ makePointList();
+ dorepaint = true;
+ }
+ else if (c.equals(MENU_500_POINTS))
+ {
+ numPoints = 500;
+ makePointList();
+ dorepaint = true;
+ }
+ else if (c.equals(MENU_1000_POINTS))
+ {
+ numPoints = 1000;
+ makePointList();
+ dorepaint = true;
+ }
+ else if (c.equals(MENU_2000_POINTS))
+ {
+ numPoints = 2000;
+ makePointList();
+ dorepaint = true;
+ }
+ else if (c.equals(MENU_ENABLE_TEXTURING))
+ {
+ texturing = true;
+ dorepaint = true;
+ }
+ else if (c.equals(MENU_DISABLE_TEXTURING))
+ {
+ texturing = false;
+ dorepaint = true;
+ }
+ else if (c.equals(MENU_LINEAR_TEXTURE_FILTERING))
+ {
+ linearFiltering = true;
+ makeFloorTexture();
+ dorepaint = true;
+ }
+ else if (c.equals(MENU_POINT_TEXTURE_FILTERING))
+ {
+ linearFiltering = false;
+ makeFloorTexture();
+ dorepaint = true;
+ }
+
+ glj.gljFree();
+ if (menu_showing)
+ {
+ menu_showing = false;
+ setSuspended(save_suspended);
+ }
+ if ( (isSuspended()) && (dorepaint) ) repaint();
+ }
+
+ private float float_rand()
+ {
+ return random.nextFloat();
+ }
+
+ private float RANDOM_RANGE(float lo, float hi)
+ {
+ return lo + ((hi - lo) * float_rand());
+ }
+
+ private void makePointList()
+ {
+ float angle, velocity, direction;
+ motion = true;
+ for (int i = 0; i < numPoints; i++)
+ {
+ pointList[i][0] = 0.0f;
+ pointList[i][1] = 0.0f;
+ pointList[i][2] = 0.0f;
+ pointTime[i] = 0.0f;
+ angle = (RANDOM_RANGE(60.0f, 70.0f)) * ((float)M_PI)/180.0f;
+ direction = RANDOM_RANGE(0.0f, 360.0f) * ((float)M_PI)/180.0f;
+ pointDirection[i][0] = (float)Math.cos(direction);
+ pointDirection[i][1] = (float)Math.sin(direction);
+ velocity = MEAN_VELOCITY + RANDOM_RANGE(-0.8f, 1.0f);
+ pointVelocity[i][0] = velocity * (float)Math.cos(angle);
+ pointVelocity[i][1] = velocity * (float)Math.sin(angle);
+ colorList[i] = random.nextInt() % NUM_COLORS;
+ }
+ theTime = 0.0f;
+ }
+
+ private void updatePointList()
+ {
+ float distance;
+ motion = false;
+ for (int i = 0; i < numPoints; i++)
+ {
+ distance = pointVelocity[i][0] * theTime;
+
+ /* X and Z */
+ pointList[i][0] = pointDirection[i][0] * distance;
+ pointList[i][2] = pointDirection[i][1] * distance;
+
+ /* Z */
+ pointList[i][1] =
+ (pointVelocity[i][1] - 0.5f * GRAVITY * pointTime[i])*pointTime[i];
+
+ /* If we hit the ground, bounce the point upward again. */
+ if (pointList[i][1] <= 0.0f)
+ {
+ if (distance > EDGE)
+ {
+ /* Particle has hit ground past the distance duration of
+ the particles. Mark particle as dead. */
+ colorList[i] = DEAD; /* Not moving. */
+ continue;
+ }
+ pointVelocity[i][1] *= 0.8f; /* 80% of previous up velocity. */
+ pointTime[i] = 0.0f; /* Reset the particles sense of up time. */
+ }
+ motion = true;
+ pointTime[i] += TIME_DELTA;
+ }
+ theTime += TIME_DELTA;
+ if ( (repeat) && (!motion) ) makePointList();
+ }
+
+ private void recalcModelView()
+ {
+ gl.glPopMatrix();
+ gl.glPushMatrix();
+ gl.glRotatef(angle, 0.0f, 1.0f, 0.0f);
+ newModel = false;
+ }
+
+ private void makeFloorTexture()
+ {
+ /* Nice floor texture tiling pattern. */
+ String circles[] =
+ {
+ "....xxxx........",
+ "..xxxxxxxx......",
+ ".xxxxxxxxxx.....",
+ ".xxx....xxx.....",
+ "xxx......xxx....",
+ "xxx......xxx....",
+ "xxx......xxx....",
+ "xxx......xxx....",
+ ".xxx....xxx.....",
+ ".xxxxxxxxxx.....",
+ "..xxxxxxxx......",
+ "....xxxx........",
+ "................",
+ "................",
+ "................",
+ "................"
+ };
+ byte floorTexture[] = new byte[16*16*3];
+
+ /* Setup RGB image for the texture. */
+ int idx = 0;
+ for (int t = 0; t < 16; t++)
+ {
+ for (int s = 0; s < 16; s++)
+ {
+ if (circles[t].charAt(s) == 'x')
+ {
+ /* Nice blue. */
+ floorTexture[idx++] = (byte)0x1f;
+ floorTexture[idx++] = (byte)0x1f;
+ floorTexture[idx++] = (byte)0x8f;
+ }
+ else
+ {
+ /* Light gray. */
+ floorTexture[idx++] = (byte)0xca;
+ floorTexture[idx++] = (byte)0xca;
+ floorTexture[idx++] = (byte)0xca;
+ }
+ }
+ }
+
+ gl.glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
+
+// if (useMipmaps)
+// {
+// gl.glTexParameteri
+// (GL_TEXTURE_2D,
+// GL_TEXTURE_MIN_FILTER,
+// GL_LINEAR_MIPMAP_LINEAR);
+// glu.gluBuild2DMipmaps
+// (GL_TEXTURE_2D,3,16,16,GL_RGB,GL_UNSIGNED_BYTE,floorTexture);
+// }
+// else
+ {
+ if (linearFiltering)
+ {
+ gl.glTexParameteri
+ (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+ gl.glTexParameteri
+ (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+ }
+ else
+ {
+ gl.glTexParameteri
+ (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+ gl.glTexParameteri
+ (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+ }
+ gl.glTexImage2D
+ (GL_TEXTURE_2D,0,3,16,16,0,GL_RGB,GL_UNSIGNED_BYTE,floorTexture);
+ }
+ }
+ }
+}
diff --git a/demos/RonsDemos/pointblast_plugin13.html b/demos/RonsDemos/pointblast_plugin13.html new file mode 100644 index 0000000..0133e90 --- /dev/null +++ b/demos/RonsDemos/pointblast_plugin13.html @@ -0,0 +1,50 @@ +<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.61 [en] (Win98; U) [Netscape]">
+ <title>Pointblast by Mark J. Kilgard; ported to Java by Ron Cemer</title>
+</head>
+<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#e6e6ff">
+Pointblast applet
+<br>Originially written by Mark J. Kilgard
+<br>Ported to Java by Ron Cemer
+<br>Drag the mouse within the window to spin the image.
+<br>Right-click within the window for a menu of options.
+<br>
+<!--"CONVERTED_APPLET"-->
+<!-- CONVERTER VERSION 1.3 --> +<SCRIPT LANGUAGE="JavaScript"><!-- + var _info = navigator.userAgent; var _ns = false; + var _ie = (_info.indexOf("MSIE") > 0 && _info.indexOf("Win") > 0 && _info.indexOf("Windows 3.1") < 0); +//--></SCRIPT> +<COMMENT><SCRIPT LANGUAGE="JavaScript1.1"><!-- + var _ns = (navigator.appName.indexOf("Netscape") >= 0 && ((_info.indexOf("Win") > 0 && _info.indexOf("Win16") < 0 && java.lang.System.getProperty("os.version").indexOf("3.5") < 0) || (_info.indexOf("Sun") > 0) || (_info.indexOf("Linux") > 0))); +//--></SCRIPT></COMMENT> + +<SCRIPT LANGUAGE="JavaScript"><!-- + if (_ie == true) document.writeln('<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" WIDTH = 400 HEIGHT = 400 codebase="http://java.sun.com/products/plugin/1.3/jinstall-13-win32.cab#Version=1,3,0,0"><NOEMBED><XMP>'); + else if (_ns == true) document.writeln('<EMBED type="application/x-java-applet;version=1.3" CODE = "pointblast.class" WIDTH = 400 HEIGHT = 400 scriptable=false pluginspage="http://java.sun.com/products/plugin/1.3/plugin-install.html"><NOEMBED><XMP>'); +//--></SCRIPT> +<APPLET CODE = "pointblast.class" WIDTH = 400 HEIGHT = 400></XMP> +<PARAM NAME = CODE VALUE = "pointblast.class" >
+ +<PARAM NAME="type" VALUE="application/x-java-applet;version=1.3"> +<PARAM NAME="scriptable" VALUE="false"> + +</APPLET> + +</NOEMBED></EMBED></OBJECT> + + +<!-- +<APPLET CODE = "pointblast.class" WIDTH = 400 HEIGHT = 400>
+
+
+</APPLET> +--> +<!--"END_CONVERTED_APPLET"-->
+
+<hr>
+</body>
+</html>
diff --git a/demos/RonsDemos/polyoff.html b/demos/RonsDemos/polyoff.html new file mode 100644 index 0000000..78ba14d --- /dev/null +++ b/demos/RonsDemos/polyoff.html @@ -0,0 +1,23 @@ +<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.61 [en] (Win98; U) [Netscape]">
+ <title>Polyoff by Silicon Graphics; ported to Java by Ron Cemer</title>
+</head>
+<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#e6e6ff">
+Polyoff applet
+<br>Originially written by Silicon Graphics
+<br>Ported to Java by Ron Cemer
+<br>Use the Java Console in your browser to see messages generated by this applet.
+<br>Click inside the window, then press any of the following keys:
+<br>Arrows: rotate the object
+<br>t/T: decrease/increase translation distance
+<br>f/F: decrease/increase polygon offset factor
+<br>u/U: decrease/increase polygon offset units
+<br>
+<applet code="polyoff.class" width=400 height=400>
+</applet>
+<hr>
+</body>
+</html>
diff --git a/demos/RonsDemos/polyoff.java b/demos/RonsDemos/polyoff.java new file mode 100644 index 0000000..a79a398 --- /dev/null +++ b/demos/RonsDemos/polyoff.java @@ -0,0 +1,332 @@ +/**
+ * @(#) polyoff.java
+ * @(#) author: Silicon Graphics, Inc. (converted to Java by Ron Cemer)
+ */
+
+/*
+ * Copyright (c) 1993-1997, Silicon Graphics, Inc.
+ * ALL RIGHTS RESERVED
+ * Permission to use, copy, modify, and distribute this software for
+ * any purpose and without fee is hereby granted, provided that the above
+ * copyright notice appear in all copies and that both the copyright notice
+ * and this permission notice appear in supporting documentation, and that
+ * the name of Silicon Graphics, Inc. not be used in advertising
+ * or publicity pertaining to distribution of the software without specific,
+ * written prior permission.
+ *
+ * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
+ * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
+ * FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
+ * GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT,
+ * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY
+ * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION,
+ * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF
+ * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN
+ * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
+ * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * US Government Users Restricted Rights
+ * Use, duplication, or disclosure by the Government is subject to
+ * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
+ * (c)(1)(ii) of the Rights in Technical Data and Computer Software
+ * clause at DFARS 252.227-7013 and/or in similar or successor
+ * clauses in the FAR or the DOD or NASA FAR Supplement.
+ * Unpublished-- rights reserved under the copyright laws of the
+ * United States. Contractor/manufacturer is Silicon Graphics,
+ * Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311.
+ *
+ * OpenGL(R) is a registered trademark of Silicon Graphics, Inc.
+ */
+
+/*
+ * This program demonstrates polygon offset to draw a shaded
+ * polygon and its wireframe counterpart without ugly visual
+ * artifacts ("stitching").
+ */
+
+import java.applet.*;
+import java.awt.*;
+import java.awt.event.*;
+import java.lang.*;
+import java.util.*;
+import java.io.*;
+import java.util.*;
+import gl4java.GLContext;
+import gl4java.awt.GLCanvas;
+
+public class polyoff extends Applet
+{
+ polyoffCanvas canvas = null;
+
+
+ /* Initialize the applet */
+
+
+ public void init()
+ {
+ Dimension d = getSize();
+ setLayout(new BorderLayout());
+ canvas = new polyoffCanvas(d.width, d.height);
+ canvas.requestFocus();
+ add("Center", canvas);
+ }
+
+
+ /* Start the applet */
+
+
+ public void start()
+ {
+ }
+
+
+ /* Stop the applet */
+
+
+ public void stop()
+ {
+ }
+
+
+ /* Destroy the applet */
+
+
+ public void destroy()
+ {
+ canvas.cvsDispose();
+ }
+
+
+ /* Local GLCanvas extension class */
+
+
+ private class polyoffCanvas extends GLCanvas
+ implements KeyListener, MouseListener
+ {
+ private int list;
+ private int spinx = 0;
+ private int spiny = 0;
+ private float tdist = 0.0f;
+ private float polyfactor = 1.0f;
+ private float polyunits = 1.0f;
+
+ public polyoffCanvas(int w, int h)
+ {
+ super(w, h);
+ GLContext.gljNativeDebug = false;
+ GLContext.gljClassDebug = false;
+ }
+
+ public void preInit()
+ {
+ doubleBuffer = true;
+ stereoView = false;
+ }
+
+ public void init()
+ {
+ System.out.println("init(): " + this);
+ reshape(getSize().width, getSize().height);
+
+ /* specify initial properties
+ * create display list with sphere
+ * initialize lighting and depth buffer
+ */
+
+ float light_ambient[] = { 0.0f, 0.0f, 0.0f, 1.0f };
+ float light_diffuse[] = { 1.0f, 1.0f, 1.0f, 1.0f };
+ float light_specular[] = { 1.0f, 1.0f, 1.0f, 1.0f };
+ float light_position[] = { 1.0f, 1.0f, 1.0f, 0.0f };
+
+ float global_ambient[] = { 0.2f, 0.2f, 0.2f, 1.0f };
+
+ gl.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
+
+ list = gl.glGenLists(1);
+ gl.glNewList (list, GL_COMPILE);
+
+ int qobj = glu.gluNewQuadric();
+ glu.gluQuadricOrientation(qobj,GLU_OUTSIDE);
+ glu.gluQuadricNormals(qobj,GLU_SMOOTH);
+ glu.gluQuadricTexture(qobj,false);
+ glu.gluSphere(qobj,1.0f,20,12);
+ glu.gluDeleteQuadric(qobj);
+
+ gl.glEndList();
+
+ gl.glEnable(GL_DEPTH_TEST);
+
+ gl.glLightfv(GL_LIGHT0, GL_AMBIENT, light_ambient);
+ gl.glLightfv(GL_LIGHT0, GL_DIFFUSE, light_diffuse);
+ gl.glLightfv(GL_LIGHT0, GL_SPECULAR, light_specular);
+ gl.glLightfv(GL_LIGHT0, GL_POSITION, light_position);
+ gl.glLightModelfv (GL_LIGHT_MODEL_AMBIENT, global_ambient);
+
+ glj.gljCheckGL();
+
+ addKeyListener(this);
+ addMouseListener(this);
+ }
+
+ public void cvsDispose()
+ {
+ System.out.println("destroy(): " + this);
+ removeKeyListener(this);
+ super.cvsDispose();
+ }
+
+ public void reshape(int width, int height)
+ {
+ gl.glViewport(0,0,width,height);
+ gl.glMatrixMode(GL_PROJECTION);
+ gl.glLoadIdentity();
+ glu.gluPerspective(45.0,(double)width/(double)height,1.0,10.0);
+ gl.glMatrixMode (GL_MODELVIEW);
+ gl.glLoadIdentity();
+ glu.gluLookAt (0.0, 0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0);
+ }
+
+ public void display()
+ {
+ if (glj.gljMakeCurrent() == false) return;
+
+ float mat_ambient[] = { 0.8f, 0.8f, 0.8f, 1.0f };
+ float mat_diffuse[] = { 1.0f, 0.0f, 0.5f, 1.0f };
+ float mat_specular[] = { 1.0f, 1.0f, 1.0f, 1.0f };
+ float gray[] = { 0.8f, 0.8f, 0.8f, 1.0f };
+ float black[] = { 0.0f, 0.0f, 0.0f, 1.0f };
+
+ gl.glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+ gl.glPushMatrix();
+ gl.glTranslatef(0.0f, 0.0f, tdist);
+ gl.glRotatef((float)spinx, 1.0f, 0.0f, 0.0f);
+ gl.glRotatef((float)spiny, 0.0f, 1.0f, 0.0f);
+
+ gl.glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, gray);
+ gl.glMaterialfv(GL_FRONT, GL_SPECULAR, black);
+ gl.glMaterialf(GL_FRONT, GL_SHININESS, 0.0f);
+ gl.glEnable(GL_LIGHTING);
+ gl.glEnable(GL_LIGHT0);
+ gl.glEnable(GL_POLYGON_OFFSET_FILL);
+ gl.glPolygonOffset(polyfactor, polyunits);
+ gl.glCallList (list);
+ gl.glDisable(GL_POLYGON_OFFSET_FILL);
+
+ gl.glDisable(GL_LIGHTING);
+ gl.glDisable(GL_LIGHT0);
+ gl.glColor3f(1.0f, 1.0f, 1.0f);
+ gl.glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
+ gl.glCallList (list);
+ gl.glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
+
+ gl.glPopMatrix();
+ gl.glFlush();
+
+ glj.gljSwap();
+ glj.gljCheckGL();
+ glj.gljFree();
+ }
+
+ // Methods required for the implementation of KeyListener
+ public void keyPressed(KeyEvent e)
+ {
+ switch (e.getKeyCode())
+ {
+ case KeyEvent.VK_LEFT:
+ int j = (spiny-5);
+ while (j < 0) j += 360;
+ spiny = j;
+ repaint();
+ break;
+ case KeyEvent.VK_RIGHT:
+ spiny = (spiny + 5) % 360;
+ repaint();
+ break;
+ case KeyEvent.VK_UP:
+ int i = (spinx-5);
+ while (i < 0) i += 360;
+ spinx = i;
+ repaint();
+ break;
+ case KeyEvent.VK_DOWN:
+ spinx = (spinx + 5) % 360;
+ repaint();
+ break;
+ }
+ }
+
+ public void keyReleased(KeyEvent e)
+ {
+ }
+
+ public void keyTyped(KeyEvent e)
+ {
+ switch ((char)e.getKeyChar())
+ {
+ case 'T':
+ if (tdist < 4.0f)
+ {
+ tdist += 0.5f;
+ System.out.println("translation distance is " + tdist);
+ repaint();
+ }
+ break;
+ case 't':
+ if (tdist > -5.0f)
+ {
+ tdist -= 0.5f;
+ System.out.println("translation distance is " + tdist);
+ repaint();
+ }
+ break;
+ case 'F':
+ polyfactor += 0.1f;
+ System.out.println("polyfactor is " + polyfactor);
+ repaint();
+ break;
+ case 'f':
+ polyfactor -= 0.1f;
+ System.out.println("polyfactor is " + polyfactor);
+ repaint();
+ break;
+ case 'U':
+ polyunits += 1.0f;
+ System.out.println("polyunits is " + polyunits);
+ repaint();
+ break;
+ case 'u':
+ polyunits -= 1.0f;
+ System.out.println("polyunits is " + polyunits);
+ repaint();
+ break;
+ }
+ }
+
+ // Methods required for the implementation of MouseListener
+ public void mouseEntered( MouseEvent evt )
+ {
+ Component comp = evt.getComponent();
+ if( comp.equals(this ) )
+ {
+ requestFocus();
+ }
+ }
+
+ public void mouseExited( MouseEvent evt )
+ { }
+ public void mousePressed( MouseEvent evt )
+ { }
+ public void mouseReleased( MouseEvent evt )
+ { }
+ public void mouseClicked( MouseEvent evt )
+ {
+ Component comp = evt.getComponent();
+ if( comp.equals(this ) )
+ {
+ requestFocus();
+ }
+ }
+ }
+}
diff --git a/demos/RonsDemos/polyoff_plugin13.html b/demos/RonsDemos/polyoff_plugin13.html new file mode 100644 index 0000000..aab6878 --- /dev/null +++ b/demos/RonsDemos/polyoff_plugin13.html @@ -0,0 +1,54 @@ +<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.61 [en] (Win98; U) [Netscape]">
+ <title>Polyoff by Silicon Graphics; ported to Java by Ron Cemer</title>
+</head>
+<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#e6e6ff">
+Polyoff applet
+<br>Originially written by Silicon Graphics
+<br>Ported to Java by Ron Cemer
+<br>Use the Java Console in your browser to see messages generated by this applet.
+<br>Click inside the window, then press any of the following keys:
+<br>Arrows: rotate the object
+<br>t/T: decrease/increase translation distance
+<br>f/F: decrease/increase polygon offset factor
+<br>u/U: decrease/increase polygon offset units
+<br>
+<!--"CONVERTED_APPLET"-->
+<!-- CONVERTER VERSION 1.3 --> +<SCRIPT LANGUAGE="JavaScript"><!-- + var _info = navigator.userAgent; var _ns = false; + var _ie = (_info.indexOf("MSIE") > 0 && _info.indexOf("Win") > 0 && _info.indexOf("Windows 3.1") < 0); +//--></SCRIPT> +<COMMENT><SCRIPT LANGUAGE="JavaScript1.1"><!-- + var _ns = (navigator.appName.indexOf("Netscape") >= 0 && ((_info.indexOf("Win") > 0 && _info.indexOf("Win16") < 0 && java.lang.System.getProperty("os.version").indexOf("3.5") < 0) || (_info.indexOf("Sun") > 0) || (_info.indexOf("Linux") > 0))); +//--></SCRIPT></COMMENT> + +<SCRIPT LANGUAGE="JavaScript"><!-- + if (_ie == true) document.writeln('<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" WIDTH = 400 HEIGHT = 400 codebase="http://java.sun.com/products/plugin/1.3/jinstall-13-win32.cab#Version=1,3,0,0"><NOEMBED><XMP>'); + else if (_ns == true) document.writeln('<EMBED type="application/x-java-applet;version=1.3" CODE = "polyoff.class" WIDTH = 400 HEIGHT = 400 scriptable=false pluginspage="http://java.sun.com/products/plugin/1.3/plugin-install.html"><NOEMBED><XMP>'); +//--></SCRIPT> +<APPLET CODE = "polyoff.class" WIDTH = 400 HEIGHT = 400></XMP> +<PARAM NAME = CODE VALUE = "polyoff.class" >
+ +<PARAM NAME="type" VALUE="application/x-java-applet;version=1.3"> +<PARAM NAME="scriptable" VALUE="false"> + +</APPLET> + +</NOEMBED></EMBED></OBJECT> + + +<!-- +<APPLET CODE = "polyoff.class" WIDTH = 400 HEIGHT = 400>
+
+
+</APPLET> +--> +<!--"END_CONVERTED_APPLET"-->
+
+<hr>
+</body>
+</html>
diff --git a/demos/RonsDemos/quadric.html b/demos/RonsDemos/quadric.html new file mode 100644 index 0000000..d104772 --- /dev/null +++ b/demos/RonsDemos/quadric.html @@ -0,0 +1,17 @@ +<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.61 [en] (Win98; U) [Netscape]">
+ <title>Quadric by Silicon Graphics; ported to Java by Ron Cemer</title>
+</head>
+<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#e6e6ff">
+Quadric applet
+<br>Originially written by Silicon Graphics
+<br>Ported to Java by Ron Cemer
+<br>
+<applet code="quadric.class" width=400 height=400>
+</applet>
+<hr>
+</body>
+</html>
diff --git a/demos/RonsDemos/quadric.java b/demos/RonsDemos/quadric.java new file mode 100644 index 0000000..932f428 --- /dev/null +++ b/demos/RonsDemos/quadric.java @@ -0,0 +1,250 @@ +/**
+ * @(#) quadric.java
+ * @(#) author: Silicon Graphics, Inc. (converted to Java by Ron Cemer)
+ */
+
+/*
+ * Copyright (c) 1993-1997, Silicon Graphics, Inc.
+ * ALL RIGHTS RESERVED
+ * Permission to use, copy, modify, and distribute this software for
+ * any purpose and without fee is hereby granted, provided that the above
+ * copyright notice appear in all copies and that both the copyright notice
+ * and this permission notice appear in supporting documentation, and that
+ * the name of Silicon Graphics, Inc. not be used in advertising
+ * or publicity pertaining to distribution of the software without specific,
+ * written prior permission.
+ *
+ * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
+ * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
+ * FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
+ * GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT,
+ * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY
+ * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION,
+ * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF
+ * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN
+ * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
+ * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * US Government Users Restricted Rights
+ * Use, duplication, or disclosure by the Government is subject to
+ * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
+ * (c)(1)(ii) of the Rights in Technical Data and Computer Software
+ * clause at DFARS 252.227-7013 and/or in similar or successor
+ * clauses in the FAR or the DOD or NASA FAR Supplement.
+ * Unpublished-- rights reserved under the copyright laws of the
+ * United States. Contractor/manufacturer is Silicon Graphics,
+ * Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311.
+ *
+ * OpenGL(R) is a registered trademark of Silicon Graphics, Inc.
+ */
+
+/*
+ * This program demonstrates the use of some of the gluQuadric*
+ * routines. Quadric objects are created with some quadric
+ * properties and the callback routine to handle errors.
+ * Note that the cylinder has no top or bottom and the circle
+ * has a hole in it.
+ */
+
+import java.applet.*;
+import java.awt.*;
+import java.awt.event.*;
+import java.lang.*;
+import java.util.*;
+import java.io.*;
+import java.util.*;
+import gl4java.GLContext;
+import gl4java.awt.GLCanvas;
+
+public class quadric extends Applet
+{
+ quadricCanvas canvas = null;
+
+
+ /* Initialize the applet */
+
+
+ public void init()
+ {
+ Dimension d = getSize();
+ setLayout(new BorderLayout());
+ canvas = new quadricCanvas(d.width, d.height);
+ add("Center", canvas);
+ }
+
+
+ /* Start the applet */
+
+
+ public void start()
+ {
+ }
+
+
+ /* Stop the applet */
+
+
+ public void stop()
+ {
+ }
+
+
+ /* Destroy the applet */
+
+
+ public void destroy()
+ {
+ canvas.cvsDispose();
+ }
+
+
+ /* Local GLCanvas extension class */
+
+
+ private class quadricCanvas extends GLCanvas
+ {
+ int startList;
+
+ public quadricCanvas(int w, int h)
+ {
+ super(w, h);
+ GLContext.gljNativeDebug = false;
+ GLContext.gljClassDebug = false;
+ }
+
+ public void preInit()
+ {
+ doubleBuffer = true;
+ stereoView = false;
+ }
+
+ public void init()
+ {
+ System.out.println("init(): " + this);
+ reshape(getSize().width, getSize().height);
+
+ int qobj;
+ float mat_ambient[] = { 0.5f, 0.5f, 0.5f, 1.0f };
+ float mat_specular[] = { 1.0f, 1.0f, 1.0f, 1.0f };
+ float mat_shininess[] = { 50.0f };
+ float light_position[] = { 1.0f, 1.0f, 1.0f, 0.0f };
+ float model_ambient[] = { 0.5f, 0.5f, 0.5f, 1.0f };
+
+ gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
+
+ gl.glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient);
+ gl.glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular);
+ gl.glMaterialfv(GL_FRONT, GL_SHININESS, mat_shininess);
+ gl.glLightfv(GL_LIGHT0, GL_POSITION, light_position);
+ gl.glLightModelfv(GL_LIGHT_MODEL_AMBIENT, model_ambient);
+
+ gl.glEnable(GL_LIGHTING);
+ gl.glEnable(GL_LIGHT0);
+ gl.glEnable(GL_DEPTH_TEST);
+
+ /* Create 4 display lists, each with a different quadric object.
+ * Different drawing styles and surface normal specifications
+ * are demonstrated.
+ */
+ startList = gl.glGenLists(4);
+ qobj = glu.gluNewQuadric();
+
+ glu.gluQuadricDrawStyle(qobj, GLU_FILL); /* smooth shaded */
+ glu.gluQuadricNormals(qobj, GLU_SMOOTH);
+ gl.glNewList(startList, GL_COMPILE);
+ glu.gluSphere(qobj, 0.75f, 15, 10);
+ gl.glEndList();
+
+ glu.gluQuadricDrawStyle(qobj, GLU_FILL); /* flat shaded */
+ glu.gluQuadricNormals(qobj, GLU_FLAT);
+ gl.glNewList(startList+1, GL_COMPILE);
+ glu.gluCylinder(qobj, 0.5f, 0.3f, 1.0f, 15, 5);
+ gl.glEndList();
+
+ glu.gluQuadricDrawStyle(qobj, GLU_LINE); /* all polygons wireframe */
+ glu.gluQuadricNormals(qobj, GLU_NONE);
+ gl.glNewList(startList+2, GL_COMPILE);
+ glu.gluDisk(qobj, 0.25f, 1.0f, 20, 4);
+ gl.glEndList();
+
+ glu.gluQuadricDrawStyle(qobj, GLU_SILHOUETTE); /* boundary only */
+ glu.gluQuadricNormals(qobj, GLU_NONE);
+ gl.glNewList(startList+3, GL_COMPILE);
+ glu.gluPartialDisk(qobj, 0.0f, 1.0f, 20, 4, 0.0f, 225.0f);
+ gl.glEndList();
+
+ glu.gluDeleteQuadric(qobj);
+
+ glj.gljCheckGL();
+ }
+
+ public void cvsDispose()
+ {
+ System.out.println("destroy(): " + this);
+ super.cvsDispose();
+ }
+
+ public void reshape(int width, int height)
+ {
+ gl.glViewport(0,0,width,height);
+ gl.glMatrixMode(GL_PROJECTION);
+ gl.glLoadIdentity();
+ if (width <= height)
+ gl.glOrtho
+ (-2.5f,
+ 2.5f,
+ -2.5f*(float)height/(float)width,
+ 2.5f*(float)height/(float)width,
+ -10.0f,
+ 10.0f);
+ else
+ gl.glOrtho
+ (-2.5f*(float)width/(float)height,
+ 2.5f*(float)width/(float)height,
+ -2.5f,
+ 2.5f,
+ -10.0f,
+ 10.0f);
+ gl.glMatrixMode(GL_MODELVIEW);
+ gl.glLoadIdentity();
+ }
+
+ public void display()
+ {
+ if (glj.gljMakeCurrent() == false) return;
+
+ gl.glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+ gl.glPushMatrix();
+
+ gl.glEnable(GL_LIGHTING);
+ gl.glShadeModel(GL_SMOOTH);
+ gl.glTranslatef(-1.0f, -1.0f, 0.0f);
+ gl.glCallList(startList);
+
+ gl.glShadeModel(GL_FLAT);
+ gl.glTranslatef(0.0f, 2.0f, 0.0f);
+ gl.glPushMatrix();
+ gl.glRotatef(300.0f, 1.0f, 0.0f, 0.0f);
+ gl.glCallList(startList+1);
+ gl.glPopMatrix();
+
+ gl.glDisable(GL_LIGHTING);
+ gl.glColor3f(0.0f, 1.0f, 1.0f);
+ gl.glTranslatef(2.0f, -2.0f, 0.0f);
+ gl.glCallList(startList+2);
+
+ gl.glColor3f(1.0f, 1.0f, 0.0f);
+ gl.glTranslatef(0.0f, 2.0f, 0.0f);
+ gl.glCallList(startList+3);
+
+ gl.glPopMatrix();
+ gl.glFlush();
+
+ glj.gljSwap();
+ glj.gljCheckGL();
+ glj.gljFree();
+ }
+ }
+}
diff --git a/demos/RonsDemos/quadric_plugin13.html b/demos/RonsDemos/quadric_plugin13.html new file mode 100644 index 0000000..9d4db49 --- /dev/null +++ b/demos/RonsDemos/quadric_plugin13.html @@ -0,0 +1,48 @@ +<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.61 [en] (Win98; U) [Netscape]">
+ <title>Quadric by Silicon Graphics; ported to Java by Ron Cemer</title>
+</head>
+<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#e6e6ff">
+Quadric applet
+<br>Originially written by Silicon Graphics
+<br>Ported to Java by Ron Cemer
+<br>
+<!--"CONVERTED_APPLET"-->
+<!-- CONVERTER VERSION 1.3 --> +<SCRIPT LANGUAGE="JavaScript"><!-- + var _info = navigator.userAgent; var _ns = false; + var _ie = (_info.indexOf("MSIE") > 0 && _info.indexOf("Win") > 0 && _info.indexOf("Windows 3.1") < 0); +//--></SCRIPT> +<COMMENT><SCRIPT LANGUAGE="JavaScript1.1"><!-- + var _ns = (navigator.appName.indexOf("Netscape") >= 0 && ((_info.indexOf("Win") > 0 && _info.indexOf("Win16") < 0 && java.lang.System.getProperty("os.version").indexOf("3.5") < 0) || (_info.indexOf("Sun") > 0) || (_info.indexOf("Linux") > 0))); +//--></SCRIPT></COMMENT> + +<SCRIPT LANGUAGE="JavaScript"><!-- + if (_ie == true) document.writeln('<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" WIDTH = 400 HEIGHT = 400 codebase="http://java.sun.com/products/plugin/1.3/jinstall-13-win32.cab#Version=1,3,0,0"><NOEMBED><XMP>'); + else if (_ns == true) document.writeln('<EMBED type="application/x-java-applet;version=1.3" CODE = "quadric.class" WIDTH = 400 HEIGHT = 400 scriptable=false pluginspage="http://java.sun.com/products/plugin/1.3/plugin-install.html"><NOEMBED><XMP>'); +//--></SCRIPT> +<APPLET CODE = "quadric.class" WIDTH = 400 HEIGHT = 400></XMP> +<PARAM NAME = CODE VALUE = "quadric.class" >
+ +<PARAM NAME="type" VALUE="application/x-java-applet;version=1.3"> +<PARAM NAME="scriptable" VALUE="false"> + +</APPLET> + +</NOEMBED></EMBED></OBJECT> + + +<!-- +<APPLET CODE = "quadric.class" WIDTH = 400 HEIGHT = 400>
+
+
+</APPLET> +--> +<!--"END_CONVERTED_APPLET"-->
+
+<hr>
+</body>
+</html>
diff --git a/demos/RonsDemos/reflect.html b/demos/RonsDemos/reflect.html new file mode 100644 index 0000000..3ade9b6 --- /dev/null +++ b/demos/RonsDemos/reflect.html @@ -0,0 +1,22 @@ +<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.61 [en] (Win98; U) [Netscape]">
+ <title>Reflect by Brian Paul; ported to Java by Ron Cemer</title>
+</head>
+<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#e6e6ff">
+Reflect applet
+<br>Originially written by Brian Paul
+<br>Ported to Java by Ron Cemer
+<br>
+<hr>You can rotate the view by holding the left mouse button down and
+<br>dragging the mouse within the applet's window.
+<br>If you hold the right button down instead, the view will rotate
+<br>around the Z axis.
+<br>
+<applet code="reflect.class" width=400 height=400>
+</applet>
+<hr>
+</body>
+</html>
diff --git a/demos/RonsDemos/reflect.java b/demos/RonsDemos/reflect.java new file mode 100644 index 0000000..e857881 --- /dev/null +++ b/demos/RonsDemos/reflect.java @@ -0,0 +1,424 @@ +/**
+ * @(#) reflect.java
+ * @(#) author: Brian Paul (converted to Java by Ron Cemer)
+ */
+
+/*
+ * Demo of a reflective, texture-mapped surface with OpenGL.
+ * Brian Paul August 14, 1995 This file is in the public domain.
+ *
+ * Hardware texture mapping is highly recommended!
+ *
+ * The basic steps are:
+ * 1. Render the reflective object (a polygon) from the normal viewpoint,
+ * setting the stencil planes = 1.
+ * 2. Render the scene from a special viewpoint: the viewpoint which
+ * is on the opposite side of the reflective plane. Only draw where
+ * stencil = 1. This draws the objects in the reflective surface.
+ * 3. Render the scene from the original viewpoint. This draws the
+ * objects in the normal fashion. Use blending when drawing
+ * the reflective, textured surface.
+ *
+ * This is a very crude demo. It could be much better.
+ */
+
+/*
+ * Dirk Reiners ([email protected]) made some modifications to this code.
+ *
+ * August 1996 - A few optimizations by Brian
+ */
+
+/*
+ * April, 1997 - Added Mark Kilgard's changes.
+ */
+
+import java.applet.*;
+import java.awt.*;
+import java.awt.event.*;
+import java.lang.*;
+import java.util.*;
+import java.io.*;
+import java.util.*;
+
+import gl4java.GLContext;
+import gl4java.awt.GLAnimCanvas;
+import gl4java.applet.SimpleGLAnimApplet1;
+
+public class reflect extends SimpleGLAnimApplet1
+{
+ /* Initialize the applet */
+
+
+ public void init()
+ {
+ super.init();
+ Dimension d = getSize();
+ canvas = new reflectCanvas(d.width, d.height);
+ add("Center", canvas);
+ }
+
+
+ /* Local GLAnimCanvas extension class */
+
+
+ private class reflectCanvas extends GLAnimCanvas implements MouseListener, MouseMotionListener
+ {
+ private static final float M_PI = 3.14159265359f;
+ private static final float DEG2RAD = (M_PI/180.0f);
+ private static final int MAX_OBJECTS = 2;
+
+ private final float light_pos[] = { 0.0f, 20.0f, 0.0f, 1.0f };
+
+ private int textureid = 0;
+
+ private int table_list;
+ private int objects_list[];
+
+ private float spin, xrot, yrot;
+
+ private MatrixFuncs mtxfuncs = null;
+ private int prevMouseX, prevMouseY;
+ private boolean mouseRButtonDown = false;
+
+ public reflectCanvas(int w, int h)
+ {
+ super(w, h);
+ GLContext.gljNativeDebug = false;
+ GLContext.gljClassDebug = false;
+ setAnimateFps(60.0f);
+
+ mtxfuncs = new MatrixFuncs();
+ objects_list = new int[MAX_OBJECTS];
+ }
+
+ public void preInit()
+ {
+ doubleBuffer = true;
+ stereoView = false;
+ stencilBits = 3;
+ }
+
+ public void init()
+ {
+ System.out.println("init(): " + this);
+ reshape(getSize().width, getSize().height);
+
+ make_table();
+ make_objects();
+
+ int texIdBuf[] = new int[1];
+ gl.glGenTextures(1, texIdBuf);
+ textureid = texIdBuf[0];
+
+ gl.glBindTexture(GL_TEXTURE_2D,textureid);
+
+ HardCodedTexture texture = new DemoTex1();
+ gl.glTexImage2D
+ (GL_TEXTURE_2D,
+ 0,
+ texture.getComponents(),
+ texture.getWidth(),
+ texture.getHeight(),
+ 0,
+ texture.getFormat(),
+ texture.getType(),
+ texture.getBits());
+
+ gl.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
+ gl.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
+ gl.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+ gl.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+
+ gl.glBindTexture(GL_TEXTURE_2D,0);
+
+ spin = 0.0f;
+ xrot = 30.0f;
+ yrot = 50.0f;
+
+ gl.glShadeModel(GL_FLAT);
+
+ gl.glEnable(GL_LIGHT0);
+ gl.glEnable(GL_LIGHTING);
+
+ gl.glClearColor(0.5f, 0.5f, 0.5f, 1.0f);
+
+ gl.glEnable(GL_NORMALIZE);
+
+ glj.gljCheckGL();
+
+ addMouseListener(this);
+ addMouseMotionListener(this);
+ }
+
+ public void doCleanup()
+ {
+ System.out.println("destroy(): " + this);
+ removeMouseListener(this);
+ removeMouseMotionListener(this);
+ }
+
+ public void reshape(int width, int height)
+ {
+ float aspect = (float)width / (float)height;
+
+ gl.glViewport(0,0,width,height);
+ gl.glMatrixMode(GL_PROJECTION);
+ gl.glLoadIdentity();
+ gl.glFrustum(-aspect, aspect, -1.0f, 1.0f, 4.0f, 300.0f);
+ gl.glMatrixMode(GL_MODELVIEW);
+ gl.glLoadIdentity();
+ }
+
+ public void display()
+ {
+ if (glj.gljMakeCurrent() == false) return;
+
+ spin += 0.8f;
+ yrot += 1.2f;
+ if (yrot >= 360.0f) yrot -= 360.0f;
+
+ float dist = 20.0f;
+ float eyex, eyey, eyez;
+
+ gl.glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
+
+ eyex = dist * (float)Math.cos(yrot*DEG2RAD) * (float)Math.cos(xrot*DEG2RAD);
+ eyez = dist * (float)Math.sin(yrot*DEG2RAD) * (float)Math.cos(xrot*DEG2RAD);
+ eyey = dist * (float)Math.sin(xrot*DEG2RAD);
+
+ /* view from top */
+ gl.glPushMatrix();
+
+ glu.gluLookAt(eyex,eyey,eyez,0.0f,0.0f,0.0f,0.0f,1.0f,0.0f);
+
+ gl.glLightfv(GL_LIGHT0, GL_POSITION, light_pos);
+
+ /* draw table into stencil planes (non-textured for speed) */
+ gl.glEnable(GL_STENCIL_TEST);
+ gl.glDisable(GL_DEPTH_TEST);
+ gl.glStencilFunc(GL_ALWAYS, 1, 0xffffffff);
+ gl.glStencilOp(GL_REPLACE, GL_REPLACE, GL_REPLACE);
+ gl.glColorMask(false, false, false, false);
+ draw_table();
+ gl.glColorMask(true, true, true, true);
+
+ gl.glEnable(GL_DEPTH_TEST);
+
+ /* render view from below (reflected viewport) */
+ /* only draw where stencil==1 */
+ if (eyey > 0.0f)
+ {
+ gl.glPushMatrix();
+
+ gl.glStencilFunc(GL_EQUAL, 1, 0xffffffff); /* draw if ==1 */
+ gl.glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP);
+ gl.glScalef(1.0f, -1.0f, 1.0f);
+
+ /* Reposition light in reflected space. */
+ gl.glLightfv(GL_LIGHT0, GL_POSITION, light_pos);
+
+ draw_objects(eyex, eyey, eyez);
+ gl.glPopMatrix();
+
+ /* Restore light's original unreflected position. */
+ gl.glLightfv(GL_LIGHT0, GL_POSITION, light_pos);
+ }
+
+ /* draw table into color planes (textured this time) */
+ gl.glDisable(GL_STENCIL_TEST);
+
+ gl.glEnable(GL_BLEND);
+ gl.glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+
+ gl.glBindTexture(GL_TEXTURE_2D,textureid);
+ gl.glEnable(GL_TEXTURE_2D);
+ draw_table();
+ gl.glDisable(GL_TEXTURE_2D);
+ gl.glBindTexture(GL_TEXTURE_2D,0);
+ gl.glDisable(GL_BLEND);
+
+ /* view from top */
+ gl.glPushMatrix();
+
+ draw_objects(eyex, eyey, eyez);
+
+ gl.glPopMatrix();
+
+ gl.glPopMatrix();
+
+ glj.gljSwap();
+ glj.gljCheckGL();
+ glj.gljFree();
+
+ //if (!isSuspended()) repaint(); // Animate at full speed.
+ }
+
+ private void make_table()
+ {
+ float table_mat[] = { 1.0f, 1.0f, 1.0f, 0.6f };
+ float gray[] = { 0.4f, 0.4f, 0.4f, 1.0f };
+
+ table_list = gl.glGenLists(1);
+ gl.glNewList(table_list,GL_COMPILE);
+
+ /* load table's texture */
+ gl.glMaterialfv(GL_FRONT,GL_AMBIENT_AND_DIFFUSE,table_mat);
+ gl.glMaterialfv(GL_FRONT,GL_DIFFUSE,table_mat);
+ gl.glMaterialfv(GL_FRONT,GL_AMBIENT,gray);
+
+ /* draw textured square for the table */
+ gl.glPushMatrix();
+ gl.glScalef(4.0f, 4.0f, 4.0f);
+ gl.glBegin(GL_POLYGON);
+ gl.glNormal3f(0.0f, 1.0f, 0.0f);
+ gl.glTexCoord2f(0.0f, 0.0f); gl.glVertex3f(-1.0f, 0.0f, 1.0f);
+ gl.glTexCoord2f(1.0f, 0.0f); gl.glVertex3f( 1.0f, 0.0f, 1.0f);
+ gl.glTexCoord2f(1.0f, 1.0f); gl.glVertex3f( 1.0f, 0.0f, -1.0f);
+ gl.glTexCoord2f(0.0f, 1.0f); gl.glVertex3f(-1.0f, 0.0f, -1.0f);
+ gl.glEnd();
+ gl.glPopMatrix();
+
+ gl.glEndList();
+ }
+
+ private void make_objects()
+ {
+ int q;
+
+ float cyan[] = { 0.0f, 1.0f, 1.0f, 1.0f };
+ float green[] = { 0.2f, 1.0f, 0.2f, 1.0f };
+ float black[] = { 0.0f, 0.0f, 0.0f, 0.0f };
+
+ q = glu.gluNewQuadric();
+ glu.gluQuadricDrawStyle(q, GLU_FILL);
+ glu.gluQuadricNormals(q, GLU_SMOOTH);
+
+ objects_list[0] = gl.glGenLists(1);
+ gl.glNewList(objects_list[0], GL_COMPILE);
+ gl.glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, cyan );
+ gl.glMaterialfv(GL_FRONT, GL_EMISSION, black );
+ glu.gluCylinder(q, 0.5f, 0.5f, 1.0f, 15, 10);
+ gl.glEndList();
+
+ objects_list[1] = gl.glGenLists(1);
+ gl.glNewList(objects_list[1], GL_COMPILE);
+ gl.glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, green);
+ gl.glMaterialfv(GL_FRONT, GL_EMISSION, black);
+ glu.gluCylinder(q, 1.5, 0.0f, 2.5f, 15, 10);
+ gl.glEndList();
+ }
+
+
+ private void draw_objects(float eyex, float eyey, float eyez)
+ {
+ gl.glPushMatrix();
+ gl.glTranslatef(1.0f, 1.5f, 0.0f);
+ gl.glRotatef(spin, 1.0f, 0.5f, 0.0f);
+ gl.glRotatef(0.5f*spin, 0.0f, 0.5f, 1.0f);
+ gl.glCallList(objects_list[0]);
+ gl.glPopMatrix();
+
+ gl.glPushMatrix();
+ gl.glTranslatef(-1.0f, 0.85f+3.0f*(float)Math.abs((float)Math.cos(0.01f*spin)),0.0f);
+ gl.glRotatef(0.5f*spin, 0.0f, 0.5f, 1.0f);
+ gl.glRotatef(spin, 1.0f, 0.5f, 0.0f);
+ gl.glScalef(0.5f, 0.5f, 0.5f);
+ gl.glCallList(objects_list[1]);
+ gl.glPopMatrix();
+ }
+
+ private void draw_table()
+ {
+ gl.glCallList(table_list);
+ }
+
+ float[] MatrixTransform(float m[], float vx, float vy, float vz, float vw)
+ {
+ float v[] = new float[4];
+ float nx, ny, nz, nw, ninvw;
+
+ nx = ((vx*m[0])+(vy*m[4])+(vz*m[ 8])+(vw*m[12]));
+ ny = ((vx*m[1])+(vy*m[5])+(vz*m[ 9])+(vw*m[13]));
+ nz = ((vx*m[2])+(vy*m[6])+(vz*m[10])+(vw*m[14]));
+ nw = ((vx*m[3])+(vy*m[7])+(vz*m[11])+(vw*m[15]));
+ if ( (nw != 0.0f) && (nw != 1.0f) )
+ {
+ ninvw = 1.0f/nw;
+ nx *= ninvw;
+ ny *= ninvw;
+ nz *= ninvw;
+ }
+ v[0] = nx;
+ v[1] = ny;
+ v[2] = nz;
+ v[3] = 1.0f;
+ return(v);
+ }
+
+ // Methods required for the implementation of MouseListener
+ public void mouseEntered( MouseEvent evt )
+ {
+ }
+
+ public void mouseExited( MouseEvent evt )
+ {
+ }
+
+ public void mousePressed( MouseEvent evt )
+ {
+ prevMouseX = evt.getX();
+ prevMouseY = evt.getY();
+ if ((evt.getModifiers() & evt.BUTTON3_MASK) != 0)
+ {
+ mouseRButtonDown = true;
+ evt.consume();
+ }
+ }
+
+ public void mouseReleased( MouseEvent evt )
+ {
+ if ((evt.getModifiers() & evt.BUTTON3_MASK) != 0)
+ {
+ mouseRButtonDown = false;
+ evt.consume();
+ }
+ }
+
+ public void mouseClicked( MouseEvent evt )
+ {
+ }
+
+ // Methods required for the implementation of MouseMotionListener
+ public void mouseDragged( MouseEvent evt )
+ {
+ int x = evt.getX();
+ int y = evt.getY();
+ float thetaX = (float)(x-prevMouseX)*(360.0f/(float)getSize().width);
+ float thetaY = (float)(prevMouseY-y)*(360.0f/(float)getSize().height);
+ float mtxbuf[] = new float[16];
+ float mtxbuf2[] = new float[16];
+
+ prevMouseX = x;
+ prevMouseY = y;
+ if ( (thetaX != 0.0f) || (thetaY != 0.0f) )
+ {
+// This is a special hack for this applet only, due to
+// the fact that we are not using a rotation matrix!!!
+ yrot += thetaX;
+ while (yrot < 0.0f) yrot += 360.0f;
+ while (yrot >= 360.0f) yrot -= 360.0f;
+
+ xrot -= thetaY;
+ if (xrot > 90.0f)
+ xrot = 90.0f;
+ else if (xrot < -90.0f)
+ xrot = -90.0f;
+ }
+ evt.consume();
+ }
+
+ public void mouseMoved( MouseEvent evt )
+ {
+ }
+ }
+}
diff --git a/demos/RonsDemos/reflect_plugin13.html b/demos/RonsDemos/reflect_plugin13.html new file mode 100644 index 0000000..306e8d6 --- /dev/null +++ b/demos/RonsDemos/reflect_plugin13.html @@ -0,0 +1,53 @@ +<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.61 [en] (Win98; U) [Netscape]">
+ <title>Reflect by Brian Paul; ported to Java by Ron Cemer</title>
+</head>
+<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#e6e6ff">
+Reflect applet
+<br>Originially written by Brian Paul
+<br>Ported to Java by Ron Cemer
+<br>
+<hr>You can rotate the view by holding the left mouse button down and
+<br>dragging the mouse within the applet's window.
+<br>If you hold the right button down instead, the view will rotate
+<br>around the Z axis.
+<br>
+<!--"CONVERTED_APPLET"-->
+<!-- CONVERTER VERSION 1.3 --> +<SCRIPT LANGUAGE="JavaScript"><!-- + var _info = navigator.userAgent; var _ns = false; + var _ie = (_info.indexOf("MSIE") > 0 && _info.indexOf("Win") > 0 && _info.indexOf("Windows 3.1") < 0); +//--></SCRIPT> +<COMMENT><SCRIPT LANGUAGE="JavaScript1.1"><!-- + var _ns = (navigator.appName.indexOf("Netscape") >= 0 && ((_info.indexOf("Win") > 0 && _info.indexOf("Win16") < 0 && java.lang.System.getProperty("os.version").indexOf("3.5") < 0) || (_info.indexOf("Sun") > 0) || (_info.indexOf("Linux") > 0))); +//--></SCRIPT></COMMENT> + +<SCRIPT LANGUAGE="JavaScript"><!-- + if (_ie == true) document.writeln('<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" WIDTH = 400 HEIGHT = 400 codebase="http://java.sun.com/products/plugin/1.3/jinstall-13-win32.cab#Version=1,3,0,0"><NOEMBED><XMP>'); + else if (_ns == true) document.writeln('<EMBED type="application/x-java-applet;version=1.3" CODE = "reflect.class" WIDTH = 400 HEIGHT = 400 scriptable=false pluginspage="http://java.sun.com/products/plugin/1.3/plugin-install.html"><NOEMBED><XMP>'); +//--></SCRIPT> +<APPLET CODE = "reflect.class" WIDTH = 400 HEIGHT = 400></XMP> +<PARAM NAME = CODE VALUE = "reflect.class" >
+ +<PARAM NAME="type" VALUE="application/x-java-applet;version=1.3"> +<PARAM NAME="scriptable" VALUE="false"> + +</APPLET> + +</NOEMBED></EMBED></OBJECT> + + +<!-- +<APPLET CODE = "reflect.class" WIDTH = 400 HEIGHT = 400>
+
+
+</APPLET> +--> +<!--"END_CONVERTED_APPLET"-->
+
+<hr>
+</body>
+</html>
diff --git a/demos/RonsDemos/renormal.html b/demos/RonsDemos/renormal.html new file mode 100644 index 0000000..c0aa238 --- /dev/null +++ b/demos/RonsDemos/renormal.html @@ -0,0 +1,18 @@ +<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.61 [en] (Win98; U) [Netscape]">
+ <title>Renormal by Brian Paul; ported to Java by Ron Cemer</title>
+</head>
+<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#e6e6ff">
+Renormal applet
+<br>Originially written by Brian Paul
+<br>Ported to Java by Ron Cemer
+<br>
+<hr>
+<applet code="renormal.class" width=400 height=400>
+</applet>
+<hr>
+</body>
+</html>
diff --git a/demos/RonsDemos/renormal.java b/demos/RonsDemos/renormal.java new file mode 100644 index 0000000..783bf15 --- /dev/null +++ b/demos/RonsDemos/renormal.java @@ -0,0 +1,112 @@ +/**
+ * @(#) renormal.java
+ * @(#) author: Brian Paul (converted to Java by Ron Cemer)
+ */
+
+import java.applet.*;
+import java.awt.*;
+import java.awt.event.*;
+import java.lang.*;
+import java.util.*;
+import java.io.*;
+import java.util.*;
+
+import gl4java.GLContext;
+import gl4java.awt.GLAnimCanvas;
+import gl4java.applet.SimpleGLAnimApplet1;
+
+public class renormal extends SimpleGLAnimApplet1
+{
+ /* Initialize the applet */
+
+
+ public void init()
+ {
+ super.init();
+ Dimension d = getSize();
+ canvas = new renormalCanvas(d.width, d.height);
+ add("Center", canvas);
+ }
+
+
+ /* Local GLAnimCanvas extension class */
+
+
+ private class renormalCanvas extends GLAnimCanvas
+ {
+ private static final float M_PI = 3.14159265359f;
+ private float Phi = 0.0f;
+
+ public renormalCanvas(int w, int h)
+ {
+ super(w, h);
+ GLContext.gljNativeDebug = false;
+ GLContext.gljClassDebug = false;
+ setAnimateFps(30.0);
+ }
+
+ public void preInit()
+ {
+ doubleBuffer = true;
+ stereoView = false;
+ }
+
+ public void init()
+ {
+ System.out.println("init(): " + this);
+ reshape(getSize().width, getSize().height);
+
+ float mat[] = { 0.8f, 0.8f, 0.0f, 1.0f };
+ float pos[] = { -1.0f, 1.0f, 1.0f, 0.0f };
+
+ /* setup lighting, etc */
+ gl.glEnable(GL_LIGHTING);
+ gl.glEnable(GL_LIGHT0);
+ gl.glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, mat);
+ gl.glLightfv(GL_LIGHT0, GL_POSITION, pos);
+ gl.glEnable(GL_CULL_FACE);
+ gl.glEnable(GL_NORMALIZE);
+
+ glj.gljCheckGL();
+ }
+
+ public void reshape(int width, int height)
+ {
+ gl.glViewport(0,0,width,height);
+ gl.glMatrixMode(GL_PROJECTION);
+ gl.glLoadIdentity();
+ gl.glFrustum(-1.0f, 1.0f, -1.0f, 1.0f, 5.0f, 25.0f);
+ gl.glMatrixMode(GL_MODELVIEW);
+ gl.glLoadIdentity();
+ gl.glTranslatef(0.0f, 0.0f, -15.0f);
+ }
+
+ public void display()
+ {
+ if (glj.gljMakeCurrent() == false) return;
+
+ Phi += 0.05f;
+ while (Phi >= (M_PI*2.0f)) Phi -= (M_PI*2.0f);
+
+ float scale = 0.6f + (0.5f * (float)Math.sin(Phi));
+ gl.glClear(GL_COLOR_BUFFER_BIT);
+ gl.glPushMatrix();
+ gl.glScalef(scale, scale, scale);
+
+ int qobj = glu.gluNewQuadric();
+ glu.gluQuadricOrientation(qobj,GLU_OUTSIDE);
+ glu.gluQuadricNormals(qobj,GLU_SMOOTH);
+ glu.gluQuadricTexture(qobj,false);
+ glu.gluSphere(qobj,2.0f,40,40);
+ glu.gluDeleteQuadric(qobj);
+
+ gl.glPopMatrix();
+
+ glj.gljSwap();
+ glj.gljCheckGL();
+ glj.gljFree();
+
+ //if (!isSuspended()) repaint(); // Animate at full speed.
+ }
+ }
+}
diff --git a/demos/RonsDemos/renormal_plugin13.html b/demos/RonsDemos/renormal_plugin13.html new file mode 100644 index 0000000..d40bb7b --- /dev/null +++ b/demos/RonsDemos/renormal_plugin13.html @@ -0,0 +1,49 @@ +<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.61 [en] (Win98; U) [Netscape]">
+ <title>Renormal by Brian Paul; ported to Java by Ron Cemer</title>
+</head>
+<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#e6e6ff">
+Renormal applet
+<br>Originially written by Brian Paul
+<br>Ported to Java by Ron Cemer
+<br>
+<hr>
+<!--"CONVERTED_APPLET"-->
+<!-- CONVERTER VERSION 1.3 --> +<SCRIPT LANGUAGE="JavaScript"><!-- + var _info = navigator.userAgent; var _ns = false; + var _ie = (_info.indexOf("MSIE") > 0 && _info.indexOf("Win") > 0 && _info.indexOf("Windows 3.1") < 0); +//--></SCRIPT> +<COMMENT><SCRIPT LANGUAGE="JavaScript1.1"><!-- + var _ns = (navigator.appName.indexOf("Netscape") >= 0 && ((_info.indexOf("Win") > 0 && _info.indexOf("Win16") < 0 && java.lang.System.getProperty("os.version").indexOf("3.5") < 0) || (_info.indexOf("Sun") > 0) || (_info.indexOf("Linux") > 0))); +//--></SCRIPT></COMMENT> + +<SCRIPT LANGUAGE="JavaScript"><!-- + if (_ie == true) document.writeln('<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" WIDTH = 400 HEIGHT = 400 codebase="http://java.sun.com/products/plugin/1.3/jinstall-13-win32.cab#Version=1,3,0,0"><NOEMBED><XMP>'); + else if (_ns == true) document.writeln('<EMBED type="application/x-java-applet;version=1.3" CODE = "renormal.class" WIDTH = 400 HEIGHT = 400 scriptable=false pluginspage="http://java.sun.com/products/plugin/1.3/plugin-install.html"><NOEMBED><XMP>'); +//--></SCRIPT> +<APPLET CODE = "renormal.class" WIDTH = 400 HEIGHT = 400></XMP> +<PARAM NAME = CODE VALUE = "renormal.class" >
+ +<PARAM NAME="type" VALUE="application/x-java-applet;version=1.3"> +<PARAM NAME="scriptable" VALUE="false"> + +</APPLET> + +</NOEMBED></EMBED></OBJECT> + + +<!-- +<APPLET CODE = "renormal.class" WIDTH = 400 HEIGHT = 400>
+
+
+</APPLET> +--> +<!--"END_CONVERTED_APPLET"-->
+
+<hr>
+</body>
+</html>
diff --git a/demos/RonsDemos/rings.html b/demos/RonsDemos/rings.html new file mode 100644 index 0000000..a393253 --- /dev/null +++ b/demos/RonsDemos/rings.html @@ -0,0 +1,18 @@ +<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.61 [en] (Win98; U) [Netscape]">
+ <title>Rings by Philip Winston; ported to Java by Ron Cemer</title>
+</head>
+<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#e6e6ff">
+Rings applet
+<br>Originially written by Philip Winston
+<br>Ported to Java by Ron Cemer
+<br>Right-click within the window for a menu of commands.
+<br>
+<applet code="rings.class" width=400 height=400>
+</applet>
+<hr>
+</body>
+</html>
diff --git a/demos/RonsDemos/rings.java b/demos/RonsDemos/rings.java new file mode 100644 index 0000000..8a08bb5 --- /dev/null +++ b/demos/RonsDemos/rings.java @@ -0,0 +1,406 @@ +/**
+ * @(#) rings.java
+ * @(#) author: Philip Winston (converted to Java by Ron Cemer)
+ */
+
+/*
+ * Homework 4, Part 1: perspective, hierarchical coords, moving eye pos.
+ *
+ * Do a slow zoom on a bunch of rings (ala Superman III?)
+ *
+ * Philip Winston - 2/21/95
+ * http://www.cs.hmc.edu/people/pwinston
+ *
+ */
+
+import java.applet.*;
+import java.awt.*;
+import java.awt.event.*;
+import java.lang.*;
+import java.util.*;
+import java.io.*;
+import java.util.*;
+import gl4java.GLContext;
+import gl4java.awt.GLAnimCanvas;
+import gl4java.applet.SimpleGLAnimApplet1;
+
+public class rings extends SimpleGLAnimApplet1
+{
+ /* Initialize the applet */
+
+
+ public void init()
+ {
+ super.init();
+ Dimension d = getSize();
+ canvas = new ringsCanvas(d.width, d.height);
+ add("Center", canvas);
+ }
+
+
+ /* Local GLAnimCanvas extension class */
+
+
+ private class ringsCanvas extends GLAnimCanvas
+ implements MouseListener, ActionListener
+ {
+ private final double M_PI = 3.14159265;
+ private final String MENU_STARTOVER = "Start Over";
+ private final String MENU_ZOOM_OUT = "Zoom Out";
+ private final String MENU_START_RINGS = "Start rings";
+ private final String MENU_STOP_RINGS = "Stop rings";
+ private final String MENU_START_FADE = "Start fade";
+ private final String MENU_STOP_FADE = "Stop fade";
+ private final int CONE = 1, TORUS = 2, INNERMAT = 3, OUTTERMAT = 4;
+ private final double STEPS = 30.0;
+
+ private PopupMenu menu = null;
+ private boolean menu_showing = false;
+ private boolean save_suspended = false;
+ private boolean Fade = true; /* Start moving out */
+ private float Axis = 0.0f;
+ private float AxisInc = (float)(2.0 * M_PI / STEPS);
+ private float InnerRad, OutterRad, Tilt, Trans, TransCone, Dist;
+
+ public ringsCanvas(int w, int h)
+ {
+ super(w, h);
+ GLContext.gljNativeDebug = false;
+ GLContext.gljClassDebug = false;
+ setAnimateFps(30.0);
+ }
+
+ public void preInit()
+ {
+ doubleBuffer = true;
+ stereoView = false;
+ }
+
+ public void init()
+ {
+ System.out.println("init(): " + this);
+ reshape(getSize().width, getSize().height);
+
+ float sinoftilt;
+ InnerRad = 0.70f;
+ OutterRad = 5.0f;
+ Tilt = 15.0f;
+ Dist = 10.0f;
+ sinoftilt = (float)Math.sin(Tilt * M_PI*2.0/360.0);
+ Trans = (float)
+ ((2.0f*OutterRad + InnerRad) * sinoftilt +
+ InnerRad +
+ ((1 - sinoftilt) * InnerRad) - (InnerRad * 0.1));
+ TransCone = Trans + (OutterRad * sinoftilt + InnerRad);
+ /* I used code from the book's accnot.c as a starting
+ point for lighting. I have one positional light in
+ center, then one directional */
+ float light0_position[] = { 1.0f, 0.2f, 1.0f, 0.0f };
+ float light1_position[] = { 0.0f, 0.0f, 0.0f, 1.0f };
+ float light1_diffuse[] = { 1.0f, 1.0f, 1.0f, 1.0f };
+ float light1_specular[] = { 1.0f, 1.0f, 1.0f, 1.0f };
+ float lm_ambient[] = { 0.2f, 0.2f, 0.2f, 1.0f };
+
+ gl.glEnable(GL_NORMALIZE);
+ gl.glMatrixMode(GL_PROJECTION);
+ gl.glLoadIdentity();
+ gl.glMatrixMode(GL_MODELVIEW);
+ gl.glLoadIdentity();
+
+ gl.glLightfv(GL_LIGHT0, GL_POSITION, light0_position);
+ gl.glLightfv(GL_LIGHT1, GL_POSITION, light1_position);
+ gl.glLightfv(GL_LIGHT1, GL_DIFFUSE, light1_diffuse);
+ gl.glLightfv(GL_LIGHT1, GL_SPECULAR, light1_specular);
+ gl.glLightf(GL_LIGHT1, GL_LINEAR_ATTENUATION, 0.2f);
+ gl.glLightModelfv(GL_LIGHT_MODEL_AMBIENT, lm_ambient);
+
+ gl.glEnable(GL_LIGHTING);
+ gl.glEnable(GL_LIGHT0);
+ gl.glEnable(GL_LIGHT1);
+
+ gl.glDepthFunc(GL_LESS);
+ gl.glEnable(GL_DEPTH_TEST);
+
+ // Make display lists
+
+ float cone_diffuse[] = { 0.0f, 0.7f, 0.7f, 1.0f };
+ float mat1_ambient[] = { 1.0f, 1.0f, 1.0f, 1.0f };
+ float mat2_ambient[] = { 0.0f, 0.0f, 0.0f, 0.0f };
+ float torus1_diffuse[] = { 0.7f, 0.7f, 0.0f, 1.0f };
+ float torus2_diffuse[] = { 0.3f, 0.0f, 0.0f, 1.0f };
+ float mat1_specular[] = { 1.0f, 1.0f, 1.0f, 1.0f };
+ float mat2_specular[] = { 0.5f, 0.5f, 0.5f, 1.0f };
+
+ gl.glNewList(INNERMAT, GL_COMPILE);
+ gl.glMaterialfv(GL_FRONT, GL_SPECULAR, mat1_specular);
+ gl.glMaterialf(GL_FRONT, GL_SHININESS, 50.0f);
+ gl.glMaterialfv(GL_FRONT, GL_DIFFUSE, torus1_diffuse);
+ gl.glMaterialfv(GL_FRONT, GL_AMBIENT, mat1_ambient);
+ gl.glEndList();
+
+ gl.glNewList(OUTTERMAT, GL_COMPILE);
+ gl.glMaterialfv(GL_FRONT, GL_SPECULAR, mat2_specular);
+ gl.glMaterialf(GL_FRONT, GL_SHININESS, 25.0f);
+ gl.glMaterialfv(GL_FRONT, GL_DIFFUSE, torus2_diffuse);
+ gl.glMaterialfv(GL_FRONT, GL_AMBIENT, mat2_ambient);
+ gl.glEndList();
+
+ gl.glNewList(CONE, GL_COMPILE);
+ gl.glMaterialfv(GL_FRONT, GL_DIFFUSE, cone_diffuse);
+ gl.glPushMatrix();
+ gl.glTranslatef(0, -TransCone, 0);
+ gl.glRotatef(90, 1, 0, 0);
+ glutSolidCone(OutterRad, 10, 8, 8);
+ gl.glPopMatrix();
+ gl.glEndList();
+
+ gl.glNewList(TORUS, GL_COMPILE);
+ gl.glPushMatrix();
+ gl.glRotatef(90, 1, 0, 0);
+ glutSolidTorus(InnerRad, OutterRad, 15, 25);
+ gl.glPopMatrix();
+ gl.glEndList();
+
+ glj.gljCheckGL();
+
+ menu = new PopupMenu("Options");
+ menu.add(MENU_STARTOVER);
+ menu.add(MENU_ZOOM_OUT);
+ menu.add(MENU_START_RINGS);
+ menu.add(MENU_STOP_RINGS);
+ menu.add(MENU_START_FADE);
+ menu.add(MENU_STOP_FADE);
+ menu.addActionListener(this);
+ add(menu);
+
+ addMouseListener(this);
+ }
+
+ public void doCleanup()
+ {
+ System.out.println("destroy(): " + this);
+ removeMouseListener(this);
+ menu.removeActionListener(this);
+ }
+
+ public void reshape(int width, int height)
+ {
+ gl.glViewport(0,0,width,height);
+ }
+
+ public void display()
+ {
+ if (glj.gljMakeCurrent() == false) return;
+
+ Axis += AxisInc;
+
+ if ( (Dist < 15.0f) && (Fade) ) /* start slow */
+ Dist += 0.1f;
+ else if ( (Dist < 800.0f) && (Fade) ) /* don't go back too far */
+ Dist *= 1.005f;
+
+ gl.glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+ gl.glMatrixMode(GL_PROJECTION);
+ gl.glLoadIdentity();
+ gl.glFrustum(-1.0f,1.0f,-1.0f,1.0f,10.0f,1000.0f);
+ glu.gluLookAt(0.0f,0.0f,Dist,0.0f,0.0f,0.0f,0.0f,1.0f,0.0f);
+
+ gl.glMatrixMode(GL_MODELVIEW);
+
+ gl.glCallList(INNERMAT);
+ DrawRings(Axis);
+ gl.glCallList(CONE);
+
+ gl.glCallList(OUTTERMAT);
+ gl.glPushMatrix();
+ gl.glScalef(10, 10, 10);
+ DrawRings(Axis/3.0f);
+ gl.glPopMatrix();
+
+ glj.gljSwap();
+ glj.gljCheckGL();
+ glj.gljFree();
+
+ //if (!isSuspended()) repaint(); // Animate at full speed.
+ }
+
+ // Methods required for the implementation of MouseListener
+ public void mouseEntered(MouseEvent evt)
+ {
+ }
+
+ public void mouseExited(MouseEvent evt)
+ {
+ }
+
+ public void mousePressed(MouseEvent evt)
+ {
+ // If user presses right mouse button within canvas area,
+ // suspend animation and pop up menu.
+ // If menu was already popped up and user presses either
+ // mouse button within canvas area, resume animation
+ // because the menu will have been removed automatically.
+ if (!menu_showing)
+ {
+ if ((evt.getModifiers() & evt.BUTTON3_MASK) != 0)
+ {
+ menu_showing = true;
+ save_suspended = isSuspended();
+ if (!save_suspended)
+ {
+ setSuspended(true);
+ repaint(100);
+ try
+ {
+ Thread.currentThread().sleep(200);
+ }
+ catch (Exception e)
+ { }
+ }
+ menu.show(this,evt.getX(),evt.getY());
+ }
+ }
+ else
+ {
+ menu_showing = false;
+ setSuspended(save_suspended);
+ }
+ }
+
+ public void mouseReleased(MouseEvent evt)
+ {
+ }
+
+ public void mouseClicked(MouseEvent evt)
+ {
+ }
+
+ // Method required for the implementation of ActionListener
+ public void actionPerformed(ActionEvent evt)
+ {
+ String c = evt.getActionCommand();
+ if (c.equals(MENU_STARTOVER))
+ {
+ Dist = 10.0f;
+ Axis = 0.0f;
+ Fade = true;
+ AxisInc = (float)(2.0 * M_PI / STEPS);
+ }
+ else if (c.equals(MENU_ZOOM_OUT))
+ {
+ Dist = 800.0f;
+ }
+ else if (c.equals(MENU_START_RINGS))
+ {
+ AxisInc = (float)(2.0 * M_PI / STEPS);
+ }
+ else if (c.equals(MENU_STOP_RINGS))
+ {
+ AxisInc = 0.0f;
+ }
+ else if (c.equals(MENU_START_FADE))
+ {
+ Fade = true;
+ }
+ else if (c.equals(MENU_STOP_FADE))
+ {
+ Fade = false;
+ }
+ if (menu_showing)
+ {
+ menu_showing = false;
+ setSuspended(save_suspended);
+ }
+ }
+
+ /* Draw three rings, rotated and translate so they look cool */
+ private void DrawRings(float axis)
+ {
+ float x = (float)Math.sin(axis), y = (float)Math.cos(axis);
+ gl.glPushMatrix();
+ gl.glTranslatef(0.0f, Trans, 0.0f);
+ gl.glRotatef(Tilt, x, 0.0f, y);
+ gl.glCallList(TORUS);
+ gl.glPopMatrix();
+ gl.glPushMatrix();
+ gl.glRotatef(-Tilt, x, 0.0f, y);
+ gl.glCallList(TORUS);
+ gl.glPopMatrix();
+ gl.glPushMatrix();
+ gl.glTranslatef(0.0f, -Trans, 0.0f);
+ gl.glRotatef(Tilt, x, 0.0f, y);
+ gl.glCallList(TORUS);
+ gl.glPopMatrix();
+ }
+
+ // Imported from glut.
+ private void glutSolidTorus
+ (float innerRadius,
+ float outerRadius,
+ int nsides,
+ int rings)
+ {
+ doughnut(innerRadius, outerRadius, nsides, rings);
+ }
+
+ // Imported from glut.
+ private void glutSolidCone
+ (float base,
+ float height,
+ int slices,
+ int stacks)
+ {
+ int qobj = glu.gluNewQuadric();
+
+ glu.gluQuadricDrawStyle(qobj,GLU_FILL);
+ glu.gluQuadricNormals(qobj,GLU_SMOOTH);
+ glu.gluCylinder(qobj,base,0.0f,height,slices,stacks);
+ glu.gluDeleteQuadric(qobj);
+ }
+
+ // Imported from glut.
+ private void doughnut(float r, float R, int nsides, int rings)
+ {
+ int i, j;
+ float theta, phi, theta1;
+ float cosTheta, sinTheta;
+ float cosTheta1, sinTheta1;
+ float ringDelta, sideDelta;
+
+ ringDelta = 2.0f * (float)M_PI / rings;
+ sideDelta = 2.0f * (float)M_PI / nsides;
+
+ theta = 0.0f;
+ cosTheta = 1.0f;
+ sinTheta = 0.0f;
+ for (i = rings - 1; i >= 0; i--)
+ {
+ theta1 = theta + ringDelta;
+ cosTheta1 = (float)Math.cos(theta1);
+ sinTheta1 = (float)Math.sin(theta1);
+ gl.glBegin(GL_QUAD_STRIP);
+ phi = 0.0f;
+ for (j = nsides; j >= 0; j--)
+ {
+ float cosPhi, sinPhi, dist;
+
+ phi += sideDelta;
+ cosPhi = (float)Math.cos(phi);
+ sinPhi = (float)Math.sin(phi);
+ dist = R + r * cosPhi;
+
+ gl.glNormal3f(cosTheta1 * cosPhi, -sinTheta1 * cosPhi, sinPhi);
+ gl.glVertex3f(cosTheta1 * dist, -sinTheta1 * dist, r * sinPhi);
+ gl.glNormal3f(cosTheta * cosPhi, -sinTheta * cosPhi, sinPhi);
+ gl.glVertex3f(cosTheta * dist, -sinTheta * dist, r * sinPhi);
+ }
+ gl.glEnd();
+ theta = theta1;
+ cosTheta = cosTheta1;
+ sinTheta = sinTheta1;
+ }
+ }
+ }
+}
diff --git a/demos/RonsDemos/rings_plugin13.html b/demos/RonsDemos/rings_plugin13.html new file mode 100644 index 0000000..48ac24c --- /dev/null +++ b/demos/RonsDemos/rings_plugin13.html @@ -0,0 +1,49 @@ +<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.61 [en] (Win98; U) [Netscape]">
+ <title>Rings by Philip Winston; ported to Java by Ron Cemer</title>
+</head>
+<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#e6e6ff">
+Rings applet
+<br>Originially written by Philip Winston
+<br>Ported to Java by Ron Cemer
+<br>Right-click within the window for a menu of commands.
+<br>
+<!--"CONVERTED_APPLET"-->
+<!-- CONVERTER VERSION 1.3 --> +<SCRIPT LANGUAGE="JavaScript"><!-- + var _info = navigator.userAgent; var _ns = false; + var _ie = (_info.indexOf("MSIE") > 0 && _info.indexOf("Win") > 0 && _info.indexOf("Windows 3.1") < 0); +//--></SCRIPT> +<COMMENT><SCRIPT LANGUAGE="JavaScript1.1"><!-- + var _ns = (navigator.appName.indexOf("Netscape") >= 0 && ((_info.indexOf("Win") > 0 && _info.indexOf("Win16") < 0 && java.lang.System.getProperty("os.version").indexOf("3.5") < 0) || (_info.indexOf("Sun") > 0) || (_info.indexOf("Linux") > 0))); +//--></SCRIPT></COMMENT> + +<SCRIPT LANGUAGE="JavaScript"><!-- + if (_ie == true) document.writeln('<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" WIDTH = 400 HEIGHT = 400 codebase="http://java.sun.com/products/plugin/1.3/jinstall-13-win32.cab#Version=1,3,0,0"><NOEMBED><XMP>'); + else if (_ns == true) document.writeln('<EMBED type="application/x-java-applet;version=1.3" CODE = "rings.class" WIDTH = 400 HEIGHT = 400 scriptable=false pluginspage="http://java.sun.com/products/plugin/1.3/plugin-install.html"><NOEMBED><XMP>'); +//--></SCRIPT> +<APPLET CODE = "rings.class" WIDTH = 400 HEIGHT = 400></XMP> +<PARAM NAME = CODE VALUE = "rings.class" >
+ +<PARAM NAME="type" VALUE="application/x-java-applet;version=1.3"> +<PARAM NAME="scriptable" VALUE="false"> + +</APPLET> + +</NOEMBED></EMBED></OBJECT> + + +<!-- +<APPLET CODE = "rings.class" WIDTH = 400 HEIGHT = 400>
+
+
+</APPLET> +--> +<!--"END_CONVERTED_APPLET"-->
+
+<hr>
+</body>
+</html>
diff --git a/demos/RonsDemos/sappletviewer.bat b/demos/RonsDemos/sappletviewer.bat new file mode 100755 index 0000000..90f7666 --- /dev/null +++ b/demos/RonsDemos/sappletviewer.bat @@ -0,0 +1 @@ +appletviewer.exe -J-Djava.security.policy=gl4java.policy %*
diff --git a/demos/RonsDemos/sappletviewer.sh b/demos/RonsDemos/sappletviewer.sh new file mode 100755 index 0000000..7add0f7 --- /dev/null +++ b/demos/RonsDemos/sappletviewer.sh @@ -0,0 +1,3 @@ +#! /bin/sh + +appletviewer -J-Djava.security.policy=gl4java.policy $* diff --git a/demos/RonsDemos/scube.html b/demos/RonsDemos/scube.html new file mode 100644 index 0000000..b889faf --- /dev/null +++ b/demos/RonsDemos/scube.html @@ -0,0 +1,27 @@ +<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.61 [en] (Win98; U) [Netscape]">
+ <title>Scube by David G Yu/Mark J. Kilgard/Silicon Graphics; ported to Java by Ron Cemer</title>
+</head>
+<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#e6e6ff">
+Scube applet
+<br>Originially written by David G Yu/Mark J. Kilgard/Silicon Graphics
+<br>Ported to Java by Ron Cemer
+<br>Click inside the window, then press any of the following keys:
+<br>L/l: toggle lighting
+<br>S/s: toggle SGI logo on/off
+<br>Q/q: toggle between quads and polygons for drawing
+<br>F/f: toggle fog
+<br>1: linear fog mode
+<br>2: exponential fog mode
+<br>3: exponential squared fog mode
+<br>p/P: toggle motion (pause/resume)
+<br>spacebar: single-step while paused
+<br>
+<applet code="scube.class" width=400 height=400>
+</applet>
+<hr>
+</body>
+</html>
diff --git a/demos/RonsDemos/scube.java b/demos/RonsDemos/scube.java new file mode 100644 index 0000000..f06cc4e --- /dev/null +++ b/demos/RonsDemos/scube.java @@ -0,0 +1,590 @@ +/**
+ * @(#) scube.java
+ * @(#) author: David G Yu/Mark J. Kilgard/Silicon Graphics (converted to Java by Ron Cemer)
+ */
+
+/* Copyright (c) Mark J. Kilgard, 1994. */
+
+/**
+ * (c) Copyright 1993, 1994, Silicon Graphics, Inc.
+ * ALL RIGHTS RESERVED
+ * Permission to use, copy, modify, and distribute this software for
+ * any purpose and without fee is hereby granted, provided that the above
+ * copyright notice appear in all copies and that both the copyright notice
+ * and this permission notice appear in supporting documentation, and that
+ * the name of Silicon Graphics, Inc. not be used in advertising
+ * or publicity pertaining to distribution of the software without specific,
+ * written prior permission.
+ *
+ * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
+ * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
+ * FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
+ * GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT,
+ * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY
+ * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION,
+ * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF
+ * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN
+ * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
+ * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * US Government Users Restricted Rights
+ * Use, duplication, or disclosure by the Government is subject to
+ * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
+ * (c)(1)(ii) of the Rights in Technical Data and Computer Software
+ * clause at DFARS 252.227-7013 and/or in similar or successor
+ * clauses in the FAR or the DOD or NASA FAR Supplement.
+ * Unpublished-- rights reserved under the copyright laws of the
+ * United States. Contractor/manufacturer is Silicon Graphics,
+ * Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311.
+ *
+ * OpenGL(TM) is a trademark of Silicon Graphics, Inc.
+ */
+
+/*
+ * 1992 David G Yu -- Silicon Graphics Computer Systems
+ */
+
+import java.applet.*;
+import java.awt.*;
+import java.awt.event.*;
+import java.lang.*;
+import java.util.*;
+import java.io.*;
+import java.util.*;
+import gl4java.GLContext;
+import gl4java.awt.GLAnimCanvas;
+import gl4java.applet.SimpleGLAnimApplet1;
+
+public class scube extends SimpleGLAnimApplet1
+{
+
+ /* Initialize the applet */
+
+
+ public void init()
+ {
+ super.init();
+ Dimension d = getSize();
+ canvas = new scubeCanvas(d.width, d.height);
+ add("Center", canvas);
+ }
+
+
+ /* Local GLAnimCanvas extension class */
+
+
+ private class scubeCanvas extends GLAnimCanvas
+ implements KeyListener, MouseListener
+ {
+ private static final int
+ GREY=0,RED=1,GREEN=2,BLUE=3,CYAN=4,MAGENTA=5,YELLOW=6,BLACK=7;
+
+ private float materialColor[][] =
+ {
+ {0.8f, 0.8f, 0.8f, 1.0f},
+ {0.8f, 0.0f, 0.0f, 1.0f},
+ {0.0f, 0.8f, 0.0f, 1.0f},
+ {0.0f, 0.0f, 0.8f, 1.0f},
+ {0.0f, 0.8f, 0.8f, 1.0f},
+ {0.8f, 0.0f, 0.8f, 1.0f},
+ {0.8f, 0.8f, 0.0f, 1.0f},
+ {0.0f, 0.0f, 0.0f, 0.6f},
+ };
+
+ private float lightPos[] = {2.0f, 4.0f, 2.0f, 1.0f};
+ private float lightAmb[] = {0.2f, 0.2f, 0.2f, 1.0f};
+ private float lightDiff[] = {0.8f, 0.8f, 0.8f, 1.0f};
+ private float lightSpec[] = {0.4f, 0.4f, 0.4f, 1.0f};
+
+ private float groundPlane[] = {0.0f, 1.0f, 0.0f, 1.499f};
+ private float backPlane[] = {0.0f, 0.0f, 1.0f, 0.899f};
+
+ private float fogColor[] = {0.0f, 0.0f, 0.0f, 0.0f};
+ private float fogIndex[] = {0.0f};
+
+ private byte shadowPattern[] =
+ {
+ (byte)0xaa, (byte)0xaa, (byte)0xaa, (byte)0xaa, (byte)0x55, (byte)0x55, (byte)0x55, (byte)0x55, /* 50% Grey */
+ (byte)0xaa, (byte)0xaa, (byte)0xaa, (byte)0xaa, (byte)0x55, (byte)0x55, (byte)0x55, (byte)0x55,
+ (byte)0xaa, (byte)0xaa, (byte)0xaa, (byte)0xaa, (byte)0x55, (byte)0x55, (byte)0x55, (byte)0x55,
+ (byte)0xaa, (byte)0xaa, (byte)0xaa, (byte)0xaa, (byte)0x55, (byte)0x55, (byte)0x55, (byte)0x55,
+ (byte)0xaa, (byte)0xaa, (byte)0xaa, (byte)0xaa, (byte)0x55, (byte)0x55, (byte)0x55, (byte)0x55,
+ (byte)0xaa, (byte)0xaa, (byte)0xaa, (byte)0xaa, (byte)0x55, (byte)0x55, (byte)0x55, (byte)0x55,
+ (byte)0xaa, (byte)0xaa, (byte)0xaa, (byte)0xaa, (byte)0x55, (byte)0x55, (byte)0x55, (byte)0x55,
+ (byte)0xaa, (byte)0xaa, (byte)0xaa, (byte)0xaa, (byte)0x55, (byte)0x55, (byte)0x55, (byte)0x55,
+ (byte)0xaa, (byte)0xaa, (byte)0xaa, (byte)0xaa, (byte)0x55, (byte)0x55, (byte)0x55, (byte)0x55,
+ (byte)0xaa, (byte)0xaa, (byte)0xaa, (byte)0xaa, (byte)0x55, (byte)0x55, (byte)0x55, (byte)0x55,
+ (byte)0xaa, (byte)0xaa, (byte)0xaa, (byte)0xaa, (byte)0x55, (byte)0x55, (byte)0x55, (byte)0x55,
+ (byte)0xaa, (byte)0xaa, (byte)0xaa, (byte)0xaa, (byte)0x55, (byte)0x55, (byte)0x55, (byte)0x55,
+ (byte)0xaa, (byte)0xaa, (byte)0xaa, (byte)0xaa, (byte)0x55, (byte)0x55, (byte)0x55, (byte)0x55,
+ (byte)0xaa, (byte)0xaa, (byte)0xaa, (byte)0xaa, (byte)0x55, (byte)0x55, (byte)0x55, (byte)0x55,
+ (byte)0xaa, (byte)0xaa, (byte)0xaa, (byte)0xaa, (byte)0x55, (byte)0x55, (byte)0x55, (byte)0x55,
+ (byte)0xaa, (byte)0xaa, (byte)0xaa, (byte)0xaa, (byte)0x55, (byte)0x55, (byte)0x55, (byte)0x55
+ };
+
+ private byte sgiPattern[] =
+ {
+ (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff, /* SGI Logo */
+ (byte)0xff, (byte)0xbd, (byte)0xff, (byte)0x83, (byte)0xff, (byte)0x5a, (byte)0xff, (byte)0xef,
+ (byte)0xfe, (byte)0xdb, (byte)0x7f, (byte)0xef, (byte)0xfd, (byte)0xdb, (byte)0xbf, (byte)0xef,
+ (byte)0xfb, (byte)0xdb, (byte)0xdf, (byte)0xef, (byte)0xf7, (byte)0xdb, (byte)0xef, (byte)0xef,
+ (byte)0xfb, (byte)0xdb, (byte)0xdf, (byte)0xef, (byte)0xfd, (byte)0xdb, (byte)0xbf, (byte)0x83,
+ (byte)0xce, (byte)0xdb, (byte)0x73, (byte)0xff, (byte)0xb7, (byte)0x5a, (byte)0xed, (byte)0xff,
+ (byte)0xbb, (byte)0xdb, (byte)0xdd, (byte)0xc7, (byte)0xbd, (byte)0xdb, (byte)0xbd, (byte)0xbb,
+ (byte)0xbe, (byte)0xbd, (byte)0x7d, (byte)0xbb, (byte)0xbf, (byte)0x7e, (byte)0xfd, (byte)0xb3,
+ (byte)0xbe, (byte)0xe7, (byte)0x7d, (byte)0xbf, (byte)0xbd, (byte)0xdb, (byte)0xbd, (byte)0xbf,
+ (byte)0xbb, (byte)0xbd, (byte)0xdd, (byte)0xbb, (byte)0xb7, (byte)0x7e, (byte)0xed, (byte)0xc7,
+ (byte)0xce, (byte)0xdb, (byte)0x73, (byte)0xff, (byte)0xfd, (byte)0xdb, (byte)0xbf, (byte)0xff,
+ (byte)0xfb, (byte)0xdb, (byte)0xdf, (byte)0x87, (byte)0xf7, (byte)0xdb, (byte)0xef, (byte)0xfb,
+ (byte)0xf7, (byte)0xdb, (byte)0xef, (byte)0xfb, (byte)0xfb, (byte)0xdb, (byte)0xdf, (byte)0xfb,
+ (byte)0xfd, (byte)0xdb, (byte)0xbf, (byte)0xc7, (byte)0xfe, (byte)0xdb, (byte)0x7f, (byte)0xbf,
+ (byte)0xff, (byte)0x5a, (byte)0xff, (byte)0xbf, (byte)0xff, (byte)0xbd, (byte)0xff, (byte)0xc3,
+ (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff
+ };
+
+ private float cube_vertexes[][][] =
+ {
+ {
+ {-1.0f, -1.0f, -1.0f, 1.0f},
+ {-1.0f, -1.0f, 1.0f, 1.0f},
+ {-1.0f, 1.0f, 1.0f, 1.0f},
+ {-1.0f, 1.0f, -1.0f, 1.0f}
+ },
+ {
+ {1.0f, 1.0f, 1.0f, 1.0f},
+ {1.0f, -1.0f, 1.0f, 1.0f},
+ {1.0f, -1.0f, -1.0f, 1.0f},
+ {1.0f, 1.0f, -1.0f, 1.0f}
+ },
+ {
+ {-1.0f, -1.0f, -1.0f, 1.0f},
+ {1.0f, -1.0f, -1.0f, 1.0f},
+ {1.0f, -1.0f, 1.0f, 1.0f},
+ {-1.0f, -1.0f, 1.0f, 1.0f}
+ },
+ {
+ {1.0f, 1.0f, 1.0f, 1.0f},
+ {1.0f, 1.0f, -1.0f, 1.0f},
+ {-1.0f, 1.0f, -1.0f, 1.0f},
+ {-1.0f, 1.0f, 1.0f, 1.0f}
+ },
+ {
+ {-1.0f, -1.0f, -1.0f, 1.0f},
+ {-1.0f, 1.0f, -1.0f, 1.0f},
+ {1.0f, 1.0f, -1.0f, 1.0f},
+ {1.0f, -1.0f, -1.0f, 1.0f}
+ },
+ {
+ {1.0f, 1.0f, 1.0f, 1.0f},
+ {-1.0f, 1.0f, 1.0f, 1.0f},
+ {-1.0f, -1.0f, 1.0f, 1.0f},
+ {1.0f, -1.0f, 1.0f, 1.0f}
+ }
+ };
+
+ private float cube_normals[][] =
+ {
+ {-1.0f, 0.0f, 0.0f, 0.0f},
+ {1.0f, 0.0f, 0.0f, 0.0f},
+ {0.0f, -1.0f, 0.0f, 0.0f},
+ {0.0f, 1.0f, 0.0f, 0.0f},
+ {0.0f, 0.0f, -1.0f, 0.0f},
+ {0.0f, 0.0f, 1.0f, 0.0f}
+ };
+
+ private boolean useLighting = true;
+ private boolean useFog = false;
+ private boolean useLogo = false;
+ private boolean useQuads = true;
+ private int tick = -1;
+
+ public scubeCanvas(int w, int h)
+ {
+ super(w, h);
+ GLContext.gljNativeDebug = false;
+ GLContext.gljClassDebug = false;
+ setAnimateFps(30.0);
+ }
+
+ public void preInit()
+ {
+ doubleBuffer = true;
+ stereoView = false;
+ }
+
+ public void init()
+ {
+ System.out.println("init(): " + this);
+ reshape(getSize().width, getSize().height);
+
+ /* setup context */
+ gl.glMatrixMode(GL_PROJECTION);
+ gl.glLoadIdentity();
+ gl.glFrustum(-1.0f, 1.0f, -1.0f, 1.0f, 1.0f, 3.0f);
+
+ gl.glMatrixMode(GL_MODELVIEW);
+ gl.glLoadIdentity();
+ gl.glTranslatef(0.0f, 0.0f, -2.0f);
+
+ gl.glEnable(GL_DEPTH_TEST);
+
+ if (useLighting) gl.glEnable(GL_LIGHTING);
+ gl.glEnable(GL_LIGHT0);
+ gl.glLightfv(GL_LIGHT0, GL_POSITION, lightPos);
+ gl.glLightfv(GL_LIGHT0, GL_AMBIENT, lightAmb);
+ gl.glLightfv(GL_LIGHT0, GL_DIFFUSE, lightDiff);
+ gl.glLightfv(GL_LIGHT0, GL_SPECULAR, lightSpec);
+
+ gl.glEnable(GL_NORMALIZE);
+
+ if (useFog) gl.glEnable(GL_FOG);
+ gl.glFogfv(GL_FOG_COLOR, fogColor);
+ gl.glFogfv(GL_FOG_INDEX, fogIndex);
+ gl.glFogf(GL_FOG_MODE, GL_EXP);
+ gl.glFogf(GL_FOG_DENSITY, 0.5f);
+ gl.glFogf(GL_FOG_START, 1.0f);
+ gl.glFogf(GL_FOG_END, 3.0f);
+
+ gl.glEnable(GL_CULL_FACE);
+ gl.glCullFace(GL_BACK);
+
+ gl.glShadeModel(GL_SMOOTH);
+
+ gl.glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+ if (useLogo)
+ gl.glPolygonStipple(sgiPattern);
+ else
+ gl.glPolygonStipple(shadowPattern);
+
+ gl.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
+ gl.glClearIndex(0);
+ gl.glClearDepth(1);
+
+ glj.gljCheckGL();
+
+ addKeyListener(this);
+ addMouseListener(this);
+ }
+
+ public void doCleanup()
+ {
+ System.out.println("destroy(): " + this);
+ removeKeyListener(this);
+ }
+
+ public void reshape(int width, int height)
+ {
+ gl.glViewport(0,0,width,height);
+
+// Put any custom reshape code here.
+
+ }
+
+ public void display()
+ {
+ if (glj.gljMakeCurrent() == false) return;
+
+ if (!isSuspended()) inctick();
+
+ float cubeXform[] = new float[16];
+
+ gl.glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+ gl.glPushMatrix();
+ gl.glTranslatef(0.0f, -1.5f, 0.0f);
+ gl.glRotatef(-90.0f, 1f, 0f, 0f);
+ gl.glScalef(2.0f, 2.0f, 2.0f);
+
+ drawCheck(6, 6, BLUE, YELLOW); /* draw ground */
+ gl.glPopMatrix();
+
+ gl.glPushMatrix();
+ gl.glTranslatef(0.0f, 0.0f, -0.9f);
+ gl.glScalef(2.0f, 2.0f, 2.0f);
+
+ drawCheck(6, 6, BLUE, YELLOW); /* draw back */
+ gl.glPopMatrix();
+
+ gl.glPushMatrix();
+ gl.glTranslatef(0.0f, 0.2f, 0.0f);
+ gl.glScalef(0.3f, 0.3f, 0.3f);
+ gl.glRotatef((360.0f / (30 * 1)) * tick, 1f, 0f, 0f);
+ gl.glRotatef((360.0f / (30 * 2)) * tick, 0f, 1f, 0f);
+ gl.glRotatef((360.0f / (30 * 4)) * tick, 0f, 0f, 1f);
+ gl.glScalef(1.0f, 2.0f, 1.0f);
+ gl.glGetFloatv(GL_MODELVIEW_MATRIX, cubeXform);
+
+ drawCube(RED); /* draw cube */
+ gl.glPopMatrix();
+
+ gl.glDepthMask(false);
+ gl.glEnable(GL_POLYGON_STIPPLE);
+ if (useFog) gl.glDisable(GL_FOG);
+ gl.glPushMatrix();
+ myShadowMatrix(groundPlane, lightPos);
+ gl.glTranslatef(0.0f, 0.0f, 2.0f);
+ gl.glMultMatrixf(cubeXform);
+
+ drawCube(BLACK); /* draw ground shadow */
+ gl.glPopMatrix();
+
+ gl.glPushMatrix();
+ myShadowMatrix(backPlane, lightPos);
+ gl.glTranslatef(0.0f, 0.0f, 2.0f);
+ gl.glMultMatrixf(cubeXform);
+
+ drawCube(BLACK); /* draw back shadow */
+ gl.glPopMatrix();
+
+ gl.glDepthMask(true);
+ gl.glDisable(GL_POLYGON_STIPPLE);
+ if (useFog) gl.glEnable(GL_FOG);
+
+ glj.gljSwap();
+ glj.gljCheckGL();
+ glj.gljFree();
+
+ //if (!isSuspended()) repaint(); // Animate at full speed.
+ }
+
+ // Methods required for the implementation of KeyListener
+ public void keyPressed(KeyEvent e)
+ {
+ }
+
+ public void keyReleased(KeyEvent e)
+ {
+ }
+
+ public void keyTyped(KeyEvent e)
+ {
+ if (glj.gljMakeCurrent() == false) return;
+ boolean dorepaint = false;
+ switch ((char)e.getKeyChar())
+ {
+ case 'L':
+ case 'l':
+ useLighting = !useLighting;
+ if (useLighting)
+ gl.glEnable(GL_LIGHTING);
+ else
+ gl.glDisable(GL_LIGHTING);
+ dorepaint = isSuspended();
+ break;
+ case 'S':
+ case 's':
+ useLogo = !useLogo;
+ if (useLogo)
+ gl.glPolygonStipple(sgiPattern);
+ else
+ gl.glPolygonStipple(shadowPattern);
+ dorepaint = isSuspended();
+ break;
+ case 'Q':
+ case 'q':
+ useQuads = !useQuads;
+ dorepaint = isSuspended();
+ break;
+ case 'F':
+ case 'f':
+ useFog = !useFog;
+ if (useFog)
+ gl.glEnable(GL_FOG);
+ else
+ gl.glDisable(GL_FOG);
+ dorepaint = isSuspended();
+ break;
+ case '1':
+ gl.glFogf(GL_FOG_MODE, GL_LINEAR);
+ dorepaint = isSuspended();
+ break;
+ case '2':
+ gl.glFogf(GL_FOG_MODE, GL_EXP);
+ dorepaint = isSuspended();
+ break;
+ case '3':
+ gl.glFogf(GL_FOG_MODE, GL_EXP2);
+ dorepaint = isSuspended();
+ break;
+ case 'P':
+ case 'p':
+ setSuspended(!isSuspended());
+ break;
+ case ' ':
+ if (isSuspended())
+ {
+ inctick();
+ dorepaint = true;
+ }
+ break;
+ }
+ glj.gljFree();
+ if (dorepaint) repaint();
+ }
+
+ private void inctick()
+ {
+ tick++;
+ if (tick >= 120) tick = 0;
+ }
+
+ private void setColor(int c)
+ {
+ if (useLighting)
+ gl.glMaterialfv
+ (GL_FRONT_AND_BACK,
+ GL_AMBIENT_AND_DIFFUSE,
+ materialColor[c]);
+ else
+ gl.glColor4fv(materialColor[c]);
+ }
+
+ private void drawCube(int color)
+ {
+ setColor(color);
+
+ for (int i = 0; i < 6; ++i)
+ {
+ gl.glNormal3fv(cube_normals[i]);
+ gl.glBegin(GL_POLYGON);
+ gl.glVertex4fv(cube_vertexes[i][0]);
+ gl.glVertex4fv(cube_vertexes[i][1]);
+ gl.glVertex4fv(cube_vertexes[i][2]);
+ gl.glVertex4fv(cube_vertexes[i][3]);
+ gl.glEnd();
+ }
+ }
+
+ private boolean check_initialized = false;
+ private boolean check_usedLighting = false;
+ private boolean check_usedQuads = false;
+ private int checklist = 0;
+
+ private void drawCheck(int w, int h, int evenColor, int oddColor)
+ {
+ if ( (!check_initialized)
+ || (check_usedLighting != useLighting)
+ || (check_usedQuads != useQuads) )
+ {
+ float square_normal[] = {0.0f, 0.0f, 1.0f, 0.0f};
+ float square[][] = new float[4][4];
+ int i, j;
+
+ if (checklist == 0) checklist = gl.glGenLists(1);
+ gl.glNewList(checklist, GL_COMPILE_AND_EXECUTE);
+ if (useQuads)
+ {
+ gl.glNormal3fv(square_normal);
+ gl.glBegin(GL_QUADS);
+ }
+ for (j = 0; j < h; ++j)
+ {
+ for (i = 0; i < w; ++i)
+ {
+ square[0][0] = -1.0f + 2.0f / w * i;
+ square[0][1] = -1.0f + 2.0f / h * (j + 1);
+ square[0][2] = 0.0f;
+ square[0][3] = 1.0f;
+
+ square[1][0] = -1.0f + 2.0f / w * i;
+ square[1][1] = -1.0f + 2.0f / h * j;
+ square[1][2] = 0.0f;
+ square[1][3] = 1.0f;
+
+ square[2][0] = -1.0f + 2.0f / w * (i + 1);
+ square[2][1] = -1.0f + 2.0f / h * j;
+ square[2][2] = 0.0f;
+ square[2][3] = 1.0f;
+
+ square[3][0] = -1.0f + 2.0f / w * (i + 1);
+ square[3][1] = -1.0f + 2.0f / h * (j + 1);
+ square[3][2] = 0.0f;
+ square[3][3] = 1.0f;
+
+ if ( ((i & 1) != 0) ^ ((j & 1) != 0) )
+ setColor(oddColor);
+ else
+ setColor(evenColor);
+
+ if (!useQuads)gl.glBegin(GL_POLYGON);
+ gl.glVertex4fv(square[0]);
+ gl.glVertex4fv(square[1]);
+ gl.glVertex4fv(square[2]);
+ gl.glVertex4fv(square[3]);
+ if (!useQuads) gl.glEnd();
+ }
+ }
+
+ if (useQuads) gl.glEnd();
+ gl.glEndList();
+
+ check_initialized = true;
+ check_usedLighting = useLighting;
+ check_usedQuads = useQuads;
+ }
+ else
+ gl.glCallList(checklist);
+ }
+
+ private void myShadowMatrix(float ground[], float light[])
+ {
+ float dot;
+ float shadowMat[] = new float[4*4];
+
+ dot =
+ ground[0] * light[0] +
+ ground[1] * light[1] +
+ ground[2] * light[2] +
+ ground[3] * light[3];
+
+ shadowMat[0] = dot - light[0] * ground[0];
+ shadowMat[4] = -light[0] * ground[1];
+ shadowMat[8] = -light[0] * ground[2];
+ shadowMat[12] = -light[0] * ground[3];
+
+ shadowMat[1] = -light[1] * ground[0];
+ shadowMat[5] = dot - light[1] * ground[1];
+ shadowMat[9] = -light[1] * ground[2];
+ shadowMat[13] = -light[1] * ground[3];
+
+ shadowMat[2] = -light[2] * ground[0];
+ shadowMat[6] = -light[2] * ground[1];
+ shadowMat[10] = dot - light[2] * ground[2];
+ shadowMat[14] = -light[2] * ground[3];
+
+ shadowMat[3] = -light[3] * ground[0];
+ shadowMat[7] = -light[3] * ground[1];
+ shadowMat[11] = -light[3] * ground[2];
+ shadowMat[15] = dot - light[3] * ground[3];
+
+ gl.glMultMatrixf(shadowMat);
+ }
+
+ // Methods required for the implementation of MouseListener
+ public void mouseEntered( MouseEvent evt )
+ {
+ Component comp = evt.getComponent();
+ if( comp.equals(this ) )
+ {
+ requestFocus();
+ }
+ }
+
+ public void mouseExited( MouseEvent evt )
+ { }
+ public void mousePressed( MouseEvent evt )
+ { }
+ public void mouseReleased( MouseEvent evt )
+ { }
+ public void mouseClicked( MouseEvent evt )
+ {
+ Component comp = evt.getComponent();
+ if( comp.equals(this ) )
+ {
+ requestFocus();
+ }
+ }
+ }
+}
diff --git a/demos/RonsDemos/scube_plugin13.html b/demos/RonsDemos/scube_plugin13.html new file mode 100644 index 0000000..660f48f --- /dev/null +++ b/demos/RonsDemos/scube_plugin13.html @@ -0,0 +1,58 @@ +<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.61 [en] (Win98; U) [Netscape]">
+ <title>Scube by David G Yu/Mark J. Kilgard/Silicon Graphics; ported to Java by Ron Cemer</title>
+</head>
+<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#e6e6ff">
+Scube applet
+<br>Originially written by David G Yu/Mark J. Kilgard/Silicon Graphics
+<br>Ported to Java by Ron Cemer
+<br>Click inside the window, then press any of the following keys:
+<br>L/l: toggle lighting
+<br>S/s: toggle SGI logo on/off
+<br>Q/q: toggle between quads and polygons for drawing
+<br>F/f: toggle fog
+<br>1: linear fog mode
+<br>2: exponential fog mode
+<br>3: exponential squared fog mode
+<br>p/P: toggle motion (pause/resume)
+<br>spacebar: single-step while paused
+<br>
+<!--"CONVERTED_APPLET"-->
+<!-- CONVERTER VERSION 1.3 --> +<SCRIPT LANGUAGE="JavaScript"><!-- + var _info = navigator.userAgent; var _ns = false; + var _ie = (_info.indexOf("MSIE") > 0 && _info.indexOf("Win") > 0 && _info.indexOf("Windows 3.1") < 0); +//--></SCRIPT> +<COMMENT><SCRIPT LANGUAGE="JavaScript1.1"><!-- + var _ns = (navigator.appName.indexOf("Netscape") >= 0 && ((_info.indexOf("Win") > 0 && _info.indexOf("Win16") < 0 && java.lang.System.getProperty("os.version").indexOf("3.5") < 0) || (_info.indexOf("Sun") > 0) || (_info.indexOf("Linux") > 0))); +//--></SCRIPT></COMMENT> + +<SCRIPT LANGUAGE="JavaScript"><!-- + if (_ie == true) document.writeln('<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" WIDTH = 400 HEIGHT = 400 codebase="http://java.sun.com/products/plugin/1.3/jinstall-13-win32.cab#Version=1,3,0,0"><NOEMBED><XMP>'); + else if (_ns == true) document.writeln('<EMBED type="application/x-java-applet;version=1.3" CODE = "scube.class" WIDTH = 400 HEIGHT = 400 scriptable=false pluginspage="http://java.sun.com/products/plugin/1.3/plugin-install.html"><NOEMBED><XMP>'); +//--></SCRIPT> +<APPLET CODE = "scube.class" WIDTH = 400 HEIGHT = 400></XMP> +<PARAM NAME = CODE VALUE = "scube.class" >
+ +<PARAM NAME="type" VALUE="application/x-java-applet;version=1.3"> +<PARAM NAME="scriptable" VALUE="false"> + +</APPLET> + +</NOEMBED></EMBED></OBJECT> + + +<!-- +<APPLET CODE = "scube.class" WIDTH = 400 HEIGHT = 400>
+
+
+</APPLET> +--> +<!--"END_CONVERTED_APPLET"-->
+
+<hr>
+</body>
+</html>
diff --git a/demos/RonsDemos/shadowvol.html b/demos/RonsDemos/shadowvol.html new file mode 100644 index 0000000..e709826 --- /dev/null +++ b/demos/RonsDemos/shadowvol.html @@ -0,0 +1,18 @@ +<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.61 [en] (Win98; U) [Netscape]">
+ <title>Shadowvol by Tom McReynolds, SGI; ported to Java by Ron Cemer</title>
+</head>
+<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#e6e6ff">
+Shadowvol applet
+<br>Originially written by Tom McReynolds, SGI
+<br>Ported to Java by Ron Cemer
+<br>Click inside the window to cycle the shadow and lighting mode.
+<br>
+<applet code="shadowvol.class" width=400 height=400>
+</applet>
+<hr>
+</body>
+</html>
diff --git a/demos/RonsDemos/shadowvol.java b/demos/RonsDemos/shadowvol.java new file mode 100644 index 0000000..f40f20b --- /dev/null +++ b/demos/RonsDemos/shadowvol.java @@ -0,0 +1,458 @@ +/**
+ * @(#) shadowvol.java
+ * @(#) author: Tom McReynolds, SGI (converted to Java by Ron Cemer)
+ */
+
+/* Shadows: Shadow maps */
+/* Demonstrate shadow volumes */
+
+import java.applet.*;
+import java.awt.*;
+import java.awt.event.*;
+import java.lang.*;
+import java.util.*;
+import java.io.*;
+import java.util.*;
+import gl4java.GLContext;
+import gl4java.awt.GLCanvas;
+
+public class shadowvol extends Applet
+{
+ private static final int SPHERE = 1, CONE = 2, LIGHT = 3, SHADOWVOL = 4;
+ private static final int X = 0, Y = 1, Z = 2;
+ private static final int NONE = 0, NOLIGHT = 1, VOLUME = 2, SHADOW = 3;
+ private static final int TEXDIM = 256;
+
+ shadowvolCanvas canvas = null;
+
+
+ /* Initialize the applet */
+
+
+ public void init()
+ {
+ Dimension d = getSize();
+ setLayout(new BorderLayout());
+ canvas = new shadowvolCanvas(d.width, d.height);
+ add("Center", canvas);
+ }
+
+
+ /* Start the applet */
+
+
+ public void start()
+ {
+ }
+
+
+ /* Stop the applet */
+
+
+ public void stop()
+ {
+ }
+
+
+ /* Destroy the applet */
+
+
+ public void destroy()
+ {
+ canvas.cvsDispose();
+ }
+
+ private class ShadObj
+ {
+ float[] vertices;
+ float[] normal;
+ int n;
+ }
+
+
+ /* Local GLCanvas extension class */
+
+
+ private class shadowvolCanvas extends GLCanvas implements MouseListener
+ {
+ private float shadVerts[] =
+ {
+ 30.0f, 30.0f, -350.0f,
+ 60.0f, 20.0f, -340.0f,
+ 40.0f, 40.0f, -400.0f
+ };
+ private float shadNormal[] =
+ {
+ 1.0f, 10.f, 1.0f
+ };
+ private float leftwallshadow[] = new float[16];
+ private float floorshadow[] = new float[16];
+ private float lightpos[] = { 50.0f, 50.0f, -340.0f, 1.0f };
+ private ShadObj shadower = new ShadObj();
+ private int rendermode = SHADOW;
+
+ public shadowvolCanvas(int w, int h)
+ {
+ super(w, h);
+ GLContext.gljNativeDebug = false;
+ GLContext.gljClassDebug = false;
+ }
+
+ public void preInit()
+ {
+ doubleBuffer = true;
+ stereoView = false;
+ stencilBits = 3;
+ }
+
+ public void init()
+ {
+ System.out.println("init(): " + this);
+ reshape(getSize().width, getSize().height);
+
+ byte tex[];
+ int sphere, cone, base;
+ float sphere_mat[] = {1.0f, 0.5f, 0.0f, 1.0f};
+ float cone_mat[] = {0.0f, 0.5f, 1.0f, 1.0f};
+
+ /* turn on features */
+ gl.glEnable(GL_DEPTH_TEST);
+ gl.glEnable(GL_LIGHTING);
+ gl.glEnable(GL_LIGHT0);
+ gl.glEnable(GL_CULL_FACE);
+
+ /* place light 0 in the right place */
+ gl.glLightfv(GL_LIGHT0, GL_POSITION, lightpos);
+
+ /* remove back faces to speed things up */
+ gl.glCullFace(GL_BACK);
+
+ gl.glTexParameteri
+ (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+
+ /* make display lists for sphere and cone; for efficiency */
+
+ gl.glNewList(SPHERE, GL_COMPILE);
+ sphere = glu.gluNewQuadric();
+ gl.glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, sphere_mat);
+ glu.gluSphere(sphere, 20.0f, 20, 20);
+ glu.gluDeleteQuadric(sphere);
+ gl.glEndList();
+
+ gl.glNewList(CONE, GL_COMPILE);
+ cone = glu.gluNewQuadric();
+ base = glu.gluNewQuadric();
+ gl.glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, cone_mat);
+ gl.glRotatef(-90.0f, 1.0f, 0.0f, 0.0f);
+ glu.gluDisk(base, 0., 20., 20, 1);
+ glu.gluCylinder(cone, 20., 0., 60., 20, 20);
+ glu.gluDeleteQuadric(cone);
+ glu.gluDeleteQuadric(base);
+ gl.glEndList();
+
+ gl.glNewList(LIGHT, GL_COMPILE);
+ sphere = glu.gluNewQuadric();
+ gl.glPushMatrix();
+ gl.glTranslatef(lightpos[X], lightpos[Y], lightpos[Z]);
+ gl.glDisable(GL_LIGHTING);
+ gl.glColor3f(0.9f, 0.9f, 0.6f);
+ glu.gluSphere(sphere, 5.0f, 20, 20);
+ gl.glEnable(GL_LIGHTING);
+ gl.glPopMatrix();
+ glu.gluDeleteQuadric(sphere);
+ gl.glEndList();
+
+ /* load pattern for current 2d texture */
+ tex = make_texture(TEXDIM, TEXDIM);
+ gl.glTexImage2D
+ (GL_TEXTURE_2D,
+ 0,
+ 1,
+ TEXDIM,
+ TEXDIM,
+ 0,
+ GL_RED,
+ GL_UNSIGNED_BYTE,
+ tex);
+ tex = null;
+
+ shadower.vertices = shadVerts;
+ shadower.normal = shadNormal;
+ shadower.n = shadVerts.length/3;
+
+ makeShadowVolume(shadower, lightpos, 10.f, SHADOWVOL);
+
+ glj.gljCheckGL();
+
+ addMouseListener(this);
+ }
+
+ public void cvsDispose()
+ {
+ System.out.println("destroy(): " + this);
+ removeMouseListener(this);
+ super.cvsDispose();
+ }
+
+ public void reshape(int width, int height)
+ {
+ gl.glViewport(0,0,width,height);
+ /* draw a perspective scene */
+ gl.glMatrixMode(GL_PROJECTION);
+ gl.glFrustum(-100.0f, 100.0f, -100.0f, 100.0f, 320.0f, 640.0f);
+ gl.glMatrixMode(GL_MODELVIEW);
+ }
+
+ public void display()
+ {
+ if (glj.gljMakeCurrent() == false) return;
+
+
+
+
+ gl.glClear
+ (GL_COLOR_BUFFER_BIT |
+ GL_DEPTH_BUFFER_BIT |
+ GL_STENCIL_BUFFER_BIT);
+ switch (rendermode)
+ {
+ case NONE:
+ render(shadower);
+ break;
+ case NOLIGHT:
+ gl.glDisable(GL_LIGHT0);
+ render(shadower);
+ gl.glEnable(GL_LIGHT0);
+ break;
+ case VOLUME:
+ render(shadower);
+ gl.glCallList(SHADOWVOL);
+ break;
+ case SHADOW:
+ gl.glColorMask(false, false, false, false);
+ render(shadower); /* render scene in depth buffer */
+ gl.glEnable(GL_STENCIL_TEST);
+ gl.glDepthMask(false);
+ gl.glStencilFunc(GL_ALWAYS, 0, 0);
+ gl.glStencilOp(GL_KEEP, GL_KEEP, GL_INCR);
+ gl.glCullFace(GL_BACK); /* increment using front face of shadow volume */
+ gl.glCallList(SHADOWVOL);
+ gl.glStencilOp(GL_KEEP, GL_KEEP, GL_DECR);
+ gl.glCullFace(GL_FRONT); /* increment using front face of shadow volume */
+ gl.glCallList(SHADOWVOL);
+ gl.glDepthMask(true);
+ gl.glColorMask(true, true, true, true);
+ gl.glCullFace(GL_BACK);
+ gl.glDepthFunc(GL_LEQUAL);
+ gl.glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP);
+ gl.glStencilFunc(GL_EQUAL, 1, 1); /* draw shadowed part */
+ gl.glDisable(GL_LIGHT0);
+ render(shadower);
+ gl.glStencilFunc(GL_EQUAL, 0, 1); /* draw lit part */
+ gl.glEnable(GL_LIGHT0);
+ render(shadower);
+ gl.glDepthFunc(GL_LESS);
+ gl.glDisable(GL_STENCIL_TEST);
+ break;
+ }
+
+ glj.gljSwap();
+ glj.gljCheckGL();
+ glj.gljFree();
+ }
+
+ // Methods required for the implementation of MouseListener
+ public void mouseEntered( MouseEvent evt )
+ {
+ }
+
+ public void mouseExited( MouseEvent evt )
+ {
+ }
+
+ public void mousePressed( MouseEvent evt )
+ {
+ rendermode++;
+ if (rendermode > SHADOW) rendermode = NONE;
+ repaint();
+ }
+
+ public void mouseReleased( MouseEvent evt )
+ {
+ }
+
+ public void mouseClicked( MouseEvent evt )
+ {
+ }
+
+ private byte[] make_texture(int maxs, int maxt)
+ {
+ byte texture[] = new byte[maxs*maxt];
+ for (int t = 0; t < maxt; t++)
+ {
+ for (int s = 0; s < maxs; s++)
+ {
+ texture[s + maxs * t] =
+ ( (((s >> 4) & 0x1) != 0) ^ (((t >> 4) & 0x1) != 0) ) ?
+ (byte)0xff :
+ (byte)0;
+ }
+ }
+ return texture;
+ }
+
+ /* simple way to extend a point to build shadow volume */
+ private void extend(float newvertex[], float light[], float vertex[], float t)
+ {
+ float delta[] = new float[3];
+
+ delta[X] = vertex[X] - light[X];
+ delta[Y] = vertex[Y] - light[Y];
+ delta[Z] = vertex[Z] - light[Z];
+
+ newvertex[X] = light[X] + delta[X] * t;
+ newvertex[Y] = light[Y] + delta[Y] * t;
+ newvertex[Z] = light[Z] + delta[Z] * t;
+ }
+
+ /* Create a shadow volume in a display list */
+ /* XXX light should have 4 compoents */
+ void makeShadowVolume(ShadObj shadower, float light[], float t, int dlist)
+ {
+ float v[] = new float[3], newv[] = new float[3];
+ int j;
+
+ gl.glNewList(dlist, GL_COMPILE);
+ gl.glDisable(GL_LIGHTING);
+ gl.glBegin(GL_QUADS);
+ /* for debugging */
+ gl.glColor3f(0.2f, 0.8f, 0.4f);
+ for (int i = 0; i < shadower.n; i++)
+ {
+ j = ((i + 1) % shadower.n);
+ v[0] = shadower.vertices[i * 3];
+ v[1] = shadower.vertices[(i * 3) + 1];
+ v[2] = shadower.vertices[(i * 3) + 2];
+ gl.glVertex3fv(v);
+ extend(newv, light, v, t);
+ gl.glVertex3fv(newv);
+ v[0] = shadower.vertices[j * 3];
+ v[1] = shadower.vertices[(j * 3) + 1];
+ v[2] = shadower.vertices[(j * 3) + 2];
+ extend(newv, light, v, t);
+ gl.glVertex3fv(newv);
+ gl.glVertex3fv(v);
+ }
+ gl.glEnd();
+ gl.glEnable(GL_LIGHTING);
+ gl.glEndList();
+ }
+
+ private void sphere()
+ {
+ gl.glPushMatrix();
+ gl.glTranslatef(60.0f, -50.0f, -360.0f);
+ gl.glCallList(SPHERE);
+ gl.glPopMatrix();
+ }
+
+ private void cone()
+ {
+ gl.glPushMatrix();
+ gl.glTranslatef(-40.0f, -40.0f, -400.0f);
+ gl.glCallList(CONE);
+ gl.glPopMatrix();
+ }
+
+ /* render while jittering the shadows */
+ private void render(ShadObj obj)
+ {
+ float shad_mat[] = {10.f, 0.1f, 0.1f, 1.0f};
+ float v[] = new float[3];
+ /* material properties for objects in scene */
+ float wall_mat[] = {1.0f, 1.0f, 1.0f, 1.0f};
+ /* Note: wall vertices are ordered so they are all
+ front facing this lets me do back face culling to
+ speed things up. */
+
+ gl.glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, wall_mat);
+
+ /* floor */
+ /* make the floor textured */
+ gl.glEnable(GL_TEXTURE_2D);
+
+ /* Since we want to turn texturing on for floor only, we have
+ to make floor a separate glBegin()/glEnd() sequence. You
+ can't turn texturing on and off between begin and end calls */
+ gl.glBegin(GL_QUADS);
+ gl.glNormal3f(0.0f, 1.0f, 0.0f);
+ gl.glTexCoord2i(0, 0);
+ gl.glVertex3f(-100.0f, -100.0f, -320.0f);
+ gl.glTexCoord2i(1, 0);
+ gl.glVertex3f(100.0f, -100.0f, -320.0f);
+ gl.glTexCoord2i(1, 1);
+ gl.glVertex3f(100.0f, -100.0f, -520.0f);
+ gl.glTexCoord2i(0, 1);
+ gl.glVertex3f(-100.0f, -100.0f, -520.0f);
+ gl.glEnd();
+
+ gl.glDisable(GL_TEXTURE_2D);
+
+ /* walls */
+
+ gl.glBegin(GL_QUADS);
+ /* left wall */
+ gl.glNormal3f(1.0f, 0.0f, 0.0f);
+ gl.glVertex3f(-100.0f, -100.0f, -320.0f);
+ gl.glVertex3f(-100.0f, -100.0f, -520.0f);
+ gl.glVertex3f(-100.0f, 100.0f, -520.0f);
+ gl.glVertex3f(-100.0f, 100.0f, -320.0f);
+
+ /* right wall */
+ gl.glNormal3f(-1.0f, 0.0f, 0.0f);
+ gl.glVertex3f(100.0f, -100.0f, -320.0f);
+ gl.glVertex3f(100.0f, 100.0f, -320.0f);
+ gl.glVertex3f(100.0f, 100.0f, -520.0f);
+ gl.glVertex3f(100.0f, -100.0f, -520.0f);
+
+ /* ceiling */
+ gl.glNormal3f(0.0f, -1.0f, 0.0f);
+ gl.glVertex3f(-100.0f, 100.0f, -320.0f);
+ gl.glVertex3f(-100.0f, 100.0f, -520.0f);
+ gl.glVertex3f(100.0f, 100.0f, -520.0f);
+ gl.glVertex3f(100.0f, 100.0f, -320.0f);
+
+ /* back wall */
+ gl.glNormal3f(0.0f, 0.0f, 1.0f);
+ gl.glVertex3f(-100.0f, -100.0f, -520.0f);
+ gl.glVertex3f(100.0f, -100.0f, -520.0f);
+ gl.glVertex3f(100.0f, 100.0f, -520.0f);
+ gl.glVertex3f(-100.0f, 100.0f, -520.0f);
+
+ gl.glEnd();
+
+ cone();
+
+ sphere();
+
+ gl.glCallList(LIGHT);
+
+ /* draw shadowing object */
+ gl.glMaterialfv
+ (GL_FRONT_AND_BACK,
+ GL_AMBIENT_AND_DIFFUSE,
+ shad_mat);
+ gl.glBegin(GL_POLYGON);
+ gl.glNormal3fv(obj.normal);
+ for (int i = 0; i < obj.n; i++)
+ {
+ int j = i * 3;
+ v[0] = obj.vertices[j];
+ v[1] = obj.vertices[j+1];
+ v[2] = obj.vertices[j+2];
+ gl.glVertex3fv(v);
+ }
+ gl.glEnd();
+ }
+ }
+}
diff --git a/demos/RonsDemos/shadowvol_plugin13.html b/demos/RonsDemos/shadowvol_plugin13.html new file mode 100644 index 0000000..ed62530 --- /dev/null +++ b/demos/RonsDemos/shadowvol_plugin13.html @@ -0,0 +1,49 @@ +<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.61 [en] (Win98; U) [Netscape]">
+ <title>Shadowvol by Tom McReynolds, SGI; ported to Java by Ron Cemer</title>
+</head>
+<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#e6e6ff">
+Shadowvol applet
+<br>Originially written by Tom McReynolds, SGI
+<br>Ported to Java by Ron Cemer
+<br>Click inside the window to cycle the shadow and lighting mode.
+<br>
+<!--"CONVERTED_APPLET"-->
+<!-- CONVERTER VERSION 1.3 --> +<SCRIPT LANGUAGE="JavaScript"><!-- + var _info = navigator.userAgent; var _ns = false; + var _ie = (_info.indexOf("MSIE") > 0 && _info.indexOf("Win") > 0 && _info.indexOf("Windows 3.1") < 0); +//--></SCRIPT> +<COMMENT><SCRIPT LANGUAGE="JavaScript1.1"><!-- + var _ns = (navigator.appName.indexOf("Netscape") >= 0 && ((_info.indexOf("Win") > 0 && _info.indexOf("Win16") < 0 && java.lang.System.getProperty("os.version").indexOf("3.5") < 0) || (_info.indexOf("Sun") > 0) || (_info.indexOf("Linux") > 0))); +//--></SCRIPT></COMMENT> + +<SCRIPT LANGUAGE="JavaScript"><!-- + if (_ie == true) document.writeln('<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" WIDTH = 400 HEIGHT = 400 codebase="http://java.sun.com/products/plugin/1.3/jinstall-13-win32.cab#Version=1,3,0,0"><NOEMBED><XMP>'); + else if (_ns == true) document.writeln('<EMBED type="application/x-java-applet;version=1.3" CODE = "shadowvol.class" WIDTH = 400 HEIGHT = 400 scriptable=false pluginspage="http://java.sun.com/products/plugin/1.3/plugin-install.html"><NOEMBED><XMP>'); +//--></SCRIPT> +<APPLET CODE = "shadowvol.class" WIDTH = 400 HEIGHT = 400></XMP> +<PARAM NAME = CODE VALUE = "shadowvol.class" >
+ +<PARAM NAME="type" VALUE="application/x-java-applet;version=1.3"> +<PARAM NAME="scriptable" VALUE="false"> + +</APPLET> + +</NOEMBED></EMBED></OBJECT> + + +<!-- +<APPLET CODE = "shadowvol.class" WIDTH = 400 HEIGHT = 400>
+
+
+</APPLET> +--> +<!--"END_CONVERTED_APPLET"-->
+
+<hr>
+</body>
+</html>
diff --git a/demos/RonsDemos/softshadow.html b/demos/RonsDemos/softshadow.html new file mode 100644 index 0000000..be13230 --- /dev/null +++ b/demos/RonsDemos/softshadow.html @@ -0,0 +1,19 @@ +<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.61 [en] (Win98; U) [Netscape]">
+ <title>Softshadow by Tom McReynolds, SGI; ported to Java by Ron Cemer</title>
+</head>
+<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#e6e6ff">
+Softshadow applet
+<br>Originially written by Tom McReynolds, SGI
+<br>Ported to Java by Ron Cemer
+<br>Click inside the window to enable/disable shadows.
+<br>NOTE: WHEN SHADOWS ARE ENABLED, IT MAY TAKE A FEW SECONDS TO DRAW THE SCENE.
+<br>
+<applet code="softshadow.class" width=400 height=400>
+</applet>
+<hr>
+</body>
+</html>
diff --git a/demos/RonsDemos/softshadow.java b/demos/RonsDemos/softshadow.java new file mode 100644 index 0000000..0d9e8ef --- /dev/null +++ b/demos/RonsDemos/softshadow.java @@ -0,0 +1,528 @@ +/**
+ * @(#) softshadow.java
+ * @(#) author: Tom McReynolds, SGI (converted to Java by Ron Cemer)
+ */
+
+/* Using the accumulation buffer for soft shadows. */
+/* Demonstrate the use of accumulation buffer to create soft shadows */
+
+import java.applet.*;
+import java.awt.*;
+import java.awt.event.*;
+import java.lang.*;
+import java.util.*;
+import java.io.*;
+import java.util.*;
+import gl4java.GLContext;
+import gl4java.awt.GLCanvas;
+
+public class softshadow extends Applet
+{
+ private static final int SPHERE=1, CONE=2, LIGHT=3, LEFTWALL=4, FLOOR=5;
+ private static final int X = 0, Y = 1, Z = 2;
+ private static final int A = 0, B = 1, C = 2, D = 3;
+ private static final int NONE = 0, SHADOW = 1;
+ private static final int TEXDIM = 256;
+
+ softshadowCanvas canvas = null;
+
+
+ /* Initialize the applet */
+
+
+ public void init()
+ {
+ Dimension d = getSize();
+ setLayout(new BorderLayout());
+ canvas = new softshadowCanvas(d.width, d.height);
+ add("Center", canvas);
+ }
+
+
+ /* Start the applet */
+
+
+ public void start()
+ {
+ }
+
+
+ /* Stop the applet */
+
+
+ public void stop()
+ {
+ }
+
+
+ /* Destroy the applet */
+
+
+ private class ShadObj
+ {
+ float[] vertices;
+ float[] normal;
+ int n;
+ }
+
+
+ /* Local GLCanvas extension class */
+
+
+ private class softshadowCanvas extends GLCanvas implements MouseListener
+ {
+ private float leftwallshadow[] = new float[16];
+ private float floorshadow[] = new float[16];
+ private float lightpos[] = { 50.0f, 50.0f, -320.0f, 1.0f };
+ private int rendermode = SHADOW;
+
+ public softshadowCanvas(int w, int h)
+ {
+ super(w, h);
+ GLContext.gljNativeDebug = false;
+ GLContext.gljClassDebug = false;
+ }
+
+ public void preInit()
+ {
+ doubleBuffer = true;
+ stereoView = false;
+ stencilBits = 3;
+ accumSize = 8;
+ }
+
+ public void init()
+ {
+ System.out.println("init(): " + this);
+ reshape(getSize().width, getSize().height);
+
+ /* turn on features */
+ gl.glEnable(GL_DEPTH_TEST);
+ gl.glEnable(GL_LIGHTING);
+ gl.glEnable(GL_LIGHT0);
+
+ /* make shadow matricies */
+
+ float v0[] = new float[3];
+ float v1[] = new float[3];
+ float v2[] = new float[3];
+
+ /* 3 points on floor */
+ v0[X] = -100.0f;
+ v0[Y] = -100.0f;
+ v0[Z] = -320.0f;
+ v1[X] = 100.0f;
+ v1[Y] = -100.0f;
+ v1[Z] = -320.0f;
+ v2[X] = 100.0f;
+ v2[Y] = -100.0f;
+ v2[Z] = -520.0f;
+
+ float plane[] = new float[4];
+ findplane(plane, v0, v1, v2);
+ shadowmatrix(floorshadow, plane, lightpos);
+
+ /* 3 points on left wall */
+ v0[X] = -100.0f;
+ v0[Y] = -100.0f;
+ v0[Z] = -320.0f;
+ v1[X] = -100.0f;
+ v1[Y] = -100.0f;
+ v1[Z] = -520.0f;
+ v2[X] = -100.0f;
+ v2[Y] = 100.0f;
+ v2[Z] = -520.0f;
+
+ findplane(plane, v0, v1, v2);
+ shadowmatrix(leftwallshadow, plane, lightpos);
+
+ /* place light 0 in the right place */
+ gl.glLightfv(GL_LIGHT0, GL_POSITION, lightpos);
+
+ /* remove back faces to speed things up */
+ gl.glCullFace(GL_BACK);
+
+ gl.glTexParameteri
+ (GL_TEXTURE_2D,
+ GL_TEXTURE_MIN_FILTER,
+ GL_NEAREST);
+
+ /* make display lists for sphere and cone; for efficiency */
+
+ int sphere, cone, base;
+
+ gl.glNewList(SPHERE, GL_COMPILE);
+ sphere = glu.gluNewQuadric();
+ glu.gluSphere(sphere, 20.f, 20, 20);
+ glu.gluDeleteQuadric(sphere);
+ gl.glEndList();
+
+ gl.glNewList(LIGHT, GL_COMPILE);
+ sphere = glu.gluNewQuadric();
+ glu.gluSphere(sphere, 5.f, 20, 20);
+ glu.gluDeleteQuadric(sphere);
+ gl.glEndList();
+
+ gl.glNewList(CONE, GL_COMPILE);
+ cone = glu.gluNewQuadric();
+ base = glu.gluNewQuadric();
+ gl.glRotatef(-90.f, 1.f, 0.f, 0.f);
+ glu.gluDisk(base, 0., 20., 20, 1);
+ glu.gluCylinder(cone, 20., 0., 60., 20, 20);
+ glu.gluDeleteQuadric(cone);
+ glu.gluDeleteQuadric(base);
+ gl.glEndList();
+
+ gl.glNewList(FLOOR, GL_COMPILE);
+ gl.glEndList();
+
+ gl.glNewList(LEFTWALL, GL_COMPILE);
+ gl.glEndList();
+
+ byte tex[] = make_texture(TEXDIM, TEXDIM);
+ gl.glTexImage2D
+ (GL_TEXTURE_2D,
+ 0,
+ 1,
+ TEXDIM,
+ TEXDIM,
+ 0,
+ GL_RED,
+ GL_UNSIGNED_BYTE,
+ tex);
+ tex = null;
+
+ glj.gljCheckGL();
+
+ addMouseListener(this);
+ }
+
+ public void cvsDispose()
+ {
+ System.out.println("destroy(): " + this);
+ removeMouseListener(this);
+ super.cvsDispose();
+ }
+
+ public void reshape(int width, int height)
+ {
+ gl.glViewport(0,0,width,height);
+ /* draw a perspective scene */
+ gl.glMatrixMode(GL_PROJECTION);
+ gl.glFrustum(-100.0f, 100.0f, -100.0f, 100.0f, 320.0f, 640.0f);
+ gl.glMatrixMode(GL_MODELVIEW);
+ }
+
+ public void display()
+ {
+ if (glj.gljMakeCurrent() == false) return;
+
+
+ int dx, dy, dz;
+
+ dy = 0;
+ /* jitter the light around */
+ if (rendermode == SHADOW)
+ {
+ gl.glClear(GL_ACCUM_BUFFER_BIT);
+ for (dz = -4; dz < 5; dz += 2)
+ {
+ for (dx = -4; dx < 5; dx += 2)
+ {
+ render((float)dx, (float)dy, (float)dz);
+ gl.glAccum(GL_ACCUM, 1.0f / 25.0f);
+ }
+ }
+ gl.glAccum(GL_RETURN, 1.0f);
+ }
+ else
+ render(0.0f, 0.0f, 0.0f);
+
+ glj.gljSwap();
+ glj.gljCheckGL();
+ glj.gljFree();
+ }
+
+ // Methods required for the implementation of MouseListener
+ public void mouseEntered( MouseEvent evt )
+ {
+ }
+
+ public void mouseExited( MouseEvent evt )
+ {
+ }
+
+ public void mousePressed( MouseEvent evt )
+ {
+ rendermode++;
+ if (rendermode > SHADOW) rendermode = NONE;
+ repaint();
+ }
+
+ public void mouseReleased( MouseEvent evt )
+ {
+ }
+
+ public void mouseClicked( MouseEvent evt )
+ {
+ }
+
+ private byte[] make_texture(int maxs, int maxt)
+ {
+ byte texture[] = new byte[maxs*maxt];
+ for (int t = 0; t < maxt; t++)
+ {
+ for (int s = 0; s < maxs; s++)
+ {
+ texture[s + maxs * t] =
+ ( (((s >> 4) & 0x1) != 0) ^ (((t >> 4) & 0x1) != 0) ) ?
+ (byte)0xff :
+ (byte)0;
+ }
+ }
+ return texture;
+ }
+
+ /* create a matrix that will project the desired shadow */
+ void shadowmatrix(float shadowMat[], float groundplane[], float lightpos[])
+ {
+ float dot;
+
+ /* find dot product between light position vector
+ and ground plane normal */
+ dot =
+ groundplane[0] * lightpos[0] +
+ groundplane[1] * lightpos[1] +
+ groundplane[2] * lightpos[2] +
+ groundplane[3] * lightpos[3];
+
+ shadowMat[0] = dot - lightpos[0] * groundplane[0];
+ shadowMat[4] = -lightpos[0] * groundplane[1];
+ shadowMat[8] = -lightpos[0] * groundplane[2];
+ shadowMat[12] = -lightpos[0] * groundplane[3];
+
+ shadowMat[1] = -lightpos[1] * groundplane[0];
+ shadowMat[5] = dot - lightpos[1] * groundplane[1];
+ shadowMat[9] = -lightpos[1] * groundplane[2];
+ shadowMat[13] = -lightpos[1] * groundplane[3];
+
+ shadowMat[2] = -lightpos[2] * groundplane[0];
+ shadowMat[6] = -lightpos[2] * groundplane[1];
+ shadowMat[10] = dot - lightpos[2] * groundplane[2];
+ shadowMat[14] = -lightpos[2] * groundplane[3];
+
+ shadowMat[3] = -lightpos[3] * groundplane[0];
+ shadowMat[7] = -lightpos[3] * groundplane[1];
+ shadowMat[11] = -lightpos[3] * groundplane[2];
+ shadowMat[15] = dot - lightpos[3] * groundplane[3];
+ }
+
+ /* find the plane equation given 3 points */
+ void findplane(float plane[], float v0[], float v1[], float v2[])
+ {
+ float vec0[] = new float[3], vec1[] = new float[3];
+
+ /* need 2 vectors to find cross product */
+ vec0[X] = v1[X] - v0[X];
+ vec0[Y] = v1[Y] - v0[Y];
+ vec0[Z] = v1[Z] - v0[Z];
+
+ vec1[X] = v2[X] - v0[X];
+ vec1[Y] = v2[Y] - v0[Y];
+ vec1[Z] = v2[Z] - v0[Z];
+
+ /* find cross product to get A, B, and C of plane equation */
+ plane[A] = vec0[Y] * vec1[Z] - vec0[Z] * vec1[Y];
+ plane[B] = -(vec0[X] * vec1[Z] - vec0[Z] * vec1[X]);
+ plane[C] = vec0[X] * vec1[Y] - vec0[Y] * vec1[X];
+ plane[D] = -(plane[A]*v0[X] + plane[B]*v0[Y] + plane[C]*v0[Z]);
+ }
+
+ private void sphere()
+ {
+ gl.glPushMatrix();
+ gl.glTranslatef(60.0f, -50.0f, -360.0f);
+ gl.glCallList(SPHERE);
+ gl.glPopMatrix();
+ }
+
+ private void cone()
+ {
+ gl.glPushMatrix();
+ gl.glTranslatef(-40.0f, -40.0f, -400.0f);
+ gl.glCallList(CONE);
+ gl.glPopMatrix();
+ }
+
+ /* render while jittering the shadows */
+ private void render(float dx, float dy, float dz)
+ {
+ float v[] = new float[3];
+ /* material properties for objects in scene */
+ float wall_mat[] = {1.0f, 1.0f, 1.0f, 1.0f};
+ float sphere_mat[] = {1.0f, 0.5f, 0.0f, 1.0f};
+ float cone_mat[] = {0.0f, 0.5f, 1.0f, 1.0f};
+
+ gl.glClear
+ (GL_DEPTH_BUFFER_BIT |
+ GL_COLOR_BUFFER_BIT |
+ GL_STENCIL_BUFFER_BIT);
+
+ /* Note: wall vertices are ordered so they are all
+ front facing this lets me do back face culling to
+ speed things up. */
+
+ gl.glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, wall_mat);
+
+ /* floor */
+ /* make the floor textured */
+ gl.glEnable(GL_TEXTURE_2D);
+
+ /* Since we want to turn texturing on for floor only, we have
+ to make floor a separate glBegin()/glEnd() sequence. You
+ can't turn texturing on and off between begin and end calls */
+ gl.glBegin(GL_QUADS);
+ gl.glNormal3f(0.0f, 1.0f, 0.0f);
+ gl.glTexCoord2i(0, 0);
+ gl.glVertex3f(-100.0f, -100.0f, -320.0f);
+ gl.glTexCoord2i(1, 0);
+ gl.glVertex3f(100.0f, -100.0f, -320.0f);
+ gl.glTexCoord2i(1, 1);
+ gl.glVertex3f(100.0f, -100.0f, -520.0f);
+ gl.glTexCoord2i(0, 1);
+ gl.glVertex3f(-100.0f, -100.0f, -520.0f);
+ gl.glEnd();
+
+ gl.glDisable(GL_TEXTURE_2D);
+
+
+
+ if (rendermode == SHADOW)
+ {
+ gl.glDisable(GL_DEPTH_TEST);
+ gl.glDisable(GL_LIGHTING);
+ gl.glColor3f(0.f, 0.f, 0.f); /* shadow color */
+
+ gl.glPushMatrix();
+ gl.glMultMatrixf(floorshadow);
+ gl.glTranslatef(dx, dy, dz);
+ cone();
+ gl.glPopMatrix();
+
+ gl.glPushMatrix();
+ gl.glMultMatrixf(floorshadow);
+ gl.glTranslatef(dx, dy, dz);
+ sphere();
+ gl.glPopMatrix();
+ gl.glEnable(GL_DEPTH_TEST);
+ gl.glEnable(GL_LIGHTING);
+ }
+
+
+ /* walls */
+
+ if (rendermode == SHADOW)
+ {
+ gl.glEnable(GL_STENCIL_TEST);
+ gl.glStencilFunc(GL_ALWAYS, 1, 0);
+ gl.glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE);
+ }
+ /* left wall */
+ gl.glBegin(GL_QUADS);
+ gl.glNormal3f(1.0f, 0.0f, 0.0f);
+ gl.glVertex3f(-100.0f, -100.0f, -320.0f);
+ gl.glVertex3f(-100.0f, -100.0f, -520.0f);
+ gl.glVertex3f(-100.0f, 100.0f, -520.0f);
+ gl.glVertex3f(-100.0f, 100.0f, -320.0f);
+ gl.glEnd();
+
+ if (rendermode == SHADOW)
+ {
+ gl.glStencilFunc(GL_EQUAL, 1, 1);
+ gl.glDisable(GL_DEPTH_TEST);
+ gl.glDisable(GL_LIGHTING);
+ gl.glColor3f(0.0f, 0.0f, 0.0f); /* shadow color */
+ gl.glDisable(GL_DEPTH_TEST);
+ gl.glPushMatrix();
+ gl.glMultMatrixf(leftwallshadow);
+ gl.glTranslatef(dx, dy, dz);
+ cone();
+ gl.glPopMatrix();
+ gl.glEnable(GL_DEPTH_TEST);
+ gl.glDisable(GL_STENCIL_TEST);
+ gl.glEnable(GL_DEPTH_TEST);
+ gl.glEnable(GL_LIGHTING);
+ }
+
+ gl.glBegin(GL_QUADS);
+
+ /* right wall */
+ gl.glNormal3f(-1.0f, 0.0f, 0.0f);
+ gl.glVertex3f(100.0f, -100.0f, -320.0f);
+ gl.glVertex3f(100.0f, 100.0f, -320.0f);
+ gl.glVertex3f(100.0f, 100.0f, -520.0f);
+ gl.glVertex3f(100.0f, -100.0f, -520.0f);
+
+ /* ceiling */
+ gl.glNormal3f(0.0f, -1.0f, 0.0f);
+ gl.glVertex3f(-100.0f, 100.0f, -320.0f);
+ gl.glVertex3f(-100.0f, 100.0f, -520.0f);
+ gl.glVertex3f(100.0f, 100.0f, -520.0f);
+ gl.glVertex3f(100.0f, 100.0f, -320.0f);
+
+ /* back wall */
+ gl.glNormal3f(0.0f, 0.0f, 1.0f);
+ gl.glVertex3f(-100.0f, -100.0f, -520.0f);
+ gl.glVertex3f(100.0f, -100.0f, -520.0f);
+ gl.glVertex3f(100.0f, 100.0f, -520.0f);
+ gl.glVertex3f(-100.0f, 100.0f, -520.0f);
+
+ gl.glEnd();
+
+ gl.glPushMatrix();
+ gl.glTranslatef(lightpos[X], lightpos[Y], lightpos[Z]);
+ gl.glDisable(GL_LIGHTING);
+ gl.glColor3f(1.0f, 1.0f, 0.7f);
+ gl.glCallList(LIGHT);
+ gl.glEnable(GL_LIGHTING);
+ gl.glPopMatrix();
+
+ gl.glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, cone_mat);
+ cone();
+
+ gl.glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, sphere_mat);
+ sphere();
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ /* simple way to extend a point to build shadow volume */
+ private void extend(float newvertex[], float light[], float vertex[], float t)
+ {
+ float delta[] = new float[3];
+
+ delta[X] = vertex[X] - light[X];
+ delta[Y] = vertex[Y] - light[Y];
+ delta[Z] = vertex[Z] - light[Z];
+
+ newvertex[X] = light[X] + delta[X] * t;
+ newvertex[Y] = light[Y] + delta[Y] * t;
+ newvertex[Z] = light[Z] + delta[Z] * t;
+ }
+
+ }
+}
diff --git a/demos/RonsDemos/softshadow_plugin13.html b/demos/RonsDemos/softshadow_plugin13.html new file mode 100644 index 0000000..48eb0d3 --- /dev/null +++ b/demos/RonsDemos/softshadow_plugin13.html @@ -0,0 +1,50 @@ +<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.61 [en] (Win98; U) [Netscape]">
+ <title>Softshadow by Tom McReynolds, SGI; ported to Java by Ron Cemer</title>
+</head>
+<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#e6e6ff">
+Softshadow applet
+<br>Originially written by Tom McReynolds, SGI
+<br>Ported to Java by Ron Cemer
+<br>Click inside the window to enable/disable shadows.
+<br>NOTE: WHEN SHADOWS ARE ENABLED, IT MAY TAKE A FEW SECONDS TO DRAW THE SCENE.
+<br>
+<!--"CONVERTED_APPLET"-->
+<!-- CONVERTER VERSION 1.3 --> +<SCRIPT LANGUAGE="JavaScript"><!-- + var _info = navigator.userAgent; var _ns = false; + var _ie = (_info.indexOf("MSIE") > 0 && _info.indexOf("Win") > 0 && _info.indexOf("Windows 3.1") < 0); +//--></SCRIPT> +<COMMENT><SCRIPT LANGUAGE="JavaScript1.1"><!-- + var _ns = (navigator.appName.indexOf("Netscape") >= 0 && ((_info.indexOf("Win") > 0 && _info.indexOf("Win16") < 0 && java.lang.System.getProperty("os.version").indexOf("3.5") < 0) || (_info.indexOf("Sun") > 0) || (_info.indexOf("Linux") > 0))); +//--></SCRIPT></COMMENT> + +<SCRIPT LANGUAGE="JavaScript"><!-- + if (_ie == true) document.writeln('<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" WIDTH = 400 HEIGHT = 400 codebase="http://java.sun.com/products/plugin/1.3/jinstall-13-win32.cab#Version=1,3,0,0"><NOEMBED><XMP>'); + else if (_ns == true) document.writeln('<EMBED type="application/x-java-applet;version=1.3" CODE = "softshadow.class" WIDTH = 400 HEIGHT = 400 scriptable=false pluginspage="http://java.sun.com/products/plugin/1.3/plugin-install.html"><NOEMBED><XMP>'); +//--></SCRIPT> +<APPLET CODE = "softshadow.class" WIDTH = 400 HEIGHT = 400></XMP> +<PARAM NAME = CODE VALUE = "softshadow.class" >
+ +<PARAM NAME="type" VALUE="application/x-java-applet;version=1.3"> +<PARAM NAME="scriptable" VALUE="false"> + +</APPLET> + +</NOEMBED></EMBED></OBJECT> + + +<!-- +<APPLET CODE = "softshadow.class" WIDTH = 400 HEIGHT = 400>
+
+
+</APPLET> +--> +<!--"END_CONVERTED_APPLET"-->
+
+<hr>
+</body>
+</html>
diff --git a/demos/RonsDemos/spots.html b/demos/RonsDemos/spots.html new file mode 100644 index 0000000..cd61548 --- /dev/null +++ b/demos/RonsDemos/spots.html @@ -0,0 +1,17 @@ +<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.61 [en] (Win98; U) [Netscape]">
+ <title>Spots by Mark J. Kilgard; ported to Java by Ron Cemer</title>
+</head>
+<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#e6e6ff">
+Spots applet
+<br>Originially written by Mark J. Kilgard
+<br>Ported to Java by Ron Cemer
+<br>
+<applet code="spots.class" width=400 height=400>
+</applet>
+<hr>
+</body>
+</html>
diff --git a/demos/RonsDemos/spots.java b/demos/RonsDemos/spots.java new file mode 100644 index 0000000..60a1813 --- /dev/null +++ b/demos/RonsDemos/spots.java @@ -0,0 +1,384 @@ +/**
+ * @(#) [place applet name here].java
+ * @(#) author: [place author here] (converted to Java by Ron Cemer)
+ */
+
+/* Copyright (c) Mark J. Kilgard, 1994. */
+
+/**
+ * (c) Copyright 1993, 1994, Silicon Graphics, Inc.
+ * ALL RIGHTS RESERVED
+ * Permission to use, copy, modify, and distribute this software for
+ * any purpose and without fee is hereby granted, provided that the above
+ * copyright notice appear in all copies and that both the copyright notice
+ * and this permission notice appear in supporting documentation, and that
+ * the name of Silicon Graphics, Inc. not be used in advertising
+ * or publicity pertaining to distribution of the software without specific,
+ * written prior permission.
+ *
+ * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
+ * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
+ * FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
+ * GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT,
+ * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY
+ * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION,
+ * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF
+ * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN
+ * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
+ * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * US Government Users Restricted Rights
+ * Use, duplication, or disclosure by the Government is subject to
+ * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
+ * (c)(1)(ii) of the Rights in Technical Data and Computer Software
+ * clause at DFARS 252.227-7013 and/or in similar or successor
+ * clauses in the FAR or the DOD or NASA FAR Supplement.
+ * Unpublished-- rights reserved under the copyright laws of the
+ * United States. Contractor/manufacturer is Silicon Graphics,
+ * Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311.
+ *
+ * OpenGL(TM) is a trademark of Silicon Graphics, Inc.
+ */
+
+import java.applet.*;
+import java.awt.*;
+import java.awt.event.*;
+import java.lang.*;
+import java.util.*;
+import java.io.*;
+import java.util.*;
+import gl4java.GLContext;
+import gl4java.awt.GLAnimCanvas;
+import gl4java.applet.SimpleGLAnimApplet1;
+
+public class spots extends SimpleGLAnimApplet1
+{
+ /* Initialize the applet */
+
+
+ public void init()
+ {
+ super.init();
+ Dimension d = getSize();
+ canvas = new spotsCanvas(d.width, d.height);
+ add("Center", canvas);
+ }
+
+
+ private class Light
+ {
+ public float amb[] = new float[4];
+ public float diff[] = new float[4];
+ public float spec[] = new float[4];
+ public float pos[] = new float[4];
+ public float spotDir[] = new float[3];
+ public float spotExp;
+ public float spotCutoff;
+ public float atten[] = new float[3];
+ public float trans[] = new float[3];
+ public float rot[] = new float[3];
+ public float swing[] = new float[3];
+ public float arc[] = new float[3];
+ public float arcIncr[] = new float[3];
+
+ public Light
+ (float ambr, float ambg, float ambb, float amba,
+ float diffr, float diffg, float diffb, float diffa,
+ float specr, float specg, float specb, float speca,
+ float posx, float posy, float posz, float posw,
+ float dirx, float diry, float dirz,
+ float exp,
+ float cutoff,
+ float attenr, float atteng, float attenb,
+ float transx, float transy, float transz,
+ float rotx, float roty, float rotz,
+ float swingx, float swingy, float swingz,
+ float arcx, float arcy, float arcz,
+ float arcincrx, float arcincry, float arcincrz)
+ {
+ amb[0] = ambr;
+ amb[1] = ambg;
+ amb[2] = ambb;
+ amb[3] = amba;
+ diff[0] = diffr;
+ diff[1] = diffg;
+ diff[2] = diffb;
+ diff[3] = diffa;
+ spec[0] = specr;
+ spec[1] = specg;
+ spec[2] = specb;
+ spec[3] = speca;
+ pos[0] = posx;
+ pos[1] = posy;
+ pos[2] = posz;
+ pos[3] = posw;
+ spotDir[0] = dirx;
+ spotDir[1] = diry;
+ spotDir[2] = dirz;
+ spotExp = exp;
+ spotCutoff = cutoff;
+ atten[0] = attenr;
+ atten[1] = atteng;
+ atten[2] = attenb;
+ trans[0] = transx;
+ trans[1] = transy;
+ trans[2] = transz;
+ rot[0] = rotx;
+ rot[1] = roty;
+ rot[2] = rotz;
+ swing[0] = swingx;
+ swing[1] = swingy;
+ swing[2] = swingz;
+ arc[0] = arcx;
+ arc[1] = arcy;
+ arc[2] = arcz;
+ arcIncr[0] = arcincrx;
+ arcIncr[1] = arcincry;
+ arcIncr[2] = arcincrz;
+ }
+ }
+
+
+ /* Local GLAnimCanvas extension class */
+
+
+ private class spotsCanvas extends GLAnimCanvas
+ {
+ private final double M_PI = 3.14159265;
+ private final double TWO_PI = (2.0*M_PI);
+ private final int NUM_LIGHTS = 3;
+
+ private boolean useSAME_AMB_SPEC = true;
+ private float modelAmb[] = {0.2f, 0.2f, 0.2f, 1.0f};
+ private float matAmb[] = {0.2f, 0.2f, 0.2f, 1.0f};
+ private float matDiff[] = {0.8f, 0.8f, 0.8f, 1.0f};
+ private float matSpec[] = {0.4f, 0.4f, 0.4f, 1.0f};
+ private float matEmission[] = {0.0f, 0.0f, 0.0f, 1.0f};
+ private Light[] spots =
+ {
+ new Light
+ (0.2f, 0.0f, 0.0f, 1.0f, /* ambient */
+ 0.8f, 0.0f, 0.0f, 1.0f, /* diffuse */
+ 0.4f, 0.0f, 0.0f, 1.0f, /* specular */
+ 0.0f, 0.0f, 0.0f, 1.0f, /* position */
+ 0.0f, -1.0f, 0.0f, /* direction */
+ 20.0f,
+ 60.0f, /* exponent, cutoff */
+ 1.0f, 0.0f, 0.0f, /* attenuation */
+ 0.0f, 1.25f, 0.0f, /* translation */
+ 0.0f, 0.0f, 0.0f, /* rotation */
+ 20.0f, 0.0f, 40.0f, /* swing */
+ 0.0f, 0.0f, 0.0f, /* arc */
+ (float)(TWO_PI / 70.0), 0.0f, (float)(TWO_PI / 140.0)), /* arc increment */
+ new Light
+ (0.0f, 0.2f, 0.0f, 1.0f, /* ambient */
+ 0.0f, 0.8f, 0.0f, 1.0f, /* diffuse */
+ 0.0f, 0.4f, 0.0f, 1.0f, /* specular */
+ 0.0f, 0.0f, 0.0f, 1.0f, /* position */
+ 0.0f, -1.0f, 0.0f, /* direction */
+ 20.0f,
+ 60.0f, /* exponent, cutoff */
+ 1.0f, 0.0f, 0.0f, /* attenuation */
+ 0.0f, 1.25f, 0.0f, /* translation */
+ 0.0f, 0.0f, 0.0f, /* rotation */
+ 20.0f, 0.0f, 40.0f, /* swing */
+ 0.0f, 0.0f, 0.0f, /* arc */
+ (float)(TWO_PI / 120.0), 0.0f, (float)(TWO_PI / 60.0)), /* arc increment */
+ new Light
+ (0.0f, 0.0f, 0.2f, 1.0f, /* ambient */
+ 0.0f, 0.0f, 0.8f, 1.0f, /* diffuse */
+ 0.0f, 0.0f, 0.4f, 1.0f, /* specular */
+ 0.0f, 0.0f, 0.0f, 1.0f, /* position */
+ 0.0f, -1.0f, 0.0f, /* direction */
+ 20.0f,
+ 60.0f, /* exponent, cutoff */
+ 1.0f, 0.0f, 0.0f, /* attenuation */
+ 0.0f, 1.25f, 0.0f, /* translation */
+ 0.0f, 0.0f, 0.0f, /* rotation */
+ 20.0f, 0.0f, 40.0f, /* swing */
+ 0.0f, 0.0f, 0.0f, /* arc */
+ (float)(TWO_PI / 50.0), 0.0f, (float)(TWO_PI / 100.0)), /* arc increment */
+ };
+ float spin = 0.0f;
+
+ public spotsCanvas(int w, int h)
+ {
+ super(w, h);
+ GLContext.gljNativeDebug = false;
+ GLContext.gljClassDebug = false;
+ setAnimateFps(30.0);
+ }
+
+ public void preInit()
+ {
+ doubleBuffer = true;
+ stereoView = false;
+ }
+
+ public void init()
+ {
+ System.out.println("init(): " + this);
+ reshape(getSize().width, getSize().height);
+
+ gl.glMatrixMode(GL_PROJECTION);
+ gl.glFrustum(-1.0f, 1.0f, -1.0f, 1.0f, 2.0f, 6.0f);
+
+ gl.glMatrixMode(GL_MODELVIEW);
+ gl.glTranslatef(0.0f, 0.0f, -3.0f);
+ gl.glRotatef(45.0f, 1.0f, 0.0f, 0.0f);
+
+ gl.glEnable(GL_LIGHTING);
+ gl.glEnable(GL_NORMALIZE);
+
+ gl.glLightModelfv(GL_LIGHT_MODEL_AMBIENT, modelAmb);
+ gl.glLightModelf(GL_LIGHT_MODEL_LOCAL_VIEWER, 1.0f);
+ gl.glLightModelf(GL_LIGHT_MODEL_TWO_SIDE, 0.0f);
+
+ gl.glMaterialfv(GL_FRONT, GL_AMBIENT, matAmb);
+ gl.glMaterialfv(GL_FRONT, GL_DIFFUSE, matDiff);
+ gl.glMaterialfv(GL_FRONT, GL_SPECULAR, matSpec);
+ gl.glMaterialfv(GL_FRONT, GL_EMISSION, matEmission);
+ gl.glMaterialf(GL_FRONT, GL_SHININESS, 10.0f);
+
+ initLights();
+
+ glj.gljCheckGL();
+ }
+
+ public void reshape(int width, int height)
+ {
+ gl.glViewport(0,0,width,height);
+ }
+
+ public void display()
+ {
+ if (glj.gljMakeCurrent() == false) return;
+
+ spin += 0.5f;
+ if (spin > 360.0f) spin -= 360.0f;
+
+ gl.glClear(GL_COLOR_BUFFER_BIT);
+
+ gl.glPushMatrix();
+ gl.glRotatef(spin, 0.0f, 1.0f, 0.0f);
+
+ aimLights();
+ setLights();
+
+ gl.glPushMatrix();
+ gl.glRotatef(-90.0f, 1.0f, 0.0f, 0.0f);
+ gl.glScalef(1.9f, 1.9f, 1.0f);
+ gl.glTranslatef(-0.5f, -0.5f, 0.0f);
+ drawPlane(16, 16);
+ gl.glPopMatrix();
+
+ drawLights();
+ gl.glPopMatrix();
+
+ glj.gljSwap();
+ glj.gljCheckGL();
+ glj.gljFree();
+
+ //if (!isSuspended()) repaint(); // Animate at full speed.
+ }
+
+ private void initLights()
+ {
+ for (int k = 0; k < NUM_LIGHTS; ++k)
+ {
+ int lt = GL_LIGHT0 + k;
+ Light light = spots[k];
+ gl.glEnable(lt);
+ gl.glLightfv(lt, GL_AMBIENT, light.amb);
+ gl.glLightfv(lt, GL_DIFFUSE, light.diff);
+ if (useSAME_AMB_SPEC)
+ gl.glLightfv(lt, GL_SPECULAR, light.amb);
+ else
+ gl.glLightfv(lt, GL_SPECULAR, light.spec);
+ gl.glLightf(lt, GL_SPOT_EXPONENT, light.spotExp);
+ gl.glLightf(lt, GL_SPOT_CUTOFF, light.spotCutoff);
+ gl.glLightf(lt, GL_CONSTANT_ATTENUATION, light.atten[0]);
+ gl.glLightf(lt, GL_LINEAR_ATTENUATION, light.atten[1]);
+ gl.glLightf(lt, GL_QUADRATIC_ATTENUATION, light.atten[2]);
+ }
+ }
+
+ private void aimLights()
+ {
+ for (int k = 0; k < NUM_LIGHTS; ++k)
+ {
+ Light light = spots[k];
+ light.rot[0] = light.swing[0] * (float)Math.sin(light.arc[0]);
+ light.arc[0] += light.arcIncr[0];
+ if (light.arc[0] > TWO_PI)
+ light.arc[0] -= TWO_PI;
+ light.rot[1] = light.swing[1] * (float)Math.sin(light.arc[1]);
+ light.arc[1] += light.arcIncr[1];
+ if (light.arc[1] > TWO_PI)
+ light.arc[1] -= TWO_PI;
+ light.rot[2] = light.swing[2] * (float)Math.sin(light.arc[2]);
+ light.arc[2] += light.arcIncr[2];
+ if (light.arc[2] > TWO_PI)
+ light.arc[2] -= TWO_PI;
+ }
+ }
+
+ private void setLights()
+ {
+ for (int k = 0; k < NUM_LIGHTS; ++k)
+ {
+ int lt = GL_LIGHT0 + k;
+ Light light = spots[k];
+ gl.glPushMatrix();
+ gl.glTranslatef(light.trans[0], light.trans[1], light.trans[2]);
+ gl.glRotatef(light.rot[0], 1, 0, 0);
+ gl.glRotatef(light.rot[1], 0, 1, 0);
+ gl.glRotatef(light.rot[2], 0, 0, 1);
+ gl.glLightfv(lt, GL_POSITION, light.pos);
+ gl.glLightfv(lt, GL_SPOT_DIRECTION, light.spotDir);
+ gl.glPopMatrix();
+ }
+ }
+
+ private void drawLights()
+ {
+ gl.glDisable(GL_LIGHTING);
+ for (int k = 0; k < NUM_LIGHTS; ++k)
+ {
+ Light light = spots[k];
+ gl.glColor4fv(light.diff);
+ gl.glPushMatrix();
+ gl.glTranslatef(light.trans[0], light.trans[1], light.trans[2]);
+ gl.glRotatef(light.rot[0], 1, 0, 0);
+ gl.glRotatef(light.rot[1], 0, 1, 0);
+ gl.glRotatef(light.rot[2], 0, 0, 1);
+ gl.glBegin(GL_LINES);
+ gl.glVertex3f(light.pos[0], light.pos[1], light.pos[2]);
+ gl.glVertex3f(light.spotDir[0], light.spotDir[1], light.spotDir[2]);
+ gl.glEnd();
+ gl.glPopMatrix();
+ }
+ gl.glEnable(GL_LIGHTING);
+ }
+
+ private void drawPlane(int w, int h)
+ {
+ int i, j;
+ float dw = 1.0f / (float)w;
+ float dh = 1.0f / (float)h;
+ gl.glNormal3f(0.0f, 0.0f, 1.0f);
+ for (j = 0; j < h; ++j)
+ {
+ gl.glBegin(GL_TRIANGLE_STRIP);
+ for (i = 0; i <= w; ++i)
+ {
+ gl.glVertex2f(dw * i, dh * (j + 1));
+ gl.glVertex2f(dw * i, dh * j);
+ }
+ gl.glEnd();
+ }
+ }
+ }
+}
diff --git a/demos/RonsDemos/spots_plugin13.html b/demos/RonsDemos/spots_plugin13.html new file mode 100644 index 0000000..c5cfb39 --- /dev/null +++ b/demos/RonsDemos/spots_plugin13.html @@ -0,0 +1,48 @@ +<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.61 [en] (Win98; U) [Netscape]">
+ <title>Spots by Mark J. Kilgard; ported to Java by Ron Cemer</title>
+</head>
+<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#e6e6ff">
+Spots applet
+<br>Originially written by Mark J. Kilgard
+<br>Ported to Java by Ron Cemer
+<br>
+<!--"CONVERTED_APPLET"-->
+<!-- CONVERTER VERSION 1.3 --> +<SCRIPT LANGUAGE="JavaScript"><!-- + var _info = navigator.userAgent; var _ns = false; + var _ie = (_info.indexOf("MSIE") > 0 && _info.indexOf("Win") > 0 && _info.indexOf("Windows 3.1") < 0); +//--></SCRIPT> +<COMMENT><SCRIPT LANGUAGE="JavaScript1.1"><!-- + var _ns = (navigator.appName.indexOf("Netscape") >= 0 && ((_info.indexOf("Win") > 0 && _info.indexOf("Win16") < 0 && java.lang.System.getProperty("os.version").indexOf("3.5") < 0) || (_info.indexOf("Sun") > 0) || (_info.indexOf("Linux") > 0))); +//--></SCRIPT></COMMENT> + +<SCRIPT LANGUAGE="JavaScript"><!-- + if (_ie == true) document.writeln('<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" WIDTH = 400 HEIGHT = 400 codebase="http://java.sun.com/products/plugin/1.3/jinstall-13-win32.cab#Version=1,3,0,0"><NOEMBED><XMP>'); + else if (_ns == true) document.writeln('<EMBED type="application/x-java-applet;version=1.3" CODE = "spots.class" WIDTH = 400 HEIGHT = 400 scriptable=false pluginspage="http://java.sun.com/products/plugin/1.3/plugin-install.html"><NOEMBED><XMP>'); +//--></SCRIPT> +<APPLET CODE = "spots.class" WIDTH = 400 HEIGHT = 400></XMP> +<PARAM NAME = CODE VALUE = "spots.class" >
+ +<PARAM NAME="type" VALUE="application/x-java-applet;version=1.3"> +<PARAM NAME="scriptable" VALUE="false"> + +</APPLET> + +</NOEMBED></EMBED></OBJECT> + + +<!-- +<APPLET CODE = "spots.class" WIDTH = 400 HEIGHT = 400>
+
+
+</APPLET> +--> +<!--"END_CONVERTED_APPLET"-->
+
+<hr>
+</body>
+</html>
diff --git a/demos/RonsDemos/star.html b/demos/RonsDemos/star.html new file mode 100644 index 0000000..7ab40ee --- /dev/null +++ b/demos/RonsDemos/star.html @@ -0,0 +1,22 @@ +<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.61 [en] (Win98; U) [Netscape]">
+ <title>Star by Silicon Graphics; ported to Java by Ron Cemer</title>
+</head>
+<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#e6e6ff">
+Star applet
+<br>Originially written by Silicon Graphics
+<br>Ported to Java by Ron Cemer
+<br>
+<hr>By clicking inside the window, you can change the behavior of the
+<br>stars. There are two modes: normal and "weird". Each time
+you
+<br>click inside the window, the current mode will change.
+<br>
+<applet code="star.class" width=400 height=400>
+</applet>
+<hr>
+</body>
+</html>
diff --git a/demos/RonsDemos/star.java b/demos/RonsDemos/star.java new file mode 100644 index 0000000..3017b51 --- /dev/null +++ b/demos/RonsDemos/star.java @@ -0,0 +1,349 @@ +/**
+ * @(#) star.java
+ * @(#) author: Silicon Graphics (converted to Java by Ron Cemer)
+ */
+
+/*
+ * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the name of
+ * Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Silicon Graphics.
+ *
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF
+ * ANY KIND,
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+import java.applet.*;
+import java.awt.*;
+import java.awt.event.*;
+import java.lang.*;
+import java.util.*;
+import java.io.*;
+import java.util.*;
+import gl4java.GLContext;
+import gl4java.awt.GLAnimCanvas;
+import gl4java.applet.SimpleGLAnimApplet1;
+
+public class star extends SimpleGLAnimApplet1
+{
+ /* Initialize the applet */
+
+
+ public void init()
+ {
+ super.init();
+ Dimension d = getSize();
+ canvas = new starCanvas(d.width, d.height);
+ add("Center", canvas);
+ }
+
+
+ /* Local GLAnimCanvas extension class */
+
+
+ private class starCanvas extends GLAnimCanvas implements MouseListener
+ {
+ private static final float M_PI = 3.14159265359f;
+ private static final int NORMAL = 0, WEIRD = 1;
+ private static final int STREAK = 0, CIRCLE = 1;
+ private static final int MAXSTARS = 400;
+ private static final int MAXPOS = 10000;
+ private static final int MAXWARP = 10;
+ private static final int MAXANGLES = 6000;
+ private int windW, windH;
+ private int flag = NORMAL;
+ private int starCount = MAXSTARS / 2;
+ private float speed = 1.0f;
+ private int nitro = 0;
+ private starRec stars[];
+ private float sinTable[];
+ private Random rand = null;
+
+ private class starRec
+ {
+ protected int type;
+ protected float x[], y[], z[];
+ protected float offsetX, offsetY, offsetR, rotation;
+
+ public starRec()
+ {
+ x = new float[2];
+ y = new float[2];
+ z = new float[2];
+ }
+ }
+
+ public starCanvas(int w, int h)
+ {
+ super(w, h);
+ GLContext.gljNativeDebug = false;
+ GLContext.gljClassDebug = false;
+ setAnimateFps(30.0);
+
+ stars = new starRec[MAXSTARS];
+ sinTable = new float[MAXANGLES];
+ }
+
+ public void preInit()
+ {
+ doubleBuffer = true;
+ stereoView = false;
+ }
+
+ public void init()
+ {
+ System.out.println("init(): " + this);
+ reshape(getSize().width, getSize().height);
+
+ Date dt = new Date();
+ rand = new Random(dt.getTime());
+
+ int n;
+ for (n = 0; n < MAXSTARS; n++)
+ NewStar(n, 100);
+ float angle = 0.0f;
+ for (n = 0; n < MAXANGLES ; n++)
+ {
+ sinTable[n] = (float)Math.sin(angle);
+ angle += M_PI / (MAXANGLES / 2.0f);
+ }
+ gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
+ gl.glDisable(GL_DITHER);
+
+ glj.gljCheckGL();
+
+ addMouseListener(this);
+ }
+
+ public void doCleanup()
+ {
+ System.out.println("destroy(): " + this);
+ removeMouseListener(this);
+ }
+
+ public void reshape(int width, int height)
+ {
+ windW = width;
+ windH = height;
+
+ gl.glViewport(0,0,width,height);
+ gl.glMatrixMode(GL_PROJECTION);
+ gl.glLoadIdentity();
+ glu.gluOrtho2D(-0.5,(double)width+0.5,-0.5,(double)height+0.5);
+ gl.glMatrixMode(GL_MODELVIEW);
+ }
+
+ public void display()
+ {
+ if (glj.gljMakeCurrent() == false) return;
+
+ MoveStars();
+ ShowStars();
+ if (nitro > 0)
+ {
+ speed = (float)(nitro / 10) + 1.0f;
+ if (speed > MAXWARP) speed = MAXWARP;
+ if (++nitro > MAXWARP*10) nitro = -nitro;
+ }
+ else if (nitro < 0)
+ {
+ nitro++;
+ speed = (float)(-nitro / 10) + 1.0f;
+ if (speed > MAXWARP) speed = MAXWARP;
+ }
+
+ glj.gljSwap();
+ glj.gljCheckGL();
+ glj.gljFree();
+
+ //if (!isSuspended()) repaint(); // Animate at full speed.
+ }
+
+ private float Sin(float angle)
+ {
+ int ang;
+ ang = (int)angle;
+ while (ang < 0) ang += MAXANGLES;
+ while (ang >= MAXANGLES) ang -= MAXANGLES;
+ return (sinTable[ang]);
+ }
+
+ private float Cos(float angle)
+ {
+ return Sin(angle+(((float)MAXANGLES)*0.25f));
+ }
+
+ private void NewStar(int n, int d)
+ {
+ stars[n] = new starRec();
+ if (rand.nextInt() % 4 == 0)
+ stars[n].type = CIRCLE;
+ else
+ stars[n].type = STREAK;
+ stars[n].x[0] = (float)(rand.nextInt() % MAXPOS - MAXPOS / 2);
+ stars[n].y[0] = (float)(rand.nextInt() % MAXPOS - MAXPOS / 2);
+ stars[n].z[0] = (float)(rand.nextInt() % MAXPOS + d);
+ if ( (rand.nextInt() % 4 == 0) && (flag == WEIRD) )
+ {
+ stars[n].offsetX = (float)(rand.nextInt() % 100 - 100 / 2);
+ stars[n].offsetY = (float)(rand.nextInt() % 100 - 100 / 2);
+ stars[n].offsetR = (float)(rand.nextInt() % 25 - 25 / 2);
+ }
+ else
+ {
+ stars[n].offsetX = 0.0f;
+ stars[n].offsetY = 0.0f;
+ stars[n].offsetR = 0.0f;
+ }
+ }
+
+ private void RotatePoint(float[] x, float[] y, float rotation)
+ {
+ float tmpX, tmpY;
+
+ tmpX = x[0] * Cos(rotation) - y[0] * Sin(rotation);
+ tmpY = y[0] * Cos(rotation) + x[0] * Sin(rotation);
+ x[0] = tmpX;
+ y[0] = tmpY;
+ }
+
+ private void MoveStars()
+ {
+ float offset;
+ int n;
+
+ offset = speed * 60.0f;
+
+ for (n = 0; n < starCount; n++)
+ {
+ stars[n].x[1] = stars[n].x[0];
+ stars[n].y[1] = stars[n].y[0];
+ stars[n].z[1] = stars[n].z[0];
+ stars[n].x[0] += stars[n].offsetX;
+ stars[n].y[0] += stars[n].offsetY;
+ stars[n].z[0] -= offset;
+ int rot = (int)(stars[n].rotation = stars[n].offsetR);
+ while (rot < 0) rot += MAXANGLES;
+ while (rot >= MAXANGLES) rot -= MAXANGLES;
+ stars[n].rotation = (float)rot;
+ }
+ }
+
+ private boolean StarPoint(int n)
+ {
+ float x0, y0, x1, y1, width;
+ float xbuf[] = new float[1], ybuf[] = new float[1];
+ int i;
+
+ x0 = stars[n].x[0] * windW / stars[n].z[0];
+ y0 = stars[n].y[0] * windH / stars[n].z[0];
+ xbuf[0] = x0;
+ ybuf[0] = y0;
+ RotatePoint(xbuf, ybuf, stars[n].rotation);
+ x0 = xbuf[0];
+ y0 = ybuf[0];
+ x0 += windW / 2.0f;
+ y0 += windH / 2.0f;
+
+ if ( (x0 >= 0.0f) && (x0 < windW) && (y0 >= 0.0f) && (y0 < windH) )
+ {
+ if (stars[n].type == STREAK)
+ {
+ x1 = stars[n].x[1] * windW / stars[n].z[1];
+ y1 = stars[n].y[1] * windH / stars[n].z[1];
+ xbuf[0] = x1;
+ ybuf[0] = y1;
+ RotatePoint(xbuf, ybuf, stars[n].rotation);
+ x1 = xbuf[0];
+ y1 = ybuf[0];
+ x1 += windW / 2.0f;
+ y1 += windH / 2.0f;
+
+ gl.glLineWidth(MAXPOS/100.0f/stars[n].z[0]+1.0f);
+ gl.glColor3f(1.0f, (MAXWARP-speed)/MAXWARP, (MAXWARP-speed)/MAXWARP);
+ if (Math.abs(x0-x1) < 1.0f && Math.abs(y0-y1) < 1.0f)
+ {
+ gl.glBegin(GL_POINTS);
+ gl.glVertex2f(x0, y0);
+ gl.glEnd();
+ }
+ else
+ {
+ gl.glBegin(GL_LINES);
+ gl.glVertex2f(x0, y0);
+ gl.glVertex2f(x1, y1);
+ gl.glEnd();
+ }
+ }
+ else
+ {
+ width = MAXPOS / 10.0f / stars[n].z[0] + 1.0f;
+ gl.glColor3f(1.0f, 0.0f, 0.0f);
+ gl.glBegin(GL_POLYGON);
+ for (i = 0; i < 8; i++)
+ {
+ float x = x0 + width * Cos((float)i*MAXANGLES/8.0f);
+ float y = y0 + width * Sin((float)i*MAXANGLES/8.0f);
+ gl.glVertex2f(x, y);
+ };
+ gl.glEnd();
+ }
+
+ return true;
+ }
+ return false;
+ }
+
+ private void ShowStars()
+ {
+ gl.glClear(GL_COLOR_BUFFER_BIT);
+ for (int n = 0; n < starCount; n++)
+ {
+ if ( (stars[n].z[0] > speed)
+ || ( (stars[n].z[0] > 0.0f) && (speed < MAXWARP) ) )
+ {
+ if (!StarPoint(n))
+ NewStar(n, MAXPOS);
+ }
+ else
+ NewStar(n, MAXPOS);
+ }
+ }
+
+ // Methods required for the implementation of MouseListener
+ public void mouseEntered( MouseEvent evt )
+ {
+ }
+
+ public void mouseExited( MouseEvent evt )
+ {
+ }
+
+ public void mousePressed( MouseEvent evt )
+ {
+ flag = (flag == NORMAL) ? WEIRD : NORMAL;
+ }
+
+ public void mouseReleased( MouseEvent evt )
+ {
+ }
+
+ public void mouseClicked( MouseEvent evt )
+ {
+ }
+ }
+}
diff --git a/demos/RonsDemos/star_plugin13.html b/demos/RonsDemos/star_plugin13.html new file mode 100644 index 0000000..8a3f8e1 --- /dev/null +++ b/demos/RonsDemos/star_plugin13.html @@ -0,0 +1,53 @@ +<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.61 [en] (Win98; U) [Netscape]">
+ <title>Star by Silicon Graphics; ported to Java by Ron Cemer</title>
+</head>
+<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#e6e6ff">
+Star applet
+<br>Originially written by Silicon Graphics
+<br>Ported to Java by Ron Cemer
+<br>
+<hr>By clicking inside the window, you can change the behavior of the
+<br>stars. There are two modes: normal and "weird". Each time
+you
+<br>click inside the window, the current mode will change.
+<br>
+<!--"CONVERTED_APPLET"-->
+<!-- CONVERTER VERSION 1.3 --> +<SCRIPT LANGUAGE="JavaScript"><!-- + var _info = navigator.userAgent; var _ns = false; + var _ie = (_info.indexOf("MSIE") > 0 && _info.indexOf("Win") > 0 && _info.indexOf("Windows 3.1") < 0); +//--></SCRIPT> +<COMMENT><SCRIPT LANGUAGE="JavaScript1.1"><!-- + var _ns = (navigator.appName.indexOf("Netscape") >= 0 && ((_info.indexOf("Win") > 0 && _info.indexOf("Win16") < 0 && java.lang.System.getProperty("os.version").indexOf("3.5") < 0) || (_info.indexOf("Sun") > 0) || (_info.indexOf("Linux") > 0))); +//--></SCRIPT></COMMENT> + +<SCRIPT LANGUAGE="JavaScript"><!-- + if (_ie == true) document.writeln('<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" WIDTH = 400 HEIGHT = 400 codebase="http://java.sun.com/products/plugin/1.3/jinstall-13-win32.cab#Version=1,3,0,0"><NOEMBED><XMP>'); + else if (_ns == true) document.writeln('<EMBED type="application/x-java-applet;version=1.3" CODE = "star.class" WIDTH = 400 HEIGHT = 400 scriptable=false pluginspage="http://java.sun.com/products/plugin/1.3/plugin-install.html"><NOEMBED><XMP>'); +//--></SCRIPT> +<APPLET CODE = "star.class" WIDTH = 400 HEIGHT = 400></XMP> +<PARAM NAME = CODE VALUE = "star.class" >
+ +<PARAM NAME="type" VALUE="application/x-java-applet;version=1.3"> +<PARAM NAME="scriptable" VALUE="false"> + +</APPLET> + +</NOEMBED></EMBED></OBJECT> + + +<!-- +<APPLET CODE = "star.class" WIDTH = 400 HEIGHT = 400>
+
+
+</APPLET> +--> +<!--"END_CONVERTED_APPLET"-->
+
+<hr>
+</body>
+</html>
diff --git a/demos/RonsDemos/steam.html b/demos/RonsDemos/steam.html new file mode 100644 index 0000000..b02826e --- /dev/null +++ b/demos/RonsDemos/steam.html @@ -0,0 +1,22 @@ +<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.61 [en] (Win98; U) [Netscape]">
+ <title>Steam by Troy Robinette; ported to Java by Ron Cemer</title>
+</head>
+<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#e6e6ff">
+Steam applet
+<br>Originially written by Troy Robinette
+<br>Ported to Java by Ron Cemer
+<br>Right click within the window for a menu of options.
+<br>Left-click within the window, then press any of the following keys:
+<br>Arrow keys rotate the model.
+<br>+ and - keys speed up or slow down the simulation.
+<br>While paused, a and z keys single-step forward and backward.
+<br>
+<applet code="steam.class" width=400 height=400>
+</applet>
+<hr>
+</body>
+</html>
diff --git a/demos/RonsDemos/steam.java b/demos/RonsDemos/steam.java new file mode 100644 index 0000000..3f19f7e --- /dev/null +++ b/demos/RonsDemos/steam.java @@ -0,0 +1,791 @@ +/**
+ * @(#) steam.java
+ * @(#) author: Troy Robinette (converted to Java by Ron Cemer)
+ */
+
+import java.applet.*;
+import java.awt.*;
+import java.awt.event.*;
+import java.lang.*;
+import java.util.*;
+import java.io.*;
+import java.util.*;
+import gl4java.GLContext;
+import gl4java.awt.GLAnimCanvas;
+import gl4java.applet.SimpleGLAnimApplet1;
+
+/**
+ Description: Interactive 3D graphics, Assignment #1
+ Miniature Steam Engine Simulation.
+ Author: Troy Robinette
+ Date: 29/9/95
+ Email: [email protected]
+ Notes: - Transparence doesn't quite work. The color of the
+ underlying object doesn't show through.
+ - Also only the front side of the transparent objects are
+ transparent.
+**/
+
+public class steam extends SimpleGLAnimApplet1
+{
+ private static final float boxnormals[][] =
+ {
+ {-1.0f, 0.0f, 0.0f},
+ {0.0f, 1.0f, 0.0f},
+ {1.0f, 0.0f, 0.0f},
+ {0.0f, -1.0f, 0.0f},
+ {0.0f, 0.0f, 1.0f},
+ {0.0f, 0.0f, -1.0f}
+ };
+ private static final int boxfaces[][] =
+ {
+ {0, 1, 2, 3},
+ {3, 2, 6, 7},
+ {7, 6, 5, 4},
+ {4, 5, 1, 0},
+ {5, 6, 2, 1},
+ {7, 4, 0, 3}
+ };
+
+ /* Initialize the applet */
+
+
+ public void init()
+ {
+ super.init();
+ Dimension d = getSize();
+ canvas = new steamCanvas(d.width, d.height);
+ canvas.requestFocus();
+ add("Center", canvas);
+ }
+
+
+ /* Local GLAnimCanvas extension class */
+
+
+ private class steamCanvas extends GLAnimCanvas
+ implements MouseListener, ActionListener, KeyListener
+ {
+ /* Dimensions of texture image. */
+ private final int IMAGE_WIDTH = 64;
+ private final int IMAGE_HEIGHT = 64;
+ /* Step to be taken for each rotation. */
+ private final int ANGLE_STEP = 10;
+ /* Magic numbers for relationship b/w cylinder head and crankshaft. */
+ private final float MAGNITUDE = 120.0f;
+ private final float PHASE = 270.112f;
+ private final float FREQ_DIV = 58.0f;
+ private final float ARC_LENGTH = 2.7f;
+ private final float ARC_RADIUS = 0.15f;
+ /* Rotation angles */
+ private float view_h = 270.0f, view_v = 0.0f;
+ private float head_angle = 0.0f;
+ private int crank_angle = 0;
+ /* Crank rotation step. */
+ private float crank_step = 5.0f;
+ /* Toggles */
+ private boolean filled = true;
+ private boolean textured = false, transparent = false;
+ /* Storage for the angle look up table and the texture map */
+ private float head_look_up_table[] = new float[360];
+ private byte image[] = new byte[IMAGE_WIDTH*IMAGE_HEIGHT*3];
+ /* Indentifiers for each Display list */
+ private int list_piston_filled = 1;
+ private int list_piston_texture = 2;
+ private int list_flywheel_filled = 4;
+ private int list_flywheel_texture = 8;
+ /* Variable used in the creaton of glu objects */
+ int obj; // (GLU quadric object)
+
+ private PopupMenu menu = null;
+ private boolean menu_showing = false;
+ private boolean save_suspended = false;
+
+ private final String MENU_FILLED = "Filled";
+ private final String MENU_WIREFRAME = "Wireframe";
+ private final String MENU_TEXTURED = "Textured";
+ private final String MENU_UNTEXTURED = "Untextured";
+ private final String MENU_TRANSPARENT = "Transparent";
+ private final String MENU_OPAQUE = "Opaque";
+ private final String MENU_RIGHT_LIGHT_ON = "Right light on";
+ private final String MENU_RIGHT_LIGHT_OFF = "Right light off";
+ private final String MENU_LEFT_LIGHT_ON = "Left light on";
+ private final String MENU_LEFT_LIGHT_OFF = "Left light off";
+ private final String MENU_PAUSE = "Pause (use a and z to step)";
+ private final String MENU_RESUME = "Resume animation";
+ private final String MENU_SPEED_UP = "Speed up (+)";
+ private final String MENU_SLOW_DOWN = "Slow down (-)";
+
+ public steamCanvas(int w, int h)
+ {
+ super(w, h);
+ GLContext.gljNativeDebug = false;
+ GLContext.gljClassDebug = false;
+ setAnimateFps(30.0);
+ }
+
+ public void preInit()
+ {
+ doubleBuffer = true;
+ stereoView = false;
+ }
+
+ public void init()
+ {
+ System.out.println("init(): " + this);
+ reshape(getSize().width, getSize().height);
+
+ float mat_specular[] = {1.0f, 1.0f, 1.0f, 1.0f};
+ float mat_shininess[] = {50.0f};
+ float light_position0[] = {1.0f, 1.0f, 1.0f, 0.0f};
+ float light_position1[] = {-1.0f, 1.0f, 1.0f, 0.0f};
+ float light_diffuse1[] = {1.0f,1.0f,1.0f,1.0f};
+ float light_specular1[] = {1.0f,1.0f,1.0f,1.0f};
+
+ gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
+
+ obj = glu.gluNewQuadric();
+ make_table();
+ make_image();
+
+ /* Set up Texturing */
+ gl.glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
+ gl.glTexImage2D
+ (GL_TEXTURE_2D,
+ 0,
+ 3,
+ IMAGE_WIDTH,
+ IMAGE_HEIGHT,
+ 0,
+ GL_RGB,
+ GL_UNSIGNED_BYTE,
+ image);
+ gl.glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
+ gl.glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
+ gl.glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+ gl.glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+ gl.glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
+
+ /* Set up Lighting */
+ gl.glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular);
+ gl.glMaterialfv(GL_FRONT, GL_SHININESS, mat_shininess);
+ gl.glLightfv(GL_LIGHT0, GL_POSITION, light_position0);
+ gl.glLightfv(GL_LIGHT1, GL_POSITION, light_position1);
+ gl.glLightfv(GL_LIGHT1, GL_DIFFUSE, light_diffuse1);
+ gl.glLightfv(GL_LIGHT1, GL_SPECULAR, light_specular1);
+
+ /* Initial render mode is with full shading and LIGHT 0
+ enabled. */
+ gl.glEnable(GL_LIGHTING);
+ gl.glEnable(GL_LIGHT0);
+ gl.glDisable(GL_LIGHT1);
+ gl.glDepthFunc(GL_LEQUAL);
+ gl.glEnable(GL_DEPTH_TEST);
+ gl.glDisable(GL_ALPHA_TEST);
+
+ gl.glColorMaterial(GL_FRONT_AND_BACK, GL_DIFFUSE);
+ gl.glEnable(GL_COLOR_MATERIAL);
+ gl.glShadeModel(GL_SMOOTH);
+
+ /* Initialise display lists */
+ gl.glNewList(list_piston_filled, GL_COMPILE);
+ draw_piston();
+ gl.glEndList();
+ gl.glNewList(list_flywheel_filled, GL_COMPILE);
+ draw_flywheel();
+ gl.glEndList();
+
+ glu.gluQuadricTexture(obj, true);
+ gl.glNewList(list_piston_texture, GL_COMPILE);
+ draw_piston();
+ gl.glEndList();
+ gl.glNewList(list_flywheel_texture, GL_COMPILE);
+ draw_flywheel();
+ gl.glEndList();
+ glu.gluQuadricTexture(obj, false);
+
+ glj.gljCheckGL();
+
+ menu = new PopupMenu("Options");
+ menu.add(MENU_FILLED);
+ menu.add(MENU_WIREFRAME);
+ menu.add(MENU_TEXTURED);
+ menu.add(MENU_UNTEXTURED);
+ menu.add(MENU_TRANSPARENT);
+ menu.add(MENU_OPAQUE);
+ menu.add(MENU_RIGHT_LIGHT_ON);
+ menu.add(MENU_RIGHT_LIGHT_OFF);
+ menu.add(MENU_LEFT_LIGHT_ON);
+ menu.add(MENU_LEFT_LIGHT_OFF);
+ menu.add(MENU_PAUSE);
+ menu.add(MENU_RESUME);
+ menu.add(MENU_SPEED_UP);
+ menu.add(MENU_SLOW_DOWN);
+ menu.addActionListener(this);
+ add(menu);
+
+ addMouseListener(this);
+ addKeyListener(this);
+ }
+
+ public void doCleanup()
+ {
+ System.out.println("destroy(): " + this);
+ removeMouseListener(this);
+ menu.removeActionListener(this);
+ removeKeyListener(this);
+ }
+
+ public void reshape(int width, int height)
+ {
+ gl.glViewport(0,0,width,height);
+ gl.glMatrixMode(GL_PROJECTION);
+ gl.glLoadIdentity();
+ glu.gluPerspective(65.0f, (float)width/(float)height, 1.0f, 20.0f);
+ gl.glMatrixMode(GL_MODELVIEW);
+ gl.glLoadIdentity();
+ gl.glTranslatef(0.0f, 0.0f, -5.0f); /* viewing transform */
+ gl.glScalef(1.5f, 1.5f, 1.5f);
+ }
+
+ public void display()
+ {
+ if (glj.gljMakeCurrent() == false) return;
+
+ if (!isSuspended())
+ {
+ crank_angle += crank_step;
+ while (crank_angle >= 360) crank_angle -= 360;
+ while (crank_angle < 0) crank_angle += 360;
+ head_angle = head_look_up_table[crank_angle];
+ }
+
+ /* Main display code. Clears the drawing buffer and if
+ transparency is set, displays the model twice, 1st time
+ accepting those fragments with an ALPHA value of 1 only,
+ then with DEPTH_BUFFER writing disabled for those with
+ other values. */
+
+ int pass;
+ gl.glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+ gl.glPushMatrix();
+ if (transparent)
+ {
+ gl.glEnable(GL_ALPHA_TEST);
+ pass = 2;
+ }
+ else
+ {
+ gl.glDisable(GL_ALPHA_TEST);
+ pass = 0;
+ }
+
+ /* Rotate the whole model */
+ gl.glRotatef(view_h, 0.0f, 1.0f, 0.0f);
+ gl.glRotatef(view_v, 1.0f, 0.0f, 0.0f);
+
+ do
+ {
+ if (pass == 2)
+ {
+ gl.glAlphaFunc(GL_EQUAL, 1);
+ gl.glDepthMask(true);
+ pass = 1;
+ }
+ else if (pass != 0)
+ {
+ gl.glAlphaFunc(GL_NOTEQUAL, 1);
+ gl.glDepthMask(false);
+ pass = 0;
+ }
+
+ draw_engine_pole();
+
+ gl.glPushMatrix();
+ gl.glTranslatef(0.5f, 1.4f, 0.0f);
+ draw_cylinder_head();
+ gl.glPopMatrix();
+
+ gl.glPushMatrix();
+ gl.glTranslatef(0.0f, -0.8f, 0.0f);
+ draw_crank();
+ gl.glPopMatrix();
+ } while (pass > 0);
+
+ gl.glDepthMask(true);
+ gl.glPopMatrix();
+
+ glj.gljSwap();
+ glj.gljCheckGL();
+ glj.gljFree();
+
+ //if (!isSuspended()) repaint(); // Animate at full speed.
+ }
+
+ // Methods required for the implementation of MouseListener
+ public void mouseEntered( MouseEvent evt )
+ {
+ Component comp = evt.getComponent();
+ if( comp.equals(this ) )
+ {
+ requestFocus();
+ }
+ }
+
+ public void mouseClicked( MouseEvent evt )
+ {
+ Component comp = evt.getComponent();
+ if( comp.equals(this ) )
+ {
+ requestFocus();
+ }
+ }
+
+ public void mouseExited(MouseEvent evt)
+ {
+ }
+
+ public void mousePressed(MouseEvent evt)
+ {
+ // If user presses right mouse button within canvas area,
+ // suspend animation and pop up menu.
+ // If menu was already popped up and user presses either
+ // mouse button within canvas area, resume animation
+ // because the menu will have been removed automatically.
+ if (!menu_showing)
+ {
+ if ((evt.getModifiers() & evt.BUTTON3_MASK) != 0)
+ {
+ menu_showing = true;
+ save_suspended = isSuspended();
+ if (!save_suspended)
+ {
+ setSuspended(true);
+ repaint(100);
+ try
+ {
+ Thread.currentThread().sleep(200);
+ }
+ catch (Exception e)
+ { }
+ }
+ menu.show(this,evt.getX(),evt.getY());
+ }
+ }
+ else
+ {
+ menu_showing = false;
+ setSuspended(save_suspended);
+ }
+ }
+
+ public void mouseReleased(MouseEvent evt)
+ {
+ }
+
+ // Method required for the implementation of ActionListener
+ public void actionPerformed(ActionEvent evt)
+ {
+ if (glj.gljMakeCurrent() == false) return;
+ boolean dorepaint = false;
+ String c = evt.getActionCommand();
+ if (c.equals(MENU_FILLED))
+ {
+ filled = true;
+ gl.glShadeModel(GL_SMOOTH);
+ gl.glEnable(GL_LIGHTING);
+ gl.glEnable(GL_DEPTH_TEST);
+ gl.glEnable(GL_COLOR_MATERIAL);
+ glu.gluQuadricNormals(obj, GLU_SMOOTH);
+ glu.gluQuadricDrawStyle(obj, GLU_FILL);
+ // Conditionally re-enable texturing.
+ if (textured)
+ {
+ gl.glEnable(GL_TEXTURE_2D);
+ glu.gluQuadricTexture(obj, true);
+ }
+ dorepaint = true;
+ }
+ else if (c.equals(MENU_WIREFRAME))
+ {
+ filled = false;
+ gl.glShadeModel(GL_FLAT);
+ gl.glDisable(GL_LIGHTING);
+ gl.glDisable(GL_DEPTH_TEST);
+ gl.glDisable(GL_COLOR_MATERIAL);
+ glu.gluQuadricNormals(obj, GLU_NONE);
+ glu.gluQuadricDrawStyle(obj, GLU_LINE);
+ glu.gluQuadricTexture(obj, false);
+ // Be sure texturing is disabled.
+ gl.glDisable(GL_TEXTURE_2D);
+ glu.gluQuadricTexture(obj, false);
+ dorepaint = true;
+ }
+ else if (c.equals(MENU_TEXTURED))
+ {
+ textured = true;
+ if (filled)
+ {
+ gl.glEnable(GL_TEXTURE_2D);
+ glu.gluQuadricTexture(obj, true);
+ dorepaint = true;
+ }
+ }
+ else if (c.equals(MENU_UNTEXTURED))
+ {
+ textured = false;
+ gl.glDisable(GL_TEXTURE_2D);
+ glu.gluQuadricTexture(obj, false);
+ dorepaint = true;
+ }
+ else if (c.equals(MENU_TRANSPARENT))
+ {
+ transparent = true;
+ dorepaint = true;
+ }
+ else if (c.equals(MENU_OPAQUE))
+ {
+ transparent = false;
+ dorepaint = true;
+ }
+ else if (c.equals(MENU_RIGHT_LIGHT_ON))
+ {
+ gl.glEnable(GL_LIGHT0);
+ dorepaint = true;
+ }
+ else if (c.equals(MENU_RIGHT_LIGHT_OFF))
+ {
+ gl.glDisable(GL_LIGHT0);
+ dorepaint = true;
+ }
+ else if (c.equals(MENU_LEFT_LIGHT_ON))
+ {
+ gl.glEnable(GL_LIGHT1);
+ dorepaint = true;
+ }
+ else if (c.equals(MENU_LEFT_LIGHT_OFF))
+ {
+ gl.glDisable(GL_LIGHT1);
+ dorepaint = true;
+ }
+ else if (c.equals(MENU_PAUSE))
+ {
+ if (menu_showing)
+ save_suspended = true;
+ else
+ setSuspended(true);
+ }
+ else if (c.equals(MENU_RESUME))
+ {
+ if (menu_showing)
+ save_suspended = false;
+ else
+ setSuspended(false);
+ }
+ else if (c.equals(MENU_SPEED_UP))
+ {
+ crank_step++;
+ if (crank_step > 45) crank_step = 45;
+ }
+ else if (c.equals(MENU_SLOW_DOWN))
+ {
+ crank_step--;
+ if (crank_step < 1) crank_step = 1;
+ }
+ if (menu_showing)
+ {
+ menu_showing = false;
+ setSuspended(save_suspended);
+ }
+ glj.gljFree();
+ if (dorepaint) repaint();
+ }
+
+ // Methods required for the implementation of KeyListener
+ public void keyPressed(KeyEvent e)
+ {
+ switch (e.getKeyCode())
+ {
+ case KeyEvent.VK_LEFT:
+ view_h -= ANGLE_STEP;
+ while (view_h < 0) view_h += 360;
+ repaint();
+ break;
+ case KeyEvent.VK_RIGHT:
+ view_h += ANGLE_STEP;
+ while (view_h >= 360) view_h -= 360;
+ repaint();
+ break;
+ case KeyEvent.VK_UP:
+ view_v += ANGLE_STEP;
+ while (view_v >= 360) view_v -= 360;
+ repaint();
+ break;
+ case KeyEvent.VK_DOWN:
+ view_v -= ANGLE_STEP;
+ while (view_v < 0) view_v += 360;
+ repaint();
+ break;
+ }
+ }
+
+ public void keyReleased(KeyEvent e)
+ {
+ }
+
+ public void keyTyped(KeyEvent e)
+ {
+ if (glj.gljMakeCurrent() == false) return;
+ boolean dorepaint = false;
+ switch ((char)e.getKeyChar())
+ {
+ case 'a':
+ case 'A':
+ if (!isSuspended()) break;
+ crank_angle += crank_step;
+ while (crank_angle >= 360) crank_angle -= 360;
+ head_angle = head_look_up_table[crank_angle];
+ dorepaint = true;
+ break;
+ case 'z':
+ case 'Z':
+ if (!isSuspended()) break;
+ crank_angle -= crank_step;
+ while (crank_angle < 0) crank_angle += 360;
+ head_angle = head_look_up_table[crank_angle];
+ dorepaint = true;
+ break;
+ case '+':
+ crank_step++;
+ if (crank_step > 45) crank_step = 45;
+ break;
+ case '-':
+ crank_step--;
+ if (crank_step < 1) crank_step = 1;
+ break;
+ }
+ glj.gljFree();
+ if (dorepaint) repaint();
+ }
+
+ /* Draws a box by scaling a glut cube of size 1.
+ Also checks the filled toggle to see which rendering
+ style to use. NB Texture doesn't work correctly due
+ to the cube being scaled. */
+ private void myBox(float x, float y, float z)
+ {
+ gl.glPushMatrix();
+ gl.glScalef(x, y, z);
+ if (filled)
+ glutSolidCube(1);
+ else
+ glutWireCube(1);
+ gl.glPopMatrix();
+ }
+
+ /* Draws a cylinder using glu function, drawing flat discs
+ at each end, to give the appearence of it being solid. */
+ private void myCylinder
+ (int object, float outerRadius, float innerRadius, float length)
+ {
+ gl.glPushMatrix();
+ glu.gluCylinder(object, outerRadius, outerRadius, length, 20, 1);
+ gl.glPushMatrix();
+ gl.glRotatef(180.0f, 0.0f, 1.0f, 0.0f);
+ glu.gluDisk(object, innerRadius, outerRadius, 20, 1);
+ gl.glPopMatrix();
+ gl.glTranslatef(0.0f, 0.0f, length);
+ glu.gluDisk(object, innerRadius, outerRadius, 20, 1);
+ gl.glPopMatrix();
+ }
+
+ /* Draws a piston. */
+ private void draw_piston()
+ {
+ gl.glPushMatrix();
+ gl.glColor4f(0.3f, 0.6f, 0.9f, 1.0f);
+ gl.glPushMatrix();
+ gl.glRotatef(90.0f, 0.0f, 1.0f, 0.0f);
+ gl.glTranslatef(0.0f, 0.0f, -0.07f);
+ myCylinder(obj, 0.125f, 0.06f, 0.12f);
+ gl.glPopMatrix();
+ gl.glRotatef(-90.0f, 1.0f, 0.0f, 0.0f);
+ gl.glTranslatef(0.0f, 0.0f, 0.05f);
+ myCylinder(obj, 0.06f, 0.0f, 0.6f);
+ gl.glTranslatef(0.0f, 0.0f, 0.6f);
+ myCylinder(obj, 0.2f, 0.0f, 0.5f);
+ gl.glPopMatrix();
+ }
+
+ /* Draws the engine pole and the
+ pivot pole for the cylinder head. */
+ private void draw_engine_pole()
+ {
+ gl.glPushMatrix();
+ gl.glColor4f(0.9f, 0.9f, 0.9f, 1.0f);
+ myBox(0.5f, 3.0f, 0.5f);
+ gl.glColor3f(0.5f, 0.1f, 0.5f);
+ gl.glRotatef(90.0f, 0.0f, 1.0f, 0.0f);
+ gl.glTranslatef(0.0f, 0.9f, -0.4f);
+ myCylinder(obj, 0.1f, 0.0f, 2);
+ gl.glPopMatrix();
+ }
+
+ /* Draws the cylinder head at the appropreate angle, doing
+ the necessary translations for the rotation. */
+ private void draw_cylinder_head()
+ {
+ gl.glPushMatrix();
+ gl.glColor4f(0.5f, 1.0f, 0.5f, 0.1f);
+ gl.glRotatef(90.0f, 1.0f, 0.0f, 0.0f);
+ gl.glTranslatef(0.0f, 0.0f, 0.4f);
+ gl.glRotatef(head_angle, 1.0f, 0.0f, 0.0f);
+ gl.glTranslatef(0.0f, 0.0f, -0.4f);
+ myCylinder(obj, 0.23f, 0.21f, 1.6f);
+ gl.glRotatef(180.0f, 1.0f, 0.0f, 0.0f);
+ glu.gluDisk(obj, 0.0f, 0.23f, 20, 1);
+ gl.glPopMatrix();
+ }
+
+ /* Draws the flywheel. */
+ private void draw_flywheel()
+ {
+ gl.glPushMatrix();
+ gl.glColor4f(0.5f, 0.5f, 1.0f, 1.0f);
+ gl.glRotatef(90.0f, 0.0f, 1.0f, 0.0f);
+ myCylinder(obj, 0.625f, 0.08f, 0.5f);
+ gl.glPopMatrix();
+ }
+
+/* Draws the crank bell, and the pivot pin for the piston. Also calls the
+ appropreate display list of a piston doing the nesacary rotations before
+ hand. */
+ private void draw_crankbell()
+ {
+ gl.glPushMatrix();
+ gl.glColor4f(1.0f, 0.5f, 0.5f, 1.0f);
+ gl.glRotatef(90.0f, 0.0f, 1.0f, 0.0f);
+ myCylinder(obj, 0.3f, 0.08f, 0.12f);
+
+ gl.glColor4f(0.5f, 0.1f, 0.5f, 1.0f);
+ gl.glTranslatef(0.0f, 0.2f, 0.0f);
+ myCylinder(obj, 0.06f, 0.0f, 0.34f);
+
+ gl.glTranslatef(0.0f, 0.0f, 0.22f);
+ gl.glRotatef(90.0f, 0.0f, 1.0f, 0.0f);
+ gl.glRotatef(((float)crank_angle)-head_angle, 1.0f, 0.0f, 0.0f);
+ if (filled)
+ {
+ if (textured)
+ gl.glCallList(list_piston_texture);
+ else
+ gl.glCallList(list_piston_filled);
+ }
+ else
+ draw_piston();
+ gl.glPopMatrix();
+ }
+
+ /* Draws the complete crank. Piston also gets drawn through
+ the crank bell function. */
+ private void draw_crank()
+ {
+ gl.glPushMatrix();
+ gl.glRotatef(crank_angle, 1.0f, 0.0f, 0.0f);
+
+ gl.glPushMatrix();
+ gl.glRotatef(90.0f, 0.0f, 1.0f, 0.0f);
+ gl.glTranslatef(0.0f, 0.0f, -1.0f);
+ myCylinder(obj, 0.08f, 0.0f, 1.4f);
+ gl.glPopMatrix();
+
+ gl.glPushMatrix();
+ gl.glTranslatef(0.28f, 0.0f, 0.0f);
+ draw_crankbell();
+ gl.glPopMatrix();
+
+ gl.glPushMatrix();
+ gl.glTranslatef(-0.77f, 0.0f, 0.0f);
+ if (filled)
+ {
+ if (textured)
+ gl.glCallList(list_flywheel_texture);
+ else
+ gl.glCallList(list_flywheel_filled);
+ }
+ else
+ draw_flywheel();
+ gl.glPopMatrix();
+ gl.glPopMatrix();
+ }
+
+ /* Makes a simple checkered pattern image. (Copied from the
+ redbook example "checker.c".) */
+ private void make_image()
+ {
+ int c, idx = 0;
+ for (int i = 0; i < IMAGE_WIDTH; i++)
+ {
+ for (int j = 0; j < IMAGE_HEIGHT; j++)
+ {
+ c = ((((i & 0x8) == 0) ^ ((j & 0x8)) == 0)) ? 255 : 0;
+ image[idx++] = (byte)c;
+ image[idx++] = (byte)c;
+ image[idx++] = (byte)c;
+ }
+ }
+ }
+
+ /* Makes the head lookup table for all possible crank angles. */
+ private void make_table()
+ {
+ for (int i = 0; i < 360; i++)
+ {
+ float rads = PHASE-(((float)i)/FREQ_DIV);
+ head_look_up_table[i] =
+ MAGNITUDE *
+ (float)Math.atan
+ ((ARC_RADIUS*Math.sin(rads)) /
+ (ARC_LENGTH-(ARC_RADIUS*Math.cos(rads))));
+ }
+ }
+
+ // Imported from glut.
+ private void glutWireCube(float size)
+ {
+ drawBox(size, GL_LINE_LOOP);
+ }
+
+ // Imported from glut.
+ private void glutSolidCube(float size)
+ {
+ drawBox(size, GL_QUADS);
+ }
+
+ // Imported from glut.
+ private void drawBox(float size, int type)
+ {
+ float v[][] = new float[8][3];
+ int i;
+
+ v[0][0] = v[1][0] = v[2][0] = v[3][0] = -size / 2;
+ v[4][0] = v[5][0] = v[6][0] = v[7][0] = size / 2;
+ v[0][1] = v[1][1] = v[4][1] = v[5][1] = -size / 2;
+ v[2][1] = v[3][1] = v[6][1] = v[7][1] = size / 2;
+ v[0][2] = v[3][2] = v[4][2] = v[7][2] = -size / 2;
+ v[1][2] = v[2][2] = v[5][2] = v[6][2] = size / 2;
+
+ for (i = 5; i >= 0; i--)
+ {
+ gl.glBegin(type);
+ gl.glNormal3fv(boxnormals[i]);
+ gl.glVertex3fv(v[boxfaces[i][0]]);
+ gl.glVertex3fv(v[boxfaces[i][1]]);
+ gl.glVertex3fv(v[boxfaces[i][2]]);
+ gl.glVertex3fv(v[boxfaces[i][3]]);
+ gl.glEnd();
+ }
+ }
+ }
+}
diff --git a/demos/RonsDemos/steam_plugin13.html b/demos/RonsDemos/steam_plugin13.html new file mode 100644 index 0000000..252422e --- /dev/null +++ b/demos/RonsDemos/steam_plugin13.html @@ -0,0 +1,53 @@ +<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.61 [en] (Win98; U) [Netscape]">
+ <title>Steam by Troy Robinette; ported to Java by Ron Cemer</title>
+</head>
+<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#e6e6ff">
+Steam applet
+<br>Originially written by Troy Robinette
+<br>Ported to Java by Ron Cemer
+<br>Right click within the window for a menu of options.
+<br>Left-click within the window, then press any of the following keys:
+<br>Arrow keys rotate the model.
+<br>+ and - keys speed up or slow down the simulation.
+<br>While paused, a and z keys single-step forward and backward.
+<br>
+<!--"CONVERTED_APPLET"-->
+<!-- CONVERTER VERSION 1.3 --> +<SCRIPT LANGUAGE="JavaScript"><!-- + var _info = navigator.userAgent; var _ns = false; + var _ie = (_info.indexOf("MSIE") > 0 && _info.indexOf("Win") > 0 && _info.indexOf("Windows 3.1") < 0); +//--></SCRIPT> +<COMMENT><SCRIPT LANGUAGE="JavaScript1.1"><!-- + var _ns = (navigator.appName.indexOf("Netscape") >= 0 && ((_info.indexOf("Win") > 0 && _info.indexOf("Win16") < 0 && java.lang.System.getProperty("os.version").indexOf("3.5") < 0) || (_info.indexOf("Sun") > 0) || (_info.indexOf("Linux") > 0))); +//--></SCRIPT></COMMENT> + +<SCRIPT LANGUAGE="JavaScript"><!-- + if (_ie == true) document.writeln('<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" WIDTH = 400 HEIGHT = 400 codebase="http://java.sun.com/products/plugin/1.3/jinstall-13-win32.cab#Version=1,3,0,0"><NOEMBED><XMP>'); + else if (_ns == true) document.writeln('<EMBED type="application/x-java-applet;version=1.3" CODE = "steam.class" WIDTH = 400 HEIGHT = 400 scriptable=false pluginspage="http://java.sun.com/products/plugin/1.3/plugin-install.html"><NOEMBED><XMP>'); +//--></SCRIPT> +<APPLET CODE = "steam.class" WIDTH = 400 HEIGHT = 400></XMP> +<PARAM NAME = CODE VALUE = "steam.class" >
+ +<PARAM NAME="type" VALUE="application/x-java-applet;version=1.3"> +<PARAM NAME="scriptable" VALUE="false"> + +</APPLET> + +</NOEMBED></EMBED></OBJECT> + + +<!-- +<APPLET CODE = "steam.class" WIDTH = 400 HEIGHT = 400>
+
+
+</APPLET> +--> +<!--"END_CONVERTED_APPLET"-->
+
+<hr>
+</body>
+</html>
diff --git a/demos/RonsDemos/surface.html b/demos/RonsDemos/surface.html new file mode 100644 index 0000000..fa384a5 --- /dev/null +++ b/demos/RonsDemos/surface.html @@ -0,0 +1,18 @@ +<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.61 [en] (Win98; U) [Netscape]">
+ <title>Surface by Silicon Graphics; ported to Java by Ron Cemer</title>
+</head>
+<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#e6e6ff">
+Surface applet
+<br>Originially written by Silicon Graphics
+<br>Ported to Java by Ron Cemer
+<br>Click inside the window to toggle visibility of the control points.
+<br>
+<applet code="surface.class" width=400 height=400>
+</applet>
+<hr>
+</body>
+</html>
diff --git a/demos/RonsDemos/surface.java b/demos/RonsDemos/surface.java new file mode 100644 index 0000000..2d959b8 --- /dev/null +++ b/demos/RonsDemos/surface.java @@ -0,0 +1,263 @@ +/**
+ * @(#) surface.java
+ * @(#) author: Silicon Graphics (converted to Java by Ron Cemer)
+ */
+
+/*
+ * Copyright (c) 1993-1997, Silicon Graphics, Inc.
+ * ALL RIGHTS RESERVED
+ * Permission to use, copy, modify, and distribute this software for
+ * any purpose and without fee is hereby granted, provided that the above
+ * copyright notice appear in all copies and that both the copyright notice
+ * and this permission notice appear in supporting documentation, and that
+ * the name of Silicon Graphics, Inc. not be used in advertising
+ * or publicity pertaining to distribution of the software without specific,
+ * written prior permission.
+ *
+ * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
+ * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
+ * FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
+ * GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT,
+ * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY
+ * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION,
+ * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF
+ * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN
+ * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
+ * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * US Government Users Restricted Rights
+ * Use, duplication, or disclosure by the Government is subject to
+ * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
+ * (c)(1)(ii) of the Rights in Technical Data and Computer Software
+ * clause at DFARS 252.227-7013 and/or in similar or successor
+ * clauses in the FAR or the DOD or NASA FAR Supplement.
+ * Unpublished-- rights reserved under the copyright laws of the
+ * United States. Contractor/manufacturer is Silicon Graphics,
+ * Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311.
+ *
+ * OpenGL(R) is a registered trademark of Silicon Graphics, Inc.
+ */
+
+/*
+ * This program draws a NURBS surface in the shape of a
+ * symmetrical hill. The 'c' keyboard key allows you to
+ * toggle the visibility of the control points themselves.
+ * Note that some of the control points are hidden by the
+ * surface itself.
+ */
+
+import java.applet.*;
+import java.awt.*;
+import java.awt.event.*;
+import java.lang.*;
+import java.util.*;
+import java.io.*;
+import java.util.*;
+import gl4java.GLContext;
+import gl4java.awt.GLCanvas;
+
+public class surface extends Applet
+{
+ surfaceCanvas canvas = null;
+
+
+ /* Initialize the applet */
+
+
+ public void init()
+ {
+ Dimension d = getSize();
+ setLayout(new BorderLayout());
+ canvas = new surfaceCanvas(d.width, d.height);
+ add("Center", canvas);
+ }
+
+
+ /* Start the applet */
+
+
+ public void start()
+ {
+ }
+
+
+ /* Stop the applet */
+
+
+ public void stop()
+ {
+ }
+
+
+ /* Destroy the applet */
+
+
+
+ /* Local GLCanvas extension class */
+
+
+ private class surfaceCanvas extends GLCanvas implements MouseListener
+ {
+ float ctlpoints[] = new float [4*4*3];
+ boolean showPoints = false;
+ int theNurb;
+
+ public surfaceCanvas(int w, int h)
+ {
+ super(w, h);
+ GLContext.gljNativeDebug = false;
+ GLContext.gljClassDebug = false;
+ }
+
+ public void preInit()
+ {
+ doubleBuffer = true;
+ stereoView = false;
+ }
+
+ public void init()
+ {
+ System.out.println("init(): " + this);
+ reshape(getSize().width, getSize().height);
+
+ float mat_diffuse[] = { 0.7f, 0.7f, 0.7f, 1.0f };
+ float mat_specular[] = { 1.0f, 1.0f, 1.0f, 1.0f };
+ float mat_shininess[] = { 100.0f };
+
+ gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
+ gl.glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse);
+ gl.glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular);
+ gl.glMaterialfv(GL_FRONT, GL_SHININESS, mat_shininess);
+
+ gl.glEnable(GL_LIGHTING);
+ gl.glEnable(GL_LIGHT0);
+ gl.glEnable(GL_DEPTH_TEST);
+ gl.glEnable(GL_AUTO_NORMAL);
+ gl.glEnable(GL_NORMALIZE);
+
+ init_surface();
+
+ theNurb = glu.gluNewNurbsRenderer();
+ glu.gluNurbsProperty(theNurb, GLU_SAMPLING_TOLERANCE, 25.0f);
+ glu.gluNurbsProperty(theNurb, GLU_DISPLAY_MODE, GLU_FILL);
+
+ glj.gljCheckGL();
+
+ addMouseListener(this);
+ }
+
+ public void cvsDispose()
+ {
+ System.out.println("destroy(): " + this);
+ removeMouseListener(this);
+ super.cvsDispose();
+ }
+
+ public void reshape(int width, int height)
+ {
+ gl.glViewport(0,0,width,height);
+ gl.glMatrixMode(GL_PROJECTION);
+ gl.glLoadIdentity();
+ glu.gluPerspective(45.0f,(double)width/(double)height,3.0f,8.0f);
+ gl.glMatrixMode(GL_MODELVIEW);
+ gl.glLoadIdentity();
+ gl.glTranslatef(0.0f, 0.0f, -5.0f);
+ }
+
+ public void display()
+ {
+ if (glj.gljMakeCurrent() == false) return;
+
+ float knots[] = {0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f, 1.0f};
+ int i, j;
+
+ gl.glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+ gl.glPushMatrix();
+ gl.glRotatef(330.0f, 1.0f,0.0f,0.0f);
+ gl.glScalef (0.5f, 0.5f, 0.5f);
+
+ glu.gluBeginSurface(theNurb);
+ glu.gluNurbsSurface
+ (theNurb,
+ 8,
+ knots,
+ 8,
+ knots,
+ (4 * 3),
+ 3,
+ ctlpoints,
+ 4,
+ 4,
+ GL_MAP2_VERTEX_3);
+ glu.gluEndSurface(theNurb);
+
+ if (showPoints)
+ {
+ gl.glPointSize(5.0f);
+ gl.glDisable(GL_LIGHTING);
+ gl.glColor3f(1.0f, 1.0f, 0.0f);
+ gl.glBegin(GL_POINTS);
+ for (i = 0; i < 4; i++)
+ {
+ for (j = 0; j < 4; j++)
+ {
+ gl.glVertex3f
+ (ctlpoints[(i*12)+(j*3)+0],
+ ctlpoints[(i*12)+(j*3)+1],
+ ctlpoints[(i*12)+(j*3)+2]);
+ }
+ }
+ gl.glEnd();
+ gl.glEnable(GL_LIGHTING);
+ }
+ gl.glPopMatrix();
+ gl.glFlush();
+
+ glj.gljSwap();
+ glj.gljCheckGL();
+ glj.gljFree();
+ }
+
+ private void init_surface()
+ {
+ for (int u = 0; u < 4; u++)
+ {
+ for (int v = 0; v < 4; v++)
+ {
+ ctlpoints[(u*12)+(v*3)+0] = 2.0f*((float)u - 1.5f);
+ ctlpoints[(u*12)+(v*3)+1] = 2.0f*((float)v - 1.5f);
+ if ( (u == 1 || u == 2) && (v == 1 || v == 2) )
+ ctlpoints[(u*12)+(v*3)+2] = 3.0f;
+ else
+ ctlpoints[(u*12)+(v*3)+2] = -3.0f;
+ }
+ }
+ }
+
+ // Methods required for the implementation of MouseListener
+ public void mouseEntered( MouseEvent evt )
+ {
+ }
+
+ public void mouseExited( MouseEvent evt )
+ {
+ }
+
+ public void mousePressed( MouseEvent evt )
+ {
+ showPoints = !showPoints;
+ repaint();
+ }
+
+ public void mouseReleased( MouseEvent evt )
+ {
+ }
+
+ public void mouseClicked( MouseEvent evt )
+ {
+ }
+ }
+}
diff --git a/demos/RonsDemos/surface_plugin13.html b/demos/RonsDemos/surface_plugin13.html new file mode 100644 index 0000000..711d650 --- /dev/null +++ b/demos/RonsDemos/surface_plugin13.html @@ -0,0 +1,49 @@ +<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.61 [en] (Win98; U) [Netscape]">
+ <title>Surface by Silicon Graphics; ported to Java by Ron Cemer</title>
+</head>
+<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#e6e6ff">
+Surface applet
+<br>Originially written by Silicon Graphics
+<br>Ported to Java by Ron Cemer
+<br>Click inside the window to toggle visibility of the control points.
+<br>
+<!--"CONVERTED_APPLET"-->
+<!-- CONVERTER VERSION 1.3 --> +<SCRIPT LANGUAGE="JavaScript"><!-- + var _info = navigator.userAgent; var _ns = false; + var _ie = (_info.indexOf("MSIE") > 0 && _info.indexOf("Win") > 0 && _info.indexOf("Windows 3.1") < 0); +//--></SCRIPT> +<COMMENT><SCRIPT LANGUAGE="JavaScript1.1"><!-- + var _ns = (navigator.appName.indexOf("Netscape") >= 0 && ((_info.indexOf("Win") > 0 && _info.indexOf("Win16") < 0 && java.lang.System.getProperty("os.version").indexOf("3.5") < 0) || (_info.indexOf("Sun") > 0) || (_info.indexOf("Linux") > 0))); +//--></SCRIPT></COMMENT> + +<SCRIPT LANGUAGE="JavaScript"><!-- + if (_ie == true) document.writeln('<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" WIDTH = 400 HEIGHT = 400 codebase="http://java.sun.com/products/plugin/1.3/jinstall-13-win32.cab#Version=1,3,0,0"><NOEMBED><XMP>'); + else if (_ns == true) document.writeln('<EMBED type="application/x-java-applet;version=1.3" CODE = "surface.class" WIDTH = 400 HEIGHT = 400 scriptable=false pluginspage="http://java.sun.com/products/plugin/1.3/plugin-install.html"><NOEMBED><XMP>'); +//--></SCRIPT> +<APPLET CODE = "surface.class" WIDTH = 400 HEIGHT = 400></XMP> +<PARAM NAME = CODE VALUE = "surface.class" >
+ +<PARAM NAME="type" VALUE="application/x-java-applet;version=1.3"> +<PARAM NAME="scriptable" VALUE="false"> + +</APPLET> + +</NOEMBED></EMBED></OBJECT> + + +<!-- +<APPLET CODE = "surface.class" WIDTH = 400 HEIGHT = 400>
+
+
+</APPLET> +--> +<!--"END_CONVERTED_APPLET"-->
+
+<hr>
+</body>
+</html>
diff --git a/demos/RonsDemos/teapots.html b/demos/RonsDemos/teapots.html new file mode 100644 index 0000000..834c206 --- /dev/null +++ b/demos/RonsDemos/teapots.html @@ -0,0 +1,17 @@ +<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.61 [en] (Win98; U) [Netscape]">
+ <title>Teapots by Silicon Graphics; ported to Java by Ron Cemer</title>
+</head>
+<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#e6e6ff">
+Teapots applet
+<br>Originially written by Silicon Graphics
+<br>Ported to Java by Ron Cemer
+<br>
+<applet code="teapots.class" width=400 height=400>
+</applet>
+<hr>
+</body>
+</html>
diff --git a/demos/RonsDemos/teapots.java b/demos/RonsDemos/teapots.java new file mode 100644 index 0000000..c59945a --- /dev/null +++ b/demos/RonsDemos/teapots.java @@ -0,0 +1,465 @@ +/**
+ * @(#) teapots.java
+ * @(#) author: Silicon Graphics, Inc. (converted to Java by Ron Cemer)
+ */
+
+/*
+ * Copyright (c) 1993-1997, Silicon Graphics, Inc.
+ * ALL RIGHTS RESERVED
+ * Permission to use, copy, modify, and distribute this software for
+ * any purpose and without fee is hereby granted, provided that the above
+ * copyright notice appear in all copies and that both the copyright notice
+ * and this permission notice appear in supporting documentation, and that
+ * the name of Silicon Graphics, Inc. not be used in advertising
+ * or publicity pertaining to distribution of the software without specific,
+ * written prior permission.
+ *
+ * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
+ * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
+ * FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
+ * GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT,
+ * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY
+ * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION,
+ * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF
+ * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN
+ * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
+ * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * US Government Users Restricted Rights
+ * Use, duplication, or disclosure by the Government is subject to
+ * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
+ * (c)(1)(ii) of the Rights in Technical Data and Computer Software
+ * clause at DFARS 252.227-7013 and/or in similar or successor
+ * clauses in the FAR or the DOD or NASA FAR Supplement.
+ * Unpublished-- rights reserved under the copyright laws of the
+ * United States. Contractor/manufacturer is Silicon Graphics,
+ * Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311.
+ *
+ * OpenGL(R) is a registered trademark of Silicon Graphics, Inc.
+ */
+
+/*
+ * This program demonstrates lots of material properties.
+ * A single light source illuminates the objects.
+ */
+
+import java.applet.*;
+import java.awt.*;
+import java.awt.event.*;
+import java.lang.*;
+import java.util.*;
+import java.io.*;
+import java.util.*;
+import gl4java.GLContext;
+import gl4java.awt.GLCanvas;
+
+public class teapots extends Applet
+{
+ // Data for drawing teapots:
+ /* Rim, body, lid, and bottom data must be reflected in x and
+ y; handle and spout data across the y axis only. */
+ private static final int patchdata[][] =
+ {
+ /* rim */
+ {102, 103, 104, 105, 4, 5, 6, 7, 8, 9, 10, 11,
+ 12, 13, 14, 15},
+ /* body */
+ {12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
+ 24, 25, 26, 27},
+ {24, 25, 26, 27, 29, 30, 31, 32, 33, 34, 35, 36,
+ 37, 38, 39, 40},
+ /* lid */
+ {96, 96, 96, 96, 97, 98, 99, 100, 101, 101, 101,
+ 101, 0, 1, 2, 3,},
+ {0, 1, 2, 3, 106, 107, 108, 109, 110, 111, 112,
+ 113, 114, 115, 116, 117},
+ /* bottom */
+ {118, 118, 118, 118, 124, 122, 119, 121, 123, 126,
+ 125, 120, 40, 39, 38, 37},
+ /* handle */
+ {41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
+ 53, 54, 55, 56},
+ {53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
+ 28, 65, 66, 67},
+ /* spout */
+ {68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
+ 80, 81, 82, 83},
+ {80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91,
+ 92, 93, 94, 95}
+ };
+ private static final float cpdata[][] =
+ {
+ {0.2f, 0.0f, 2.7f}, {0.2f, -0.112f, 2.7f}, {0.112f, -0.2f, 2.7f}, {0.0f,
+ -0.2f, 2.7f}, {1.3375f, 0.0f, 2.53125f}, {1.3375f, -0.749f, 2.53125f},
+ {0.749f, -1.3375f, 2.53125f}, {0.0f, -1.3375f, 2.53125f}, {1.4375f,
+ 0.0f, 2.53125f}, {1.4375f, -0.805f, 2.53125f}, {0.805f, -1.4375f,
+ 2.53125f}, {0.0f, -1.4375f, 2.53125f}, {1.5f, 0.0f, 2.4f}, {1.5f, -0.84f,
+ 2.4f}, {0.84f, -1.5f, 2.4f}, {0.0f, -1.5f, 2.4f}, {1.75f, 0.0f, 1.875f},
+ {1.75f, -0.98f, 1.875f}, {0.98f, -1.75f, 1.875f}, {0.0f, -1.75f,
+ 1.875f}, {2f, 0.0f, 1.35f}, {2f, -1.12f, 1.35f}, {1.12f, -2f, 1.35f},
+ {0.0f, -2f, 1.35f}, {2f, 0.0f, 0.9f}, {2f, -1.12f, 0.9f}, {1.12f, -2f,
+ 0.9f}, {0.0f, -2f, 0.9f}, {-2f, 0.0f, 0.9f}, {2f, 0.0f, 0.45f}, {2f, -1.12f,
+ 0.45f}, {1.12f, -2f, 0.45f}, {0.0f, -2f, 0.45f}, {1.5f, 0.0f, 0.225f},
+ {1.5f, -0.84f, 0.225f}, {0.84f, -1.5f, 0.225f}, {0.0f, -1.5f, 0.225f},
+ {1.5f, 0.0f, 0.15f}, {1.5f, -0.84f, 0.15f}, {0.84f, -1.5f, 0.15f}, {0.0f,
+ -1.5f, 0.15f}, {-1.6f, 0.0f, 2.025f}, {-1.6f, -0.3f, 2.025f}, {-1.5f,
+ -0.3f, 2.25f}, {-1.5f, 0.0f, 2.25f}, {-2.3f, 0.0f, 2.025f}, {-2.3f, -0.3f,
+ 2.025f}, {-2.5f, -0.3f, 2.25f}, {-2.5f, 0.0f, 2.25f}, {-2.7f, 0.0f,
+ 2.025f}, {-2.7f, -0.3f, 2.025f}, {-3f, -0.3f, 2.25f}, {-3f, 0.0f,
+ 2.25f}, {-2.7f, 0.0f, 1.8f}, {-2.7f, -0.3f, 1.8f}, {-3f, -0.3f, 1.8f},
+ {-3f, 0.0f, 1.8f}, {-2.7f, 0.0f, 1.575f}, {-2.7f, -0.3f, 1.575f}, {-3f,
+ -0.3f, 1.35f}, {-3f, 0.0f, 1.35f}, {-2.5f, 0.0f, 1.125f}, {-2.5f, -0.3f,
+ 1.125f}, {-2.65f, -0.3f, 0.9375f}, {-2.65f, 0.0f, 0.9375f}, {-2f,
+ -0.3f, 0.9f}, {-1.9f, -0.3f, 0.6f}, {-1.9f, 0.0f, 0.6f}, {1.7f, 0.0f,
+ 1.425f}, {1.7f, -0.66f, 1.425f}, {1.7f, -0.66f, 0.6f}, {1.7f, 0.0f,
+ 0.6f}, {2.6f, 0.0f, 1.425f}, {2.6f, -0.66f, 1.425f}, {3.1f, -0.66f,
+ 0.825f}, {3.1f, 0.0f, 0.825f}, {2.3f, 0.0f, 2.1f}, {2.3f, -0.25f, 2.1f},
+ {2.4f, -0.25f, 2.025f}, {2.4f, 0.0f, 2.025f}, {2.7f, 0.0f, 2.4f}, {2.7f,
+ -0.25f, 2.4f}, {3.3f, -0.25f, 2.4f}, {3.3f, 0.0f, 2.4f}, {2.8f, 0.0f,
+ 2.475f}, {2.8f, -0.25f, 2.475f}, {3.525f, -0.25f, 2.49375f},
+ {3.525f, 0.0f, 2.49375f}, {2.9f, 0.0f, 2.475f}, {2.9f, -0.15f, 2.475f},
+ {3.45f, -0.15f, 2.5125f}, {3.45f, 0.0f, 2.5125f}, {2.8f, 0.0f, 2.4f},
+ {2.8f, -0.15f, 2.4f}, {3.2f, -0.15f, 2.4f}, {3.2f, 0.0f, 2.4f}, {0.0f, 0.0f,
+ 3.15f}, {0.8f, 0.0f, 3.15f}, {0.8f, -0.45f, 3.15f}, {0.45f, -0.8f,
+ 3.15f}, {0.0f, -0.8f, 3.15f}, {0.0f, 0.0f, 2.85f}, {1.4f, 0.0f, 2.4f}, {1.4f,
+ -0.784f, 2.4f}, {0.784f, -1.4f, 2.4f}, {0.0f, -1.4f, 2.4f}, {0.4f, 0.0f,
+ 2.55f}, {0.4f, -0.224f, 2.55f}, {0.224f, -0.4f, 2.55f}, {0.0f, -0.4f,
+ 2.55f}, {1.3f, 0.0f, 2.55f}, {1.3f, -0.728f, 2.55f}, {0.728f, -1.3f,
+ 2.55f}, {0.0f, -1.3f, 2.55f}, {1.3f, 0.0f, 2.4f}, {1.3f, -0.728f, 2.4f},
+ {0.728f, -1.3f, 2.4f}, {0.0f, -1.3f, 2.4f}, {0.0f, 0.0f, 0.0f}, {1.425f,
+ -0.798f, 0.0f}, {1.5f, 0.0f, 0.075f}, {1.425f, 0.0f, 0.0f}, {0.798f, -1.425f,
+ 0.0f}, {0.0f, -1.5f, 0.075f}, {0.0f, -1.425f, 0.0f}, {1.5f, -0.84f, 0.075f},
+ {0.84f, -1.5f, 0.075f}
+ };
+ private static final float tex[] =
+ {
+ 0.0f, 0.0f,
+ 1.0f, 0.0f,
+ 0.0f, 1.0f,
+ 1.0f, 1.0f
+ };
+
+ teapotsCanvas canvas = null;
+
+
+ /* Initialize the applet */
+
+
+ public void init()
+ {
+ Dimension d = getSize();
+ setLayout(new BorderLayout());
+ canvas = new teapotsCanvas(d.width, d.height);
+ add("Center", canvas);
+ }
+
+
+ /* Start the applet */
+
+
+ public void start()
+ {
+ }
+
+
+ /* Stop the applet */
+
+
+ public void stop()
+ {
+ }
+
+ public static void main( String args[] )
+ {
+ Frame mainFrame = new Frame("teapots");
+
+ teapots applet = new teapots();
+
+ applet.setSize(400, 400);
+ applet.init();
+ applet.start();
+
+ mainFrame.add(applet);
+
+ mainFrame.pack();
+ mainFrame.setVisible(true);
+ }
+
+
+ /* Local GLCanvas extension class */
+
+
+ private class teapotsCanvas extends GLCanvas
+ {
+ int teapotList;
+
+ public teapotsCanvas(int w, int h)
+ {
+ super(w, h);
+ GLContext.gljNativeDebug = false;
+ GLContext.gljClassDebug = false;
+ }
+
+ public void preInit()
+ {
+ doubleBuffer = true;
+ stereoView = false;
+ }
+
+ public void init()
+ {
+ System.out.println("init(): " + this);
+ reshape(getSize().width, getSize().height);
+
+ float ambient[] = {0.0f, 0.0f, 0.0f, 1.0f};
+ float diffuse[] = {1.0f, 1.0f, 1.0f, 1.0f};
+ float specular[] = {1.0f, 1.0f, 1.0f, 1.0f};
+ float position[] = {0.0f, 3.0f, 3.0f, 0.0f};
+
+ float lmodel_ambient[] = {0.2f, 0.2f, 0.2f, 1.0f};
+ float local_view[] = {0.0f};
+
+ gl.glLightfv(GL_LIGHT0, GL_AMBIENT, ambient);
+ gl.glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse);
+ gl.glLightfv(GL_LIGHT0, GL_POSITION, position);
+ gl.glLightModelfv(GL_LIGHT_MODEL_AMBIENT, lmodel_ambient);
+ gl.glLightModelfv(GL_LIGHT_MODEL_LOCAL_VIEWER, local_view);
+
+ gl.glFrontFace(GL_CW);
+ gl.glEnable(GL_LIGHTING);
+ gl.glEnable(GL_LIGHT0);
+ gl.glEnable(GL_AUTO_NORMAL);
+ gl.glEnable(GL_NORMALIZE);
+ gl.glEnable(GL_DEPTH_TEST);
+ /* be efficient--make teapot display list */
+ teapotList = gl.glGenLists(1);
+ gl.glNewList(teapotList, GL_COMPILE);
+ glutSolidTeapot(1.0);
+ gl.glEndList();
+
+ glj.gljCheckGL();
+ }
+
+ public void reshape(int width, int height)
+ {
+ gl.glViewport(0,0,width,height);
+ gl.glMatrixMode(GL_PROJECTION);
+ gl.glLoadIdentity();
+ if (width <= height)
+ gl.glOrtho
+ (0.0f,
+ 16.0f,
+ 0.0f,
+ 16.0f*(float)height/(float)width,
+ -10.0f,
+ 10.0f);
+ else
+ gl.glOrtho
+ (0.0f,
+ 16.0f*(float)width/(float)height,
+ 0.0f,
+ 16.0,
+ -10.0f,
+ 10.0f);
+ gl.glMatrixMode(GL_MODELVIEW);
+ }
+
+ public void display()
+ {
+ if (glj.gljMakeCurrent() == false) return;
+
+ /**
+ * First column: emerald, jade, obsidian, pearl, ruby, turquoise
+ * 2nd column: brass, bronze, chrome, copper, gold, silver
+ * 3rd column: black, cyan, green, red, white, yellow plastic
+ * 4th column: black, cyan, green, red, white, yellow rubber
+ */
+ gl.glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+ renderTeapot
+ (2.0f, 17.0f, 0.0215f, 0.1745f, 0.0215f,
+ 0.07568f, 0.61424f, 0.07568f, 0.633f, 0.727811f, 0.633f, 0.6f);
+ renderTeapot
+ (2.0f, 14.0f, 0.135f, 0.2225f, 0.1575f,
+ 0.54f, 0.89f, 0.63f, 0.316228f, 0.316228f, 0.316228f, 0.1f);
+ renderTeapot
+ (2.0f, 11.0f, 0.05375f, 0.05f, 0.06625f,
+ 0.18275f, 0.17f, 0.22525f, 0.332741f, 0.328634f, 0.346435f, 0.3f);
+ renderTeapot
+ (2.0f, 8.0f, 0.25f, 0.20725f, 0.20725f,
+ 1f, 0.829f, 0.829f, 0.296648f, 0.296648f, 0.296648f, 0.088f);
+ renderTeapot
+ (2.0f, 5.0f, 0.1745f, 0.01175f, 0.01175f,
+ 0.61424f, 0.04136f, 0.04136f, 0.727811f, 0.626959f, 0.626959f, 0.6f);
+ renderTeapot
+ (2.0f, 2.0f, 0.1f, 0.18725f, 0.1745f,
+ 0.396f, 0.74151f, 0.69102f, 0.297254f, 0.30829f, 0.306678f, 0.1f);
+ renderTeapot
+ (6.0f, 17.0f, 0.329412f, 0.223529f, 0.027451f,
+ 0.780392f, 0.568627f, 0.113725f, 0.992157f, 0.941176f, 0.807843f,
+ 0.21794872f);
+ renderTeapot
+ (6.0f, 14.0f, 0.2125f, 0.1275f, 0.054f,
+ 0.714f, 0.4284f, 0.18144f, 0.393548f, 0.271906f, 0.166721f, 0.2f);
+ renderTeapot
+ (6.0f, 11.0f, 0.25f, 0.25f, 0.25f,
+ 0.4f, 0.4f, 0.4f, 0.774597f, 0.774597f, 0.774597f, 0.6f);
+ renderTeapot
+ (6.0f, 8.0f, 0.19125f, 0.0735f, 0.0225f,
+ 0.7038f, 0.27048f, 0.0828f, 0.256777f, 0.137622f, 0.086014f, 0.1f);
+ renderTeapot
+ (6.0f, 5.0f, 0.24725f, 0.1995f, 0.0745f,
+ 0.75164f, 0.60648f, 0.22648f, 0.628281f, 0.555802f, 0.366065f, 0.4f);
+ renderTeapot
+ (6.0f, 2.0f, 0.19225f, 0.19225f, 0.19225f,
+ 0.50754f, 0.50754f, 0.50754f, 0.508273f, 0.508273f, 0.508273f, 0.4f);
+ renderTeapot
+ (10.0f, 17.0f, 0.0f, 0.0f, 0.0f, 0.01f, 0.01f, 0.01f,
+ 0.50f, 0.50f, 0.50f, .25f);
+ renderTeapot
+ (10.0f, 14.0f, 0.0f, 0.1f, 0.06f, 0.0f, 0.50980392f, 0.50980392f,
+ 0.50196078f, 0.50196078f, 0.50196078f, .25f);
+ renderTeapot
+ (10.0f, 11.0f, 0.0f, 0.0f, 0.0f,
+ 0.1f, 0.35f, 0.1f, 0.45f, 0.55f, 0.45f, .25f);
+ renderTeapot
+ (10.0f, 8.0f, 0.0f, 0.0f, 0.0f, 0.5f, 0.0f, 0.0f,
+ 0.7f, 0.6f, 0.6f, .25f);
+ renderTeapot
+ (10.0f, 5.0f, 0.0f, 0.0f, 0.0f, 0.55f, 0.55f, 0.55f,
+ 0.70f, 0.70f, 0.70f, .25f);
+ renderTeapot
+ (10.0f, 2.0f, 0.0f, 0.0f, 0.0f, 0.5f, 0.5f, 0.0f,
+ 0.60f, 0.60f, 0.50f, .25f);
+ renderTeapot
+ (14.0f, 17.0f, 0.02f, 0.02f, 0.02f, 0.01f, 0.01f, 0.01f,
+ 0.4f, 0.4f, 0.4f, .078125f);
+ renderTeapot
+ (14.0f, 14.0f, 0.0f, 0.05f, 0.05f, 0.4f, 0.5f, 0.5f,
+ 0.04f, 0.7f, 0.7f, .078125f);
+ renderTeapot
+ (14.0f, 11.0f, 0.0f, 0.05f, 0.0f, 0.4f, 0.5f, 0.4f,
+ 0.04f, 0.7f, 0.04f, .078125f);
+ renderTeapot
+ (14.0f, 8.0f, 0.05f, 0.0f, 0.0f, 0.5f, 0.4f, 0.4f,
+ 0.7f, 0.04f, 0.04f, .078125f);
+ renderTeapot
+ (14.0f, 5.0f, 0.05f, 0.05f, 0.05f, 0.5f, 0.5f, 0.5f,
+ 0.7f, 0.7f, 0.7f, .078125f);
+ renderTeapot
+ (14.0f, 2.0f, 0.05f, 0.05f, 0.0f, 0.5f, 0.5f, 0.4f,
+ 0.7f, 0.7f, 0.04f, .078125f);
+ gl.glFlush();
+
+ glj.gljSwap();
+ glj.gljCheckGL();
+ glj.gljFree();
+ }
+
+ /*
+ * Move object into position. Use 3rd through 12th
+ * parameters to specify the material property. Draw a teapot.
+ */
+ private void renderTeapot
+ (float x,
+ float y,
+ float ambr,
+ float ambg,
+ float ambb,
+ float difr,
+ float difg,
+ float difb,
+ float specr,
+ float specg,
+ float specb,
+ float shine)
+ {
+ float mat[] = new float[4];
+
+ gl.glPushMatrix();
+ gl.glTranslatef(x, y, 0.0f);
+ mat[0] = ambr; mat[1] = ambg; mat[2] = ambb; mat[3] = 1.0f;
+ gl.glMaterialfv(GL_FRONT, GL_AMBIENT, mat);
+ mat[0] = difr; mat[1] = difg; mat[2] = difb;
+ gl.glMaterialfv(GL_FRONT, GL_DIFFUSE, mat);
+ mat[0] = specr; mat[1] = specg; mat[2] = specb;
+ gl.glMaterialfv(GL_FRONT, GL_SPECULAR, mat);
+ gl.glMaterialf(GL_FRONT, GL_SHININESS, shine * 128.0f);
+ gl.glCallList(teapotList);
+ gl.glPopMatrix();
+ }
+
+ // Imported from glut.
+ private void glutSolidTeapot(double scale)
+ {
+ teapot(14, scale, GL_FILL);
+ }
+
+ // Imported from glut.
+ private void teapot(int grid, double scale, int type)
+ {
+ float p[] = new float[4*4*3];
+ float q[] = new float[4*4*3];
+ float r[] = new float[4*4*3];
+ float s[] = new float[4*4*3];
+ float sc = (float)(0.5*scale);
+
+ gl.glPushAttrib(GL_ENABLE_BIT | GL_EVAL_BIT);
+ gl.glEnable(GL_AUTO_NORMAL);
+ gl.glEnable(GL_NORMALIZE);
+ gl.glEnable(GL_MAP2_VERTEX_3);
+ gl.glEnable(GL_MAP2_TEXTURE_COORD_2);
+ gl.glPushMatrix();
+ gl.glRotatef(270.0f, 1.0f, 0.0f, 0.0f);
+ gl.glScalef(sc, sc, sc);
+ gl.glTranslatef(0.0f, 0.0f, -1.5f);
+ for (int i = 0; i < 10; i++)
+ {
+ for (int j = 0; j < 4; j++)
+ {
+ for (int k = 0; k < 4; k++)
+ {
+ for (int l = 0; l < 3; l++)
+ {
+ p[(j*12)+(k*3)+l] = cpdata[patchdata[i][j * 4 + k]][l];
+ q[(j*12)+(k*3)+l] = cpdata[patchdata[i][j * 4 + (3 - k)]][l];
+ if (l == 1)
+ q[(j*12)+(k*3)+l] *= -1.0f;
+ if (i < 6)
+ {
+ r[(j*12)+(k*3)+l] =
+ cpdata[patchdata[i][j * 4 + (3 - k)]][l];
+ if (l == 0)
+ r[(j*12)+(k*3)+l] *= -1.0f;
+ s[(j*12)+(k*3)+l] =
+ cpdata[patchdata[i][j * 4 + k]][l];
+ if (l == 0)
+ s[(j*12)+(k*3)+l] *= -1.0f;
+ if (l == 1)
+ s[(j*12)+(k*3)+l] *= -1.0f;
+ }
+ }
+ }
+ }
+ gl.glMap2f
+ (GL_MAP2_TEXTURE_COORD_2, 0, 1, 2, 2, 0, 1, 4, 2, tex);
+ gl.glMap2f
+ (GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4, p);
+ gl.glMapGrid2f(grid, 0.0f, 1.0f, grid, 0.0f, 1.0f);
+ gl.glEvalMesh2(type, 0, grid, 0, grid);
+ gl.glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4, q);
+ gl.glEvalMesh2(type, 0, grid, 0, grid);
+ if (i < 6)
+ {
+ gl.glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4, r);
+ gl.glEvalMesh2(type, 0, grid, 0, grid);
+ gl.glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4, s);
+ gl.glEvalMesh2(type, 0, grid, 0, grid);
+ }
+ }
+ gl.glPopMatrix();
+ gl.glPopAttrib();
+ }
+ }
+}
diff --git a/demos/RonsDemos/teapots_plugin13.html b/demos/RonsDemos/teapots_plugin13.html new file mode 100644 index 0000000..19ee75d --- /dev/null +++ b/demos/RonsDemos/teapots_plugin13.html @@ -0,0 +1,48 @@ +<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.61 [en] (Win98; U) [Netscape]">
+ <title>Teapots by Silicon Graphics; ported to Java by Ron Cemer</title>
+</head>
+<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#e6e6ff">
+Teapots applet
+<br>Originially written by Silicon Graphics
+<br>Ported to Java by Ron Cemer
+<br>
+<!--"CONVERTED_APPLET"-->
+<!-- CONVERTER VERSION 1.3 --> +<SCRIPT LANGUAGE="JavaScript"><!-- + var _info = navigator.userAgent; var _ns = false; + var _ie = (_info.indexOf("MSIE") > 0 && _info.indexOf("Win") > 0 && _info.indexOf("Windows 3.1") < 0); +//--></SCRIPT> +<COMMENT><SCRIPT LANGUAGE="JavaScript1.1"><!-- + var _ns = (navigator.appName.indexOf("Netscape") >= 0 && ((_info.indexOf("Win") > 0 && _info.indexOf("Win16") < 0 && java.lang.System.getProperty("os.version").indexOf("3.5") < 0) || (_info.indexOf("Sun") > 0) || (_info.indexOf("Linux") > 0))); +//--></SCRIPT></COMMENT> + +<SCRIPT LANGUAGE="JavaScript"><!-- + if (_ie == true) document.writeln('<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" WIDTH = 400 HEIGHT = 400 codebase="http://java.sun.com/products/plugin/1.3/jinstall-13-win32.cab#Version=1,3,0,0"><NOEMBED><XMP>'); + else if (_ns == true) document.writeln('<EMBED type="application/x-java-applet;version=1.3" CODE = "teapots.class" WIDTH = 400 HEIGHT = 400 scriptable=false pluginspage="http://java.sun.com/products/plugin/1.3/plugin-install.html"><NOEMBED><XMP>'); +//--></SCRIPT> +<APPLET CODE = "teapots.class" WIDTH = 400 HEIGHT = 400></XMP> +<PARAM NAME = CODE VALUE = "teapots.class" >
+ +<PARAM NAME="type" VALUE="application/x-java-applet;version=1.3"> +<PARAM NAME="scriptable" VALUE="false"> + +</APPLET> + +</NOEMBED></EMBED></OBJECT> + + +<!-- +<APPLET CODE = "teapots.class" WIDTH = 400 HEIGHT = 400>
+
+
+</APPLET> +--> +<!--"END_CONVERTED_APPLET"-->
+
+<hr>
+</body>
+</html>
diff --git a/demos/RonsDemos/texgen.html b/demos/RonsDemos/texgen.html new file mode 100644 index 0000000..859d220 --- /dev/null +++ b/demos/RonsDemos/texgen.html @@ -0,0 +1,22 @@ +<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.61 [en] (Win98; U) [Netscape]">
+ <title>Texgen by Silicon Graphics; ported to Java by Ron Cemer</title>
+</head>
+<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#e6e6ff">
+Texgen applet
+<br>Originially written by Silicon Graphics
+<br>Ported to Java by Ron Cemer
+<br>Click inside the window, then press any of the following keys:
+<br>e/E: generate eye linear texture coordinates
+<br>o/O: generate object linear texture coordinates
+<br>s/S: use a slanted plane for texture coordinate generation
+<br>x/X: use a flat plane (x = 0) for texture coordinate generation
+<br>
+<applet code="texgen.class" width=400 height=400>
+</applet>
+<hr>
+</body>
+</html>
diff --git a/demos/RonsDemos/texgen.java b/demos/RonsDemos/texgen.java new file mode 100644 index 0000000..bbc3288 --- /dev/null +++ b/demos/RonsDemos/texgen.java @@ -0,0 +1,478 @@ +/**
+ * @(#) texgen.java
+ * @(#) author: Silicon Graphics, Inc. (converted to Java by Ron Cemer)
+ */
+
+/*
+ * Copyright (c) 1993-1997, Silicon Graphics, Inc.
+ * ALL RIGHTS RESERVED
+ * Permission to use, copy, modify, and distribute this software for
+ * any purpose and without fee is hereby granted, provided that the above
+ * copyright notice appear in all copies and that both the copyright notice
+ * and this permission notice appear in supporting documentation, and that
+ * the name of Silicon Graphics, Inc. not be used in advertising
+ * or publicity pertaining to distribution of the software without specific,
+ * written prior permission.
+ *
+ * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
+ * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
+ * FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
+ * GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT,
+ * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY
+ * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION,
+ * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF
+ * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN
+ * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
+ * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * US Government Users Restricted Rights
+ * Use, duplication, or disclosure by the Government is subject to
+ * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
+ * (c)(1)(ii) of the Rights in Technical Data and Computer Software
+ * clause at DFARS 252.227-7013 and/or in similar or successor
+ * clauses in the FAR or the DOD or NASA FAR Supplement.
+ * Unpublished-- rights reserved under the copyright laws of the
+ * United States. Contractor/manufacturer is Silicon Graphics,
+ * Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311.
+ *
+ * OpenGL(R) is a registered trademark of Silicon Graphics, Inc.
+ */
+
+/* This program draws a texture mapped teapot with
+ * automatically generated texture coordinates. The
+ * texture is rendered as stripes on the teapot.
+ * Initially, the object is drawn with texture coordinates
+ * based upon the object coordinates of the vertex
+ * and distance from the plane x = 0. Pressing the 'e'
+ * key changes the coordinate generation to eye coordinates
+ * of the vertex. Pressing the 'o' key switches it back
+ * to the object coordinates. Pressing the 's' key
+ * changes the plane to a slanted one (x + y + z = 0).
+ * Pressing the 'x' key switches it back to x = 0.
+ */
+
+import java.applet.*;
+import java.awt.*;
+import java.awt.event.*;
+import java.lang.*;
+import java.util.*;
+import java.io.*;
+import java.util.*;
+import gl4java.GLContext;
+import gl4java.awt.GLCanvas;
+
+public class texgen extends Applet
+{
+ // Data for drawing teapots:
+ /* Rim, body, lid, and bottom data must be reflected in x and
+ y; handle and spout data across the y axis only. */
+ private static final int patchdata[][] =
+ {
+ /* rim */
+ {102, 103, 104, 105, 4, 5, 6, 7, 8, 9, 10, 11,
+ 12, 13, 14, 15},
+ /* body */
+ {12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
+ 24, 25, 26, 27},
+ {24, 25, 26, 27, 29, 30, 31, 32, 33, 34, 35, 36,
+ 37, 38, 39, 40},
+ /* lid */
+ {96, 96, 96, 96, 97, 98, 99, 100, 101, 101, 101,
+ 101, 0, 1, 2, 3,},
+ {0, 1, 2, 3, 106, 107, 108, 109, 110, 111, 112,
+ 113, 114, 115, 116, 117},
+ /* bottom */
+ {118, 118, 118, 118, 124, 122, 119, 121, 123, 126,
+ 125, 120, 40, 39, 38, 37},
+ /* handle */
+ {41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
+ 53, 54, 55, 56},
+ {53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
+ 28, 65, 66, 67},
+ /* spout */
+ {68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
+ 80, 81, 82, 83},
+ {80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91,
+ 92, 93, 94, 95}
+ };
+ private static final float cpdata[][] =
+ {
+ {0.2f, 0.0f, 2.7f}, {0.2f, -0.112f, 2.7f}, {0.112f, -0.2f, 2.7f}, {0.0f,
+ -0.2f, 2.7f}, {1.3375f, 0.0f, 2.53125f}, {1.3375f, -0.749f, 2.53125f},
+ {0.749f, -1.3375f, 2.53125f}, {0.0f, -1.3375f, 2.53125f}, {1.4375f,
+ 0.0f, 2.53125f}, {1.4375f, -0.805f, 2.53125f}, {0.805f, -1.4375f,
+ 2.53125f}, {0.0f, -1.4375f, 2.53125f}, {1.5f, 0.0f, 2.4f}, {1.5f, -0.84f,
+ 2.4f}, {0.84f, -1.5f, 2.4f}, {0.0f, -1.5f, 2.4f}, {1.75f, 0.0f, 1.875f},
+ {1.75f, -0.98f, 1.875f}, {0.98f, -1.75f, 1.875f}, {0.0f, -1.75f,
+ 1.875f}, {2f, 0.0f, 1.35f}, {2f, -1.12f, 1.35f}, {1.12f, -2f, 1.35f},
+ {0.0f, -2f, 1.35f}, {2f, 0.0f, 0.9f}, {2f, -1.12f, 0.9f}, {1.12f, -2f,
+ 0.9f}, {0.0f, -2f, 0.9f}, {-2f, 0.0f, 0.9f}, {2f, 0.0f, 0.45f}, {2f, -1.12f,
+ 0.45f}, {1.12f, -2f, 0.45f}, {0.0f, -2f, 0.45f}, {1.5f, 0.0f, 0.225f},
+ {1.5f, -0.84f, 0.225f}, {0.84f, -1.5f, 0.225f}, {0.0f, -1.5f, 0.225f},
+ {1.5f, 0.0f, 0.15f}, {1.5f, -0.84f, 0.15f}, {0.84f, -1.5f, 0.15f}, {0.0f,
+ -1.5f, 0.15f}, {-1.6f, 0.0f, 2.025f}, {-1.6f, -0.3f, 2.025f}, {-1.5f,
+ -0.3f, 2.25f}, {-1.5f, 0.0f, 2.25f}, {-2.3f, 0.0f, 2.025f}, {-2.3f, -0.3f,
+ 2.025f}, {-2.5f, -0.3f, 2.25f}, {-2.5f, 0.0f, 2.25f}, {-2.7f, 0.0f,
+ 2.025f}, {-2.7f, -0.3f, 2.025f}, {-3f, -0.3f, 2.25f}, {-3f, 0.0f,
+ 2.25f}, {-2.7f, 0.0f, 1.8f}, {-2.7f, -0.3f, 1.8f}, {-3f, -0.3f, 1.8f},
+ {-3f, 0.0f, 1.8f}, {-2.7f, 0.0f, 1.575f}, {-2.7f, -0.3f, 1.575f}, {-3f,
+ -0.3f, 1.35f}, {-3f, 0.0f, 1.35f}, {-2.5f, 0.0f, 1.125f}, {-2.5f, -0.3f,
+ 1.125f}, {-2.65f, -0.3f, 0.9375f}, {-2.65f, 0.0f, 0.9375f}, {-2f,
+ -0.3f, 0.9f}, {-1.9f, -0.3f, 0.6f}, {-1.9f, 0.0f, 0.6f}, {1.7f, 0.0f,
+ 1.425f}, {1.7f, -0.66f, 1.425f}, {1.7f, -0.66f, 0.6f}, {1.7f, 0.0f,
+ 0.6f}, {2.6f, 0.0f, 1.425f}, {2.6f, -0.66f, 1.425f}, {3.1f, -0.66f,
+ 0.825f}, {3.1f, 0.0f, 0.825f}, {2.3f, 0.0f, 2.1f}, {2.3f, -0.25f, 2.1f},
+ {2.4f, -0.25f, 2.025f}, {2.4f, 0.0f, 2.025f}, {2.7f, 0.0f, 2.4f}, {2.7f,
+ -0.25f, 2.4f}, {3.3f, -0.25f, 2.4f}, {3.3f, 0.0f, 2.4f}, {2.8f, 0.0f,
+ 2.475f}, {2.8f, -0.25f, 2.475f}, {3.525f, -0.25f, 2.49375f},
+ {3.525f, 0.0f, 2.49375f}, {2.9f, 0.0f, 2.475f}, {2.9f, -0.15f, 2.475f},
+ {3.45f, -0.15f, 2.5125f}, {3.45f, 0.0f, 2.5125f}, {2.8f, 0.0f, 2.4f},
+ {2.8f, -0.15f, 2.4f}, {3.2f, -0.15f, 2.4f}, {3.2f, 0.0f, 2.4f}, {0.0f, 0.0f,
+ 3.15f}, {0.8f, 0.0f, 3.15f}, {0.8f, -0.45f, 3.15f}, {0.45f, -0.8f,
+ 3.15f}, {0.0f, -0.8f, 3.15f}, {0.0f, 0.0f, 2.85f}, {1.4f, 0.0f, 2.4f}, {1.4f,
+ -0.784f, 2.4f}, {0.784f, -1.4f, 2.4f}, {0.0f, -1.4f, 2.4f}, {0.4f, 0.0f,
+ 2.55f}, {0.4f, -0.224f, 2.55f}, {0.224f, -0.4f, 2.55f}, {0.0f, -0.4f,
+ 2.55f}, {1.3f, 0.0f, 2.55f}, {1.3f, -0.728f, 2.55f}, {0.728f, -1.3f,
+ 2.55f}, {0.0f, -1.3f, 2.55f}, {1.3f, 0.0f, 2.4f}, {1.3f, -0.728f, 2.4f},
+ {0.728f, -1.3f, 2.4f}, {0.0f, -1.3f, 2.4f}, {0.0f, 0.0f, 0.0f}, {1.425f,
+ -0.798f, 0.0f}, {1.5f, 0.0f, 0.075f}, {1.425f, 0.0f, 0.0f}, {0.798f, -1.425f,
+ 0.0f}, {0.0f, -1.5f, 0.075f}, {0.0f, -1.425f, 0.0f}, {1.5f, -0.84f, 0.075f},
+ {0.84f, -1.5f, 0.075f}
+ };
+ private static final float tex[] =
+ {
+ 0.0f, 0.0f,
+ 1.0f, 0.0f,
+ 0.0f, 1.0f,
+ 1.0f, 1.0f
+ };
+
+ texgenCanvas canvas = null;
+
+
+ /* Initialize the applet */
+
+
+ public void init()
+ {
+ Dimension d = getSize();
+ setLayout(new BorderLayout());
+ canvas = new texgenCanvas(d.width, d.height);
+ canvas.requestFocus();
+ add("Center", canvas);
+ }
+
+
+ /* Start the applet */
+
+
+ public void start()
+ {
+ }
+
+
+ /* Stop the applet */
+
+
+ public void stop()
+ {
+ }
+
+
+
+
+ /* Local GLCanvas extension class */
+
+
+ private class texgenCanvas extends GLCanvas
+ implements KeyListener, MouseListener
+ {
+ private static final int stripeImageWidth = 32;
+ private byte stripeImage[] = new byte[4*stripeImageWidth];
+ private int texName;
+
+ /* planes for texture coordinate generation */
+ private float xequalzero[] = {1.0f, 0.0f, 0.0f, 0.0f};
+ private float slanted[] = {1.0f, 1.0f, 1.0f, 0.0f};
+ private float currentCoeff[];
+ private int currentPlane;
+ private int currentGenMode;
+
+ public texgenCanvas(int w, int h)
+ {
+ super(w, h);
+ GLContext.gljNativeDebug = false;
+ GLContext.gljClassDebug = false;
+ }
+
+ public void preInit()
+ {
+ doubleBuffer = true;
+ stereoView = false;
+ }
+
+ public void init()
+ {
+ System.out.println("init(): " + this);
+ reshape(getSize().width, getSize().height);
+
+ gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
+ gl.glEnable(GL_DEPTH_TEST);
+ gl.glShadeModel(GL_SMOOTH);
+
+ makeStripeImage();
+ gl.glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
+
+ int tnbuf[] = new int[1];
+ gl.glGenTextures(1, tnbuf);
+ texName = tnbuf[0];
+ gl.glBindTexture(GL_TEXTURE_1D, texName);
+ gl.glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_WRAP_S, GL_REPEAT);
+ gl.glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+ gl.glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+ gl.glTexImage1D
+ (GL_TEXTURE_1D,
+ 0,
+ GL_RGBA,
+ stripeImageWidth,
+ 0,
+ GL_RGBA,
+ GL_UNSIGNED_BYTE,
+ stripeImage);
+ gl.glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
+ currentCoeff = xequalzero;
+ currentGenMode = GL_OBJECT_LINEAR;
+ currentPlane = GL_OBJECT_PLANE;
+ gl.glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, currentGenMode);
+ gl.glTexGenfv(GL_S, currentPlane, currentCoeff);
+
+ gl.glEnable(GL_TEXTURE_GEN_S);
+ gl.glEnable(GL_TEXTURE_1D);
+ gl.glEnable(GL_CULL_FACE);
+ gl.glEnable(GL_LIGHTING);
+ gl.glEnable(GL_LIGHT0);
+ gl.glEnable(GL_AUTO_NORMAL);
+ gl.glEnable(GL_NORMALIZE);
+ gl.glFrontFace(GL_CW);
+ gl.glCullFace(GL_BACK);
+ gl.glMaterialf(GL_FRONT, GL_SHININESS, 64.0f);
+
+ glj.gljCheckGL();
+
+ addKeyListener(this);
+ addMouseListener(this);
+ }
+
+ public void cvsDispose()
+ {
+ System.out.println("destroy(): " + this);
+ removeKeyListener(this);
+ super.cvsDispose();
+ }
+
+ public void reshape(int width, int height)
+ {
+ gl.glViewport(0,0,width,height);
+ gl.glMatrixMode(GL_PROJECTION);
+ gl.glLoadIdentity();
+ if (width <= height)
+ gl.glOrtho
+ (-3.5f,3.5f,-3.5f*(float)height/(float)width,
+ 3.5f*(float)height/(float)width,-3.5f,3.5f);
+ else
+ gl.glOrtho
+ (-3.5f*(float)width/(float)height,
+ 3.5f*(float)width/(float)height,-3.5f,3.5f,-3.5f,3.5f);
+ gl.glMatrixMode(GL_MODELVIEW);
+ gl.glLoadIdentity();
+ gl.glMatrixMode(GL_PROJECTION);
+ gl.glLoadIdentity();
+ if (width <= height)
+ gl.glOrtho
+ (-3.5f,3.5f,-3.5f*(float)height/(float)width,
+ 3.5f*(float)height/(float)width,-3.5f,3.5f);
+ else
+ gl.glOrtho
+ (-3.5f*(float)width/(float)height,
+ 3.5f*(float)width/(float)height,-3.5f,3.5f,-3.5f,3.5f);
+ gl.glMatrixMode(GL_MODELVIEW);
+ gl.glLoadIdentity();
+ }
+
+ public void display()
+ {
+ if (glj.gljMakeCurrent() == false) return;
+
+ gl.glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+ gl.glPushMatrix ();
+ gl.glRotatef(45.0f, 0.0f, 0.0f, 1.0f);
+ gl.glBindTexture(GL_TEXTURE_1D, texName);
+ glutSolidTeapot(2.0f);
+ gl.glPopMatrix();
+ gl.glFlush();
+
+ glj.gljSwap();
+ glj.gljCheckGL();
+ glj.gljFree();
+ }
+
+ // Methods required for the implementation of KeyListener
+ public void keyPressed(KeyEvent e)
+ {
+ }
+
+ public void keyReleased(KeyEvent e)
+ {
+ }
+
+ public void keyTyped(KeyEvent e)
+ {
+ if (glj.gljMakeCurrent() == false) return;
+ boolean dorepaint = false;
+ switch ((char)e.getKeyChar())
+ {
+ case 'e':
+ case 'E':
+ currentGenMode = GL_EYE_LINEAR;
+ currentPlane = GL_EYE_PLANE;
+ gl.glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, currentGenMode);
+ gl.glTexGenfv(GL_S, currentPlane, currentCoeff);
+ dorepaint = true;
+ break;
+ case 'o':
+ case 'O':
+ currentGenMode = GL_OBJECT_LINEAR;
+ currentPlane = GL_OBJECT_PLANE;
+ gl.glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, currentGenMode);
+ gl.glTexGenfv(GL_S, currentPlane, currentCoeff);
+ dorepaint = true;
+ break;
+ case 's':
+ case 'S':
+ currentCoeff = slanted;
+ gl.glTexGenfv(GL_S, currentPlane, currentCoeff);
+ dorepaint = true;
+ break;
+ case 'x':
+ case 'X':
+ currentCoeff = xequalzero;
+ gl.glTexGenfv(GL_S, currentPlane, currentCoeff);
+ dorepaint = true;
+ break;
+ }
+ glj.gljFree();
+ if (dorepaint) repaint();
+ }
+
+ private void makeStripeImage()
+ {
+ for (int j = 0; j < stripeImageWidth; j++)
+ {
+ stripeImage[4*j] = (byte)((j<=4) ? 255 : 0);
+ stripeImage[4*j+1] = (byte)((j>4) ? 255 : 0);
+ stripeImage[4*j+2] = (byte)0;
+ stripeImage[4*j+3] = (byte)255;
+ }
+ }
+
+ // Imported from glut.
+ private void glutSolidTeapot(double scale)
+ {
+ teapot(14, scale, GL_FILL);
+ }
+
+ // Imported from glut.
+ private void teapot(int grid, double scale, int type)
+ {
+ float p[] = new float[4*4*3];
+ float q[] = new float[4*4*3];
+ float r[] = new float[4*4*3];
+ float s[] = new float[4*4*3];
+ float sc = (float)(0.5*scale);
+
+ gl.glPushAttrib(GL_ENABLE_BIT | GL_EVAL_BIT);
+ gl.glEnable(GL_AUTO_NORMAL);
+ gl.glEnable(GL_NORMALIZE);
+ gl.glEnable(GL_MAP2_VERTEX_3);
+ gl.glEnable(GL_MAP2_TEXTURE_COORD_2);
+ gl.glPushMatrix();
+ gl.glRotatef(270.0f, 1.0f, 0.0f, 0.0f);
+ gl.glScalef(sc, sc, sc);
+ gl.glTranslatef(0.0f, 0.0f, -1.5f);
+ for (int i = 0; i < 10; i++)
+ {
+ for (int j = 0; j < 4; j++)
+ {
+ for (int k = 0; k < 4; k++)
+ {
+ for (int l = 0; l < 3; l++)
+ {
+ p[(j*12)+(k*3)+l] = cpdata[patchdata[i][j * 4 + k]][l];
+ q[(j*12)+(k*3)+l] = cpdata[patchdata[i][j * 4 + (3 - k)]][l];
+ if (l == 1)
+ q[(j*12)+(k*3)+l] *= -1.0f;
+ if (i < 6)
+ {
+ r[(j*12)+(k*3)+l] =
+ cpdata[patchdata[i][j * 4 + (3 - k)]][l];
+ if (l == 0)
+ r[(j*12)+(k*3)+l] *= -1.0f;
+ s[(j*12)+(k*3)+l] =
+ cpdata[patchdata[i][j * 4 + k]][l];
+ if (l == 0)
+ s[(j*12)+(k*3)+l] *= -1.0f;
+ if (l == 1)
+ s[(j*12)+(k*3)+l] *= -1.0f;
+ }
+ }
+ }
+ }
+ gl.glMap2f
+ (GL_MAP2_TEXTURE_COORD_2, 0, 1, 2, 2, 0, 1, 4, 2, tex);
+ gl.glMap2f
+ (GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4, p);
+ gl.glMapGrid2f(grid, 0.0f, 1.0f, grid, 0.0f, 1.0f);
+ gl.glEvalMesh2(type, 0, grid, 0, grid);
+ gl.glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4, q);
+ gl.glEvalMesh2(type, 0, grid, 0, grid);
+ if (i < 6)
+ {
+ gl.glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4, r);
+ gl.glEvalMesh2(type, 0, grid, 0, grid);
+ gl.glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4, s);
+ gl.glEvalMesh2(type, 0, grid, 0, grid);
+ }
+ }
+ gl.glPopMatrix();
+ gl.glPopAttrib();
+ }
+
+ // Methods required for the implementation of MouseListener
+ public void mouseEntered( MouseEvent evt )
+ {
+ Component comp = evt.getComponent();
+ if( comp.equals(this ) )
+ {
+ requestFocus();
+ }
+ }
+
+ public void mouseExited( MouseEvent evt )
+ { }
+ public void mousePressed( MouseEvent evt )
+ { }
+ public void mouseReleased( MouseEvent evt )
+ { }
+ public void mouseClicked( MouseEvent evt )
+ {
+ Component comp = evt.getComponent();
+ if( comp.equals(this ) )
+ {
+ requestFocus();
+ }
+ }
+ }
+}
diff --git a/demos/RonsDemos/texgen_plugin13.html b/demos/RonsDemos/texgen_plugin13.html new file mode 100644 index 0000000..f776b4c --- /dev/null +++ b/demos/RonsDemos/texgen_plugin13.html @@ -0,0 +1,53 @@ +<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.61 [en] (Win98; U) [Netscape]">
+ <title>Texgen by Silicon Graphics; ported to Java by Ron Cemer</title>
+</head>
+<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#e6e6ff">
+Texgen applet
+<br>Originially written by Silicon Graphics
+<br>Ported to Java by Ron Cemer
+<br>Click inside the window, then press any of the following keys:
+<br>e/E: generate eye linear texture coordinates
+<br>o/O: generate object linear texture coordinates
+<br>s/S: use a slanted plane for texture coordinate generation
+<br>x/X: use a flat plane (x = 0) for texture coordinate generation
+<br>
+<!--"CONVERTED_APPLET"-->
+<!-- CONVERTER VERSION 1.3 --> +<SCRIPT LANGUAGE="JavaScript"><!-- + var _info = navigator.userAgent; var _ns = false; + var _ie = (_info.indexOf("MSIE") > 0 && _info.indexOf("Win") > 0 && _info.indexOf("Windows 3.1") < 0); +//--></SCRIPT> +<COMMENT><SCRIPT LANGUAGE="JavaScript1.1"><!-- + var _ns = (navigator.appName.indexOf("Netscape") >= 0 && ((_info.indexOf("Win") > 0 && _info.indexOf("Win16") < 0 && java.lang.System.getProperty("os.version").indexOf("3.5") < 0) || (_info.indexOf("Sun") > 0) || (_info.indexOf("Linux") > 0))); +//--></SCRIPT></COMMENT> + +<SCRIPT LANGUAGE="JavaScript"><!-- + if (_ie == true) document.writeln('<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" WIDTH = 400 HEIGHT = 400 codebase="http://java.sun.com/products/plugin/1.3/jinstall-13-win32.cab#Version=1,3,0,0"><NOEMBED><XMP>'); + else if (_ns == true) document.writeln('<EMBED type="application/x-java-applet;version=1.3" CODE = "texgen.class" WIDTH = 400 HEIGHT = 400 scriptable=false pluginspage="http://java.sun.com/products/plugin/1.3/plugin-install.html"><NOEMBED><XMP>'); +//--></SCRIPT> +<APPLET CODE = "texgen.class" WIDTH = 400 HEIGHT = 400></XMP> +<PARAM NAME = CODE VALUE = "texgen.class" >
+ +<PARAM NAME="type" VALUE="application/x-java-applet;version=1.3"> +<PARAM NAME="scriptable" VALUE="false"> + +</APPLET> + +</NOEMBED></EMBED></OBJECT> + + +<!-- +<APPLET CODE = "texgen.class" WIDTH = 400 HEIGHT = 400>
+
+
+</APPLET> +--> +<!--"END_CONVERTED_APPLET"-->
+
+<hr>
+</body>
+</html>
diff --git a/demos/RonsDemos/texobj.html b/demos/RonsDemos/texobj.html new file mode 100644 index 0000000..63f7d5b --- /dev/null +++ b/demos/RonsDemos/texobj.html @@ -0,0 +1,18 @@ +<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.61 [en] (Win98; U) [Netscape]">
+ <title>Texobj by Brian Paul; ported to Java by Ron Cemer</title>
+</head>
+<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#e6e6ff">
+Texobj applet
+<br>Originially written by Brian Paul
+<br>Ported to Java by Ron Cemer
+<br>
+<hr>
+<applet code="texobj.class" width=400 height=400>
+</applet>
+<hr>
+</body>
+</html>
diff --git a/demos/RonsDemos/texobj.java b/demos/RonsDemos/texobj.java new file mode 100644 index 0000000..49923a0 --- /dev/null +++ b/demos/RonsDemos/texobj.java @@ -0,0 +1,233 @@ +/**
+ * @(#) texobj.java
+ * @(#) author: Brian Paul (converted to Java by Ron Cemer)
+ */
+
+import java.applet.*;
+import java.awt.*;
+import java.awt.event.*;
+import java.lang.*;
+import java.util.*;
+import java.io.*;
+import java.util.*;
+
+import gl4java.GLContext;
+import gl4java.awt.GLAnimCanvas;
+import gl4java.applet.SimpleGLAnimApplet1;
+
+public class texobj extends SimpleGLAnimApplet1
+{
+
+ /* Initialize the applet */
+
+
+ public void init()
+ {
+ super.init();
+ Dimension d = getSize();
+ canvas = new texobjCanvas(d.width, d.height);
+ add("Center", canvas);
+ }
+
+
+ /* Local GLAnimCanvas extension class */
+
+
+ private class texobjCanvas extends GLAnimCanvas
+ {
+ private int TexObj[];
+ float Angle = 0.0f;
+
+ public texobjCanvas(int w, int h)
+ {
+ super(w, h);
+ GLContext.gljNativeDebug = false;
+ GLContext.gljClassDebug = false;
+ setAnimateFps(30.0);
+
+ TexObj = new int[2];
+ }
+
+ public void preInit()
+ {
+ doubleBuffer = true;
+ stereoView = false;
+ }
+
+ public void init()
+ {
+ System.out.println("init(): " + this);
+ reshape(getSize().width, getSize().height);
+
+ int width = 8, height = 8;
+ byte tex1[] =
+ {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 1, 0, 0, 0,
+ 0, 0, 0, 1, 1, 0, 0, 0,
+ 0, 0, 0, 0, 1, 0, 0, 0,
+ 0, 0, 0, 0, 1, 0, 0, 0,
+ 0, 0, 0, 0, 1, 0, 0, 0,
+ 0, 0, 0, 1, 1, 1, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0
+ };
+ byte tex2[] =
+ {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 2, 2, 0, 0, 0,
+ 0, 0, 2, 0, 0, 2, 0, 0,
+ 0, 0, 0, 0, 0, 2, 0, 0,
+ 0, 0, 0, 0, 2, 0, 0, 0,
+ 0, 0, 0, 2, 0, 0, 0, 0,
+ 0, 0, 2, 2, 2, 2, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0
+ };
+ byte tex[] = new byte[64*3];
+ int i, j;
+
+ gl.glDisable(GL_DITHER);
+
+ /* Setup texturing */
+ gl.glEnable(GL_TEXTURE_2D);
+ gl.glTexEnvi(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_DECAL);
+ gl.glHint(GL_PERSPECTIVE_CORRECTION_HINT,GL_FASTEST);
+
+ /* generate texture object IDs */
+ gl.glGenTextures(2, TexObj);
+
+ /* setup first texture object */
+ gl.glBindTexture(GL_TEXTURE_2D, TexObj[0]);
+ /* red on white */
+ for (i = 0; i < height; i++)
+ {
+ for (j = 0; j < width; j++)
+ {
+ int p = i*width+j;
+ if ((tex1[(height-i-1)*width+j]) != (byte)0)
+ {
+ tex[p*3] = (byte)255;
+ tex[(p*3)+1] = (byte)0;
+ tex[(p*3)+2] = (byte)0;
+ }
+ else
+ {
+ tex[p*3] = (byte)255;
+ tex[(p*3)+1] = (byte)255;
+ tex[(p*3)+2] = (byte)255;
+ }
+ }
+ }
+ gl.glTexImage2D
+ (GL_TEXTURE_2D,
+ 0,
+ 3,
+ width,
+ height,
+ 0,
+ GL_RGB,
+ GL_UNSIGNED_BYTE,
+ tex);
+ gl.glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST);
+ gl.glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_NEAREST);
+ gl.glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_REPEAT);
+ gl.glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,GL_REPEAT);
+ /* end of texture object */
+
+ /* setup second texture object */
+ gl.glBindTexture(GL_TEXTURE_2D,TexObj[1]);
+ /* green on blue */
+ for (i = 0; i < height; i++)
+ {
+ for (j = 0; j < width; j++)
+ {
+ int p = i*width+j;
+ if ((tex2[(height-i-1)*width+j]) != (byte)0)
+ {
+ tex[p*3] = (byte)0;
+ tex[(p*3)+1] = (byte)255;
+ tex[(p*3)+2] = (byte)0;
+ }
+ else
+ {
+ tex[p*3] = (byte)0;
+ tex[(p*3)+1] = (byte)0;
+ tex[(p*3)+2] = (byte)255;
+ }
+ }
+ }
+ gl.glTexImage2D
+ (GL_TEXTURE_2D,
+ 0,
+ 3,
+ width,
+ height,
+ 0,
+ GL_RGB,
+ GL_UNSIGNED_BYTE,
+ tex);
+ gl.glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST);
+ gl.glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_NEAREST);
+ gl.glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_REPEAT);
+ gl.glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,GL_REPEAT);
+ /* end texture object */
+
+ glj.gljCheckGL();
+ }
+
+ public void reshape(int width, int height)
+ {
+ gl.glViewport(0,0,width,height);
+
+ gl.glMatrixMode(GL_PROJECTION);
+ gl.glLoadIdentity();
+ gl.glFrustum(-2.0, 2.0, -2.0, 2.0, 6.0, 20.0);
+ gl.glMatrixMode(GL_MODELVIEW);
+ gl.glLoadIdentity();
+ gl.glTranslatef(0.0f, 0.0f, -8.0f);
+ }
+
+ public void display()
+ {
+ if (glj.gljMakeCurrent() == false) return;
+
+ Angle += 0.2f;
+
+ gl.glDepthFunc(GL_EQUAL);
+ gl.glClear(GL_COLOR_BUFFER_BIT);
+
+ gl.glColor3f(1.0f, 1.0f, 1.0f);
+
+ /* draw first polygon */
+ gl.glPushMatrix();
+ gl.glTranslatef(-1.0f, 0.0f, 0.0f);
+ gl.glRotatef(Angle, 0.0f, 0.0f, 1.0f);
+ gl.glBindTexture(GL_TEXTURE_2D, TexObj[0]);
+ gl.glBegin(GL_POLYGON);
+ gl.glTexCoord2f(0.0f, 0.0f); gl.glVertex2f(-1.0f, -1.0f);
+ gl.glTexCoord2f(1.0f, 0.0f); gl.glVertex2f( 1.0f, -1.0f);
+ gl.glTexCoord2f(1.0f, 1.0f); gl.glVertex2f( 1.0f, 1.0f);
+ gl.glTexCoord2f(0.0f, 1.0f); gl.glVertex2f(-1.0f, 1.0f);
+ gl.glEnd();
+ gl.glPopMatrix();
+
+ /* draw second polygon */
+ gl.glPushMatrix();
+ gl.glTranslatef(1.0f, 0.0f, 0.0f);
+ gl.glRotatef(Angle-90.0f, 0.0f, 1.0f, 0.0f);
+ gl.glBindTexture(GL_TEXTURE_2D, TexObj[1]);
+ gl.glBegin(GL_POLYGON);
+ gl.glTexCoord2f(0.0f, 0.0f); gl.glVertex2f(-1.0f, -1.0f);
+ gl.glTexCoord2f(1.0f, 0.0f); gl.glVertex2f( 1.0f, -1.0f);
+ gl.glTexCoord2f(1.0f, 1.0f); gl.glVertex2f( 1.0f, 1.0f);
+ gl.glTexCoord2f(0.0f, 1.0f); gl.glVertex2f(-1.0f, 1.0f);
+ gl.glEnd();
+ gl.glPopMatrix();
+
+ glj.gljSwap();
+ glj.gljCheckGL();
+ glj.gljFree();
+
+ //if (!isSuspended()) repaint(); // Animate at full speed.
+ }
+ }
+}
diff --git a/demos/RonsDemos/texobj_plugin13.html b/demos/RonsDemos/texobj_plugin13.html new file mode 100644 index 0000000..30f3829 --- /dev/null +++ b/demos/RonsDemos/texobj_plugin13.html @@ -0,0 +1,49 @@ +<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.61 [en] (Win98; U) [Netscape]">
+ <title>Texobj by Brian Paul; ported to Java by Ron Cemer</title>
+</head>
+<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#e6e6ff">
+Texobj applet
+<br>Originially written by Brian Paul
+<br>Ported to Java by Ron Cemer
+<br>
+<hr>
+<!--"CONVERTED_APPLET"-->
+<!-- CONVERTER VERSION 1.3 --> +<SCRIPT LANGUAGE="JavaScript"><!-- + var _info = navigator.userAgent; var _ns = false; + var _ie = (_info.indexOf("MSIE") > 0 && _info.indexOf("Win") > 0 && _info.indexOf("Windows 3.1") < 0); +//--></SCRIPT> +<COMMENT><SCRIPT LANGUAGE="JavaScript1.1"><!-- + var _ns = (navigator.appName.indexOf("Netscape") >= 0 && ((_info.indexOf("Win") > 0 && _info.indexOf("Win16") < 0 && java.lang.System.getProperty("os.version").indexOf("3.5") < 0) || (_info.indexOf("Sun") > 0) || (_info.indexOf("Linux") > 0))); +//--></SCRIPT></COMMENT> + +<SCRIPT LANGUAGE="JavaScript"><!-- + if (_ie == true) document.writeln('<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" WIDTH = 400 HEIGHT = 400 codebase="http://java.sun.com/products/plugin/1.3/jinstall-13-win32.cab#Version=1,3,0,0"><NOEMBED><XMP>'); + else if (_ns == true) document.writeln('<EMBED type="application/x-java-applet;version=1.3" CODE = "texobj.class" WIDTH = 400 HEIGHT = 400 scriptable=false pluginspage="http://java.sun.com/products/plugin/1.3/plugin-install.html"><NOEMBED><XMP>'); +//--></SCRIPT> +<APPLET CODE = "texobj.class" WIDTH = 400 HEIGHT = 400></XMP> +<PARAM NAME = CODE VALUE = "texobj.class" >
+ +<PARAM NAME="type" VALUE="application/x-java-applet;version=1.3"> +<PARAM NAME="scriptable" VALUE="false"> + +</APPLET> + +</NOEMBED></EMBED></OBJECT> + + +<!-- +<APPLET CODE = "texobj.class" WIDTH = 400 HEIGHT = 400>
+
+
+</APPLET> +--> +<!--"END_CONVERTED_APPLET"-->
+
+<hr>
+</body>
+</html>
diff --git a/demos/RonsDemos/text3d.html b/demos/RonsDemos/text3d.html new file mode 100644 index 0000000..40d67ac --- /dev/null +++ b/demos/RonsDemos/text3d.html @@ -0,0 +1,17 @@ +<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.61 [en] (Win98; U) [Netscape]">
+ <title>Text3d by Robert J. Doyle, Jr.; ported to Java by Ron Cemer</title>
+</head>
+<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#e6e6ff">
+Text3d applet
+<br>Originially written by Robert J. Doyle, Jr.
+<br>Ported to Java by Ron Cemer
+<br>
+<applet code="text3d.class" width=400 height=400>
+</applet>
+<hr>
+</body>
+</html>
diff --git a/demos/RonsDemos/text3d.java b/demos/RonsDemos/text3d.java new file mode 100644 index 0000000..ed40bee --- /dev/null +++ b/demos/RonsDemos/text3d.java @@ -0,0 +1,682 @@ +/**
+ * @(#) text3d.java
+ * @(#) author: Robert J. Doyle, Jr. (converted to Java by Ron Cemer)
+ */
+
+import java.applet.*;
+import java.awt.*;
+import java.awt.event.*;
+import java.lang.*;
+import java.util.*;
+import java.io.*;
+import java.util.*;
+import gl4java.GLContext;
+import gl4java.awt.GLAnimCanvas;
+import gl4java.applet.SimpleGLAnimApplet1;
+
+public class text3d extends SimpleGLAnimApplet1
+{
+ private static final float letterM[][] =
+ {
+ {-3.125000f, 0.000000f, 0.000000f},
+ {-3.125000f, 6.208000f, 0.000000f},
+ {-1.233000f, 6.208000f, 0.000000f},
+ {0.003000f, 1.484000f, 0.000000f},
+ {1.223000f, 6.208000f, 0.000000f},
+ {3.123000f, 6.208000f, 0.000000f},
+ {3.123000f, 0.000000f, 0.000000f},
+ {1.923000f, 0.000000f, 0.000000f},
+ {1.923000f, 5.010000f, 0.000000f},
+ {0.659000f, 0.000000f, 0.000000f},
+ {-0.649000f, 0.000000f, 0.000000f},
+ {-1.925000f, 5.010000f, 0.000000f},
+ {-1.925000f, 0.000000f, 0.000000f}
+ };
+ private static final int letterMtris[][] =
+ {
+ { 1, 0, 12 },
+ { 1, 12, 11 },
+ { 1, 11, 2 },
+ { 2, 11, 3 },
+ { 11, 10, 3 },
+ { 3, 10, 9 },
+ { 3, 9, 8 },
+ { 3, 8, 4 },
+ { 4, 8, 5 },
+ { 5, 8, 7 },
+ { 5, 7, 6 },
+ };
+ private static final float letterO[][] =
+ {
+ {-3.038000f, 3.102000f, 0.0f},
+ {-2.974000f, 3.874000f, 0.0f},
+ {-2.827000f, 4.440000f, 0.0f},
+ {-2.802000f, 4.508000f, 0.0f},
+ {-2.544000f, 5.042000f, 0.0f},
+ {-2.502000f, 5.110000f, 0.0f},
+ {-2.223000f, 5.479000f, 0.0f},
+ {-2.132000f, 5.576000f, 0.0f},
+ {-1.784000f, 5.869000f, 0.0f},
+ {-1.678000f, 5.940000f, 0.0f},
+ {-1.260000f, 6.155000f, 0.0f},
+ {-1.148000f, 6.198000f, 0.0f},
+ {-0.677000f, 6.321000f, 0.0f},
+ {-0.638000f, 6.328000f, 0.0f},
+ {-0.002000f, 6.378000f, 0.0f},
+ {0.634000f, 6.328000f, 0.0f},
+ {1.107000f, 6.210000f, 0.0f},
+ {1.144000f, 6.198000f, 0.0f},
+ {1.570000f, 6.002000f, 0.0f},
+ {1.674000f, 5.940000f, 0.0f},
+ {2.038000f, 5.661000f, 0.0f},
+ {2.128000f, 5.576000f, 0.0f},
+ {2.428000f, 5.217000f, 0.0f},
+ {2.504000f, 5.104000f, 0.0f},
+ {2.762000f, 4.598000f, 0.0f},
+ {2.798000f, 4.508000f, 0.0f},
+ {2.960000f, 3.913000f, 0.0f},
+ {2.970000f, 3.862000f, 0.0f},
+ {3.034000f, 3.102000f, 0.0f},
+ {2.970000f, 2.342000f, 0.0f},
+ {2.815000f, 1.745000f, 0.0f},
+ {2.798000f, 1.696000f, 0.0f},
+ {2.554000f, 1.182000f, 0.0f},
+ {2.504000f, 1.100000f, 0.0f},
+ {2.221000f, 0.726000f, 0.0f},
+ {2.128000f, 0.628000f, 0.0f},
+ {1.776000f, 0.332000f, 0.0f},
+ {1.674000f, 0.264000f, 0.0f},
+ {1.256000f, 0.049000f, 0.0f},
+ {1.144000f, 0.006000f, 0.0f},
+ {0.672000f, -0.117000f, 0.0f},
+ {0.634000f, -0.124000f, 0.0f},
+ {-0.002000f, -0.174000f, 0.0f},
+ {-0.638000f, -0.124000f, 0.0f},
+ {-1.112000f, -0.006000f, 0.0f},
+ {-1.148000f, 0.006000f, 0.0f},
+ {-1.576000f, 0.202000f, 0.0f},
+ {-1.678000f, 0.264000f, 0.0f},
+ {-2.041000f, 0.540000f, 0.0f},
+ {-2.132000f, 0.628000f, 0.0f},
+ {-2.430000f, 0.983000f, 0.0f},
+ {-2.502000f, 1.094000f, 0.0f},
+ {-2.773000f, 1.622000f, 0.0f},
+ {-2.802000f, 1.696000f, 0.0f},
+ {-2.962000f, 2.258000f, 0.0f},
+ {-2.974000f, 2.330000f, 0.0f},
+ {-1.736000f, 3.102000f, 1.0f}, // Begin new strip
+ {-1.710000f, 3.578000f, 0.0f},
+ {-1.644000f, 3.934000f, 0.0f},
+ {-1.503000f, 4.328000f, 0.0f},
+ {-1.494000f, 4.346000f, 0.0f},
+ {-1.352000f, 4.593000f, 0.0f},
+ {-1.306000f, 4.656000f, 0.0f},
+ {-1.120000f, 4.857000f, 0.0f},
+ {-1.040000f, 4.926000f, 0.0f},
+ {-0.825000f, 5.067000f, 0.0f},
+ {-0.726000f, 5.116000f, 0.0f},
+ {-0.480000f, 5.200000f, 0.0f},
+ {-0.402000f, 5.218000f, 0.0f},
+ {-0.041000f, 5.257000f, 0.0f},
+ {-0.002000f, 5.258000f, 0.0f},
+ {0.361000f, 5.227000f, 0.0f},
+ {0.400000f, 5.220000f, 0.0f},
+ {0.650000f, 5.147000f, 0.0f},
+ {0.726000f, 5.116000f, 0.0f},
+ {0.950000f, 4.990000f, 0.0f},
+ {1.038000f, 4.926000f, 0.0f},
+ {1.239000f, 4.736000f, 0.0f},
+ {1.306000f, 4.656000f, 0.0f},
+ {1.462000f, 4.413000f, 0.0f},
+ {1.498000f, 4.342000f, 0.0f},
+ {1.635000f, 3.964000f, 0.0f},
+ {1.644000f, 3.934000f, 0.0f},
+ {1.710000f, 3.568000f, 0.0f},
+ {1.736000f, 3.102000f, 0.0f},
+ {1.710000f, 2.636000f, 0.0f},
+ {1.642000f, 2.268000f, 0.0f},
+ {1.508000f, 1.886000f, 0.0f},
+ {1.496000f, 1.860000f, 0.0f},
+ {1.351000f, 1.610000f, 0.0f},
+ {1.304000f, 1.546000f, 0.0f},
+ {1.115000f, 1.343000f, 0.0f},
+ {1.036000f, 1.276000f, 0.0f},
+ {0.823000f, 1.135000f, 0.0f},
+ {0.724000f, 1.086000f, 0.0f},
+ {0.480000f, 1.001000f, 0.0f},
+ {0.400000f, 0.984000f, 0.0f},
+ {0.035000f, 0.946000f, 0.0f},
+ {-0.002000f, 0.946000f, 0.0f},
+ {-0.368000f, 0.979000f, 0.0f},
+ {-0.402000f, 0.986000f, 0.0f},
+ {-0.653000f, 1.057000f, 0.0f},
+ {-0.726000f, 1.088000f, 0.0f},
+ {-0.952000f, 1.213000f, 0.0f},
+ {-1.040000f, 1.278000f, 0.0f},
+ {-1.240000f, 1.467000f, 0.0f},
+ {-1.306000f, 1.548000f, 0.0f},
+ {-1.460000f, 1.788000f, 0.0f},
+ {-1.494000f, 1.858000f, 0.0f},
+ {-1.639000f, 2.251000f, 0.0f},
+ {-1.644000f, 2.270000f, 0.0f},
+ {-1.710000f, 2.626000f, 0.0f}
+ };
+ private static final int letterOtris[][] =
+ {
+ { 0, 56, 1 },
+ { 1, 56, 57 },
+ { 1, 57, 2 },
+ { 2, 57, 58 },
+ { 2, 58, 3 },
+ { 3, 58, 59 },
+ { 3, 59, 4 },
+ { 4, 59, 60 },
+ { 4, 60, 5 },
+ { 5, 60, 61 },
+ { 5, 61, 6 },
+ { 6, 61, 62 },
+ { 6, 62, 7 },
+ { 7, 62, 63 },
+ { 7, 63, 8 },
+ { 8, 63, 64 },
+ { 8, 64, 9 },
+ { 9, 64, 65 },
+ { 9, 65, 10 },
+ { 10, 65, 66 },
+ { 10, 66, 11 },
+ { 11, 66, 67 },
+ { 11, 67, 12 },
+ { 12, 67, 68 },
+ { 12, 68, 13 },
+ { 13, 68, 69 },
+ { 13, 69, 14 },
+ { 14, 69, 70 },
+ { 14, 70, 15 },
+ { 15, 70, 71 },
+ { 15, 71, 16 },
+ { 16, 71, 72 },
+ { 16, 72, 17 },
+ { 17, 72, 73 },
+ { 17, 73, 18 },
+ { 18, 73, 74 },
+ { 18, 74, 19 },
+ { 19, 74, 75 },
+ { 19, 75, 20 },
+ { 20, 75, 76 },
+ { 20, 76, 21 },
+ { 21, 76, 77 },
+ { 21, 77, 22 },
+ { 22, 77, 78 },
+ { 22, 78, 23 },
+ { 23, 78, 79 },
+ { 23, 79, 24 },
+ { 24, 79, 80 },
+ { 24, 80, 25 },
+ { 25, 80, 81 },
+ { 25, 81, 26 },
+ { 26, 81, 82 },
+ { 26, 82, 27 },
+ { 27, 82, 83 },
+ { 27, 83, 28 },
+ { 28, 83, 84 },
+ { 28, 84, 29 },
+ { 29, 84, 85 },
+ { 29, 85, 30 },
+ { 30, 85, 86 },
+ { 30, 86, 31 },
+ { 31, 86, 87 },
+ { 31, 87, 32 },
+ { 32, 87, 88 },
+ { 32, 88, 33 },
+ { 33, 88, 89 },
+ { 33, 89, 34 },
+ { 34, 89, 90 },
+ { 34, 90, 35 },
+ { 35, 90, 91 },
+ { 35, 91, 36 },
+ { 36, 91, 92 },
+ { 36, 92, 37 },
+ { 37, 92, 93 },
+ { 37, 93, 38 },
+ { 38, 93, 94 },
+ { 38, 94, 39 },
+ { 39, 94, 95 },
+ { 39, 95, 40 },
+ { 40, 95, 96 },
+ { 40, 96, 41 },
+ { 41, 96, 97 },
+ { 41, 97, 42 },
+ { 42, 97, 98 },
+ { 42, 98, 43 },
+ { 43, 98, 99 },
+ { 43, 99, 44 },
+ { 44, 99, 100 },
+ { 44, 100, 45 },
+ { 45, 100, 101 },
+ { 45, 101, 46 },
+ { 46, 101, 102 },
+ { 46, 102, 47 },
+ { 47, 102, 103 },
+ { 47, 103, 48 },
+ { 48, 103, 104 },
+ { 48, 104, 49 },
+ { 49, 104, 105 },
+ { 49, 105, 50 },
+ { 50, 105, 106 },
+ { 50, 106, 51 },
+ { 51, 106, 107 },
+ { 51, 107, 52 },
+ { 52, 107, 108 },
+ { 52, 108, 53 },
+ { 53, 108, 109 },
+ { 53, 109, 54 },
+ { 54, 109, 110 },
+ { 54, 110, 55 },
+ { 55, 110, 111 },
+ { 55, 111, 0 },
+ { 0, 111, 56 },
+ };
+ private static final float letterT[][] =
+ {
+ {-0.640000f, 0.000000f, 0.0f},
+ {-0.640000f, 5.104000f, 0.0f},
+ {-2.476000f, 5.104000f, 0.0f},
+ {-2.476000f, 6.208000f, 0.0f},
+ {2.476000f, 6.208000f, 0.0f},
+ {2.476000f, 5.104000f, 0.0f},
+ {0.640000f, 5.104000f, 0.0f},
+ {0.640000f, 0.000000f, 0.0f}
+ };
+ private static final int letterTtris[][] =
+ {
+ { 1, 0, 7 },
+ { 1, 7, 6 },
+ { 3, 2, 1 },
+ { 3, 1, 6 },
+ { 3, 6, 4 },
+ { 4, 6, 5 },
+ };
+ private static final float letterH[][] =
+ {
+ {-2.570000f, 0.000000f, 0.0f},
+ {-2.570000f, 6.208000f, 0.0f},
+ {-1.282000f, 6.208000f, 0.0f},
+ {-1.282000f, 3.900000f, 0.0f},
+ {1.280000f, 3.900000f, 0.0f},
+ {1.280000f, 6.208000f, 0.0f},
+ {2.568000f, 6.208000f, 0.0f},
+ {2.568000f, 0.000000f, 0.0f},
+ {1.280000f, 0.000000f, 0.0f},
+ {1.280000f, 2.760000f, 0.0f},
+ {-1.282000f, 2.760000f, 0.0f},
+ {-1.282000f, 0.000000f, 0.0f}
+ };
+ private static final int letterHtris[][] =
+ {
+ { 1, 0, 11 },
+ { 1, 11, 10 },
+ { 1, 10, 3 },
+ { 1, 3, 2 },
+ { 3, 10, 9 },
+ { 3, 9, 4 },
+ { 6, 5, 4 },
+ { 6, 4, 9 },
+ { 6, 9, 8 },
+ { 6, 8, 7 },
+ };
+
+
+ /* Initialize the applet */
+
+
+ public void init()
+ {
+ super.init();
+ Dimension d = getSize();
+ canvas = new text3dCanvas(d.width, d.height);
+ add("Center", canvas);
+ }
+
+
+ /* Local GLAnimCanvas extension class */
+
+
+ private class text3dCanvas extends GLAnimCanvas
+ {
+ private final int
+ M_SIDE = 1, M_EDGE = 2, M_WHOLE = 3,
+ O_SIDE = 4, O_EDGE = 5, O_WHOLE = 6,
+ T_SIDE = 7, T_EDGE = 8, T_WHOLE = 9,
+ H_SIDE = 10, H_EDGE = 11, H_WHOLE = 12,
+ REPEAT_SIDE = 13, REPEAT_EDGE = 14, REPEAT1 = 15,
+ REPEAT2_SIDE = 16, REPEAT2_EDGE = 17, REPEAT2 = 18,
+ REPEAT3_SIDE = 19, REPEAT3_EDGE = 20, REPEAT3 = 21,
+ REPEAT4_SIDE = 22, REPEAT4_EDGE = 23, REPEAT4 = 24;
+ private float sideColor[] = {0.0f, 0.0f, 0.5f, 1.0f};
+ private float edgeColor[] = {0.7f, 0.7f, 0.0f, 1.0f};
+ private float shininess[] = {128.0f};
+ private float mat_specular[] = {0.7f, 0.7f, 0.7f, 1.0f};
+ private float width = 0.0f, width2 = 2.0f;
+
+ public text3dCanvas(int w, int h)
+ {
+ super(w, h);
+ GLContext.gljNativeDebug = false;
+ GLContext.gljClassDebug = false;
+ setAnimateFps(30.0);
+ }
+
+ public void preInit()
+ {
+ doubleBuffer = true;
+ stereoView = false;
+ accumSize = 8;
+ }
+
+ public void init()
+ {
+ System.out.println("init(): " + this);
+ reshape(getSize().width, getSize().height);
+
+ int count1 = letterM.length;
+ int count2 = letterO.length;
+ int count3 = letterT.length;
+ int count4 = letterH.length;
+
+ int i;
+
+ float light_ambient[] = { 1.0f, 1.0f, 1.0f, 1.0f };
+ float light_diffuse[] = { 1.0f, 1.0f, 1.0f, 1.0f };
+ float light_specular[] = { 1.0f, 1.0f, 1.0f, 1.0f };
+ /* light_position is NOT default value */
+ float light_position[] = { -1.0f, -1.0f, 1.0f, 0.0f };
+
+ gl.glLightfv(GL_LIGHT0, GL_AMBIENT, light_ambient);
+ gl.glLightfv(GL_LIGHT0, GL_DIFFUSE, light_diffuse);
+ gl.glLightfv(GL_LIGHT0, GL_SPECULAR, light_specular);
+ gl.glLightfv(GL_LIGHT0, GL_POSITION, light_position);
+
+ gl.glEnable(GL_LIGHTING);
+ gl.glEnable(GL_LIGHT0);
+ gl.glDepthFunc(GL_LESS);
+ gl.glEnable(GL_DEPTH_TEST);
+
+ gl.glDrawBuffer(GL_FRONT_AND_BACK);
+ gl.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
+ gl.glClear(GL_COLOR_BUFFER_BIT);
+ gl.glClear(GL_ACCUM_BUFFER_BIT);
+ gl.glDrawBuffer(GL_BACK);
+
+ /* Zero position of text */
+
+ for(i = 0; i < count1; i++)
+ letterM[i][1] -= 3.175f;
+ for(i = 0; i < count2; i++)
+ letterO[i][1] -= 3.175f;
+ for(i = 0; i < count3; i++)
+ letterT[i][1] -= 3.175f;
+ for(i = 0; i < count4; i++)
+ letterH[i][1] -= 3.175f;
+
+ glj.gljCheckGL();
+ }
+
+ public void reshape(int width, int height)
+ {
+ gl.glViewport(0,0,width,height);
+ gl.glMatrixMode(GL_PROJECTION);
+ gl.glLoadIdentity();
+ gl.glFrustum(-7.0f, 7.0f, -7.0f, 7.0f, 6.0f, 20.0f);
+ gl.glMatrixMode(GL_MODELVIEW);
+ }
+
+ public void display()
+ {
+ if (glj.gljMakeCurrent() == false) return;
+
+ int i, j;
+ float xPos = -0.34f;
+ gl.glLoadIdentity();
+ gl.glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+ gl.glTranslatef(0.0f, 0.0f, -10.0f);
+
+ extrudeSolidFromPolygon
+ (letterM, letterMtris, width2, REPEAT_SIDE, REPEAT_EDGE, REPEAT1);
+ extrudeSolidFromPolygon
+ (letterO, letterOtris, width2, REPEAT2_SIDE, REPEAT2_EDGE, REPEAT2);
+ extrudeSolidFromPolygon
+ (letterT, letterTtris, width2, REPEAT3_SIDE, REPEAT3_EDGE, REPEAT3);
+ extrudeSolidFromPolygon
+ (letterH, letterHtris, width2, REPEAT4_SIDE, REPEAT4_EDGE, REPEAT4);
+
+ for (j = 1; j < 5; j++)
+ {
+ width = 0.0f;
+ glj.gljCheckGL();
+ for (i = 0; i < 10; i++)
+ {
+ gl.glPushMatrix();
+ repeat(j);
+ gl.glPopMatrix();
+ gl.glPushMatrix();
+ gl.glRotatef(90.0f, 0.0f, 1.0f, 0.0f);
+ switch (j)
+ {
+ case 1:
+ extrudeSolidFromPolygon
+ (letterM, letterMtris, width, M_SIDE, M_EDGE, M_WHOLE);
+ gl.glCallList(M_WHOLE);
+ break;
+ case 2:
+ extrudeSolidFromPolygon
+ (letterO, letterOtris, width, O_SIDE, O_EDGE, O_WHOLE);
+ gl.glCallList(O_WHOLE);
+ break;
+ case 3:
+ extrudeSolidFromPolygon
+ (letterT, letterTtris, width, T_SIDE, T_EDGE, T_WHOLE);
+ gl.glCallList(T_WHOLE);
+ break;
+ case 4:
+ extrudeSolidFromPolygon
+ (letterH, letterHtris, width, H_SIDE, H_EDGE, H_WHOLE);
+ gl.glCallList(H_WHOLE);
+ break;
+ }
+ glj.gljSwap();
+
+ gl.glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+ width += 0.2f;
+ gl.glPopMatrix();
+ }
+ for (i = 0; i < 45 ; i++)
+ {
+ gl.glPushMatrix();
+ repeat(j);
+ gl.glPopMatrix();
+
+ gl.glPushMatrix();
+ gl.glRotatef(90.0f - (2.0f * i), 0.0f, 1.0f, 0.0f);
+ switch (j)
+ {
+ case 1:
+ gl.glCallList(M_WHOLE);
+ break;
+ case 2:
+ gl.glCallList(O_WHOLE);
+ break;
+ case 3:
+ gl.glCallList(T_WHOLE);
+ break;
+ case 4:
+ gl.glCallList(H_WHOLE);
+ break;
+ }
+ glj.gljSwap();
+ gl.glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+ gl.glPopMatrix();
+ }
+ for (i = 1; i < 32 ; i++)
+ {
+ gl.glPushMatrix();
+ repeat(j);
+ gl.glPopMatrix();
+
+ gl.glPushMatrix();
+ gl.glTranslatef(i * xPos, i * 0.3f, i * -0.3f);
+ switch (j)
+ {
+ case 1:
+ gl.glCallList(M_WHOLE);
+ break;
+ case 2:
+ gl.glCallList(O_WHOLE);
+ break;
+ case 3:
+ gl.glCallList(T_WHOLE);
+ break;
+ case 4:
+ gl.glCallList(H_WHOLE);
+ break;
+ }
+ glj.gljSwap();
+ gl.glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+ gl.glPopMatrix();
+ }
+ if (j == 1)
+ xPos += 0.25f;
+ else
+ xPos += 0.21f;
+ }
+ gl.glFlush();
+
+ glj.gljCheckGL();
+ glj.gljFree();
+
+ //if (!isSuspended()) repaint(); // Animate at full speed.
+ }
+
+ /* Mark Kilgard's tessellation code from the "dino" demos.
+ Bug fixes and re-write without GLU tesselator
+ by Ronald B. Cemer */
+ private void extrudeSolidFromPolygon
+ (float data[][],
+ int outlineTriIndices[][],
+ float thickness,
+ int side,
+ int edge,
+ int whole)
+ {
+ double dx, dy, len;
+ int i, j0, j1, j2;
+ int min, max, range;
+ float x0, y0, x1, y1;
+ int count = data.length;
+ int tricount = outlineTriIndices.length;
+
+ gl.glNewList(side, GL_COMPILE);
+ gl.glShadeModel(GL_SMOOTH);
+ gl.glBegin(GL_TRIANGLES);
+ for (i = 0; i < tricount; i++)
+ {
+ j0 = outlineTriIndices[i][0];
+ j1 = outlineTriIndices[i][1];
+ j2 = outlineTriIndices[i][2];
+ gl.glVertex3f(data[j0][0],data[j0][1],0.0f);
+ gl.glVertex3f(data[j1][0],data[j1][1],0.0f);
+ gl.glVertex3f(data[j2][0],data[j2][1],0.0f);
+ }
+ gl.glEnd();
+ gl.glEndList();
+
+ gl.glNewList(edge, GL_COMPILE);
+ for (min = max = 0; min < count; min = max)
+ {
+ for (max = min+1; max < count; max++)
+ if (data[max][2] != 0.0f) break;
+ range = max-min;
+ gl.glBegin(GL_QUAD_STRIP);
+ for (i = min; i <= max; i++)
+ {
+ j0 = i;
+ j1 = i+1;
+ if (j0 >= max) j0 -= range;
+ if (j1 >= max) j1 -= range;
+ x0 = data[j0][0];
+ y0 = data[j0][1];
+ x1 = data[j1][0];
+ y1 = data[j1][1];
+ gl.glVertex3f(x0, y0, 0.0f);
+ gl.glVertex3f(x0, y0, thickness);
+ // Normals
+ dx = y1 - y0;
+ dy = x0 - x1;
+ len = Math.sqrt(dx * dx + dy * dy);
+ gl.glNormal3f((float)(dx / len), (float)(dy / len), 0.0f);
+ }
+ gl.glEnd();
+ }
+ gl.glEndList();
+
+ gl.glNewList(whole, GL_COMPILE);
+ gl.glFrontFace(GL_CW);
+
+ gl.glMaterialfv(GL_FRONT, GL_DIFFUSE, edgeColor);
+ gl.glMaterialfv(GL_FRONT, GL_SHININESS, shininess);
+ gl.glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular);
+ gl.glCallList(edge);
+
+ gl.glMaterialfv(GL_FRONT, GL_DIFFUSE, sideColor);
+ gl.glMaterialfv(GL_FRONT, GL_SHININESS, shininess);
+ gl.glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular);
+ gl.glNormal3f(0.0f, 0.0f, -1.0f);
+ gl.glCallList(side);
+ gl.glPushMatrix();
+ gl.glTranslatef(0.0f, 0.0f, thickness);
+ gl.glFrontFace(GL_CCW);
+ gl.glNormal3f(0.0f, 0.0f, 1.0f);
+ gl.glCallList(side);
+ gl.glPopMatrix();
+
+ gl.glEndList();
+ }
+
+ private void repeat(int j)
+ {
+ if (j == 2)
+ {
+ gl.glPushMatrix();
+ gl.glTranslatef((31.0f * -0.34f) , 9.3f, -9.6f);
+ gl.glCallList(REPEAT1);
+ gl.glPopMatrix();
+ }
+ if (j == 3)
+ {
+ gl.glPushMatrix();
+ gl.glTranslatef(31.0f * -0.34f, 9.3f, -9.6f);
+ gl.glCallList(REPEAT1);
+ gl.glPopMatrix();
+ gl.glPushMatrix();
+ gl.glTranslatef(31.0f * -0.09f, 9.3f, -9.6f);
+ gl.glCallList(REPEAT2);
+ gl.glPopMatrix();
+ }
+ if (j == 4)
+ {
+ gl.glPushMatrix();
+ gl.glTranslatef(31.0f * -0.34f, 9.3f, -9.6f);
+ gl.glCallList(REPEAT1);
+ gl.glPopMatrix();
+ gl.glPushMatrix();
+ gl.glTranslatef(31.0f * -0.09f, 9.3f, -9.6f);
+ gl.glCallList(REPEAT2);
+ gl.glPopMatrix();
+ gl.glPushMatrix();
+ gl.glTranslatef(31.0f * 0.12f, 9.3f, -9.6f);
+ gl.glCallList(REPEAT3);
+ gl.glPopMatrix();
+ }
+ }
+ }
+}
diff --git a/demos/RonsDemos/text3d_plugin13.html b/demos/RonsDemos/text3d_plugin13.html new file mode 100644 index 0000000..79c5976 --- /dev/null +++ b/demos/RonsDemos/text3d_plugin13.html @@ -0,0 +1,48 @@ +<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.61 [en] (Win98; U) [Netscape]">
+ <title>Text3d by Robert J. Doyle, Jr.; ported to Java by Ron Cemer</title>
+</head>
+<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#e6e6ff">
+Text3d applet
+<br>Originially written by Robert J. Doyle, Jr.
+<br>Ported to Java by Ron Cemer
+<br>
+<!--"CONVERTED_APPLET"-->
+<!-- CONVERTER VERSION 1.3 --> +<SCRIPT LANGUAGE="JavaScript"><!-- + var _info = navigator.userAgent; var _ns = false; + var _ie = (_info.indexOf("MSIE") > 0 && _info.indexOf("Win") > 0 && _info.indexOf("Windows 3.1") < 0); +//--></SCRIPT> +<COMMENT><SCRIPT LANGUAGE="JavaScript1.1"><!-- + var _ns = (navigator.appName.indexOf("Netscape") >= 0 && ((_info.indexOf("Win") > 0 && _info.indexOf("Win16") < 0 && java.lang.System.getProperty("os.version").indexOf("3.5") < 0) || (_info.indexOf("Sun") > 0) || (_info.indexOf("Linux") > 0))); +//--></SCRIPT></COMMENT> + +<SCRIPT LANGUAGE="JavaScript"><!-- + if (_ie == true) document.writeln('<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" WIDTH = 400 HEIGHT = 400 codebase="http://java.sun.com/products/plugin/1.3/jinstall-13-win32.cab#Version=1,3,0,0"><NOEMBED><XMP>'); + else if (_ns == true) document.writeln('<EMBED type="application/x-java-applet;version=1.3" CODE = "text3d.class" WIDTH = 400 HEIGHT = 400 scriptable=false pluginspage="http://java.sun.com/products/plugin/1.3/plugin-install.html"><NOEMBED><XMP>'); +//--></SCRIPT> +<APPLET CODE = "text3d.class" WIDTH = 400 HEIGHT = 400></XMP> +<PARAM NAME = CODE VALUE = "text3d.class" >
+ +<PARAM NAME="type" VALUE="application/x-java-applet;version=1.3"> +<PARAM NAME="scriptable" VALUE="false"> + +</APPLET> + +</NOEMBED></EMBED></OBJECT> + + +<!-- +<APPLET CODE = "text3d.class" WIDTH = 400 HEIGHT = 400>
+
+
+</APPLET> +--> +<!--"END_CONVERTED_APPLET"-->
+
+<hr>
+</body>
+</html>
|