/* Mykeynavbeh.java * Originally based on code from BackgroundApp.java *   @(#)BackgroundApp.java 1.1 00/09/22 14:03 * * portions Copyright (c) 1996-2000 Sun Microsystems, Inc. All Rights Reserved. * * Sun grants you ("Licensee") a non-exclusive, royalty free, license to use, * modify and redistribute this software in source and binary code form, * provided that i) this copyright notice and license appear on all copies of * the software; and ii) Licensee does not utilize the software in a manner * which is disparaging to Sun. * * This software is provided "AS IS," without a warranty of any kind. ALL * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY * IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR * NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN AND ITS LICENSORS SHALL NOT BE * LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING * OR DISTRIBUTING THE SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR ITS * LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, * INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER * CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF * OR INABILITY TO USE SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE * POSSIBILITY OF SUCH DAMAGES. * * This software is not designed or intended for use in on-line control of * aircraft, air traffic, aircraft navigation or aircraft communications; or in * the design, construction, operation or maintenance of any nuclear * facility. Licensee represents and warrants that it will not use or * redistribute the Software for such purposes. */
import java.awt.*;
import javax.media.j3d.*;import javax.vecmath.*;
import com.sun.j3d.utils.universe.SimpleUniverse;import com.sun.j3d.utils.universe.PlatformGeometry;import com.sun.j3d.utils.behaviors.keyboard.*;
import com.sun.j3d.loaders.Scene;
import java.awt.event.KeyListener;import java.awt.event.KeyEvent;
import java.util.*;
import java.io.*;import com.sun.j3d.loaders.objectfile.ObjectFile;
import com.sun.j3d.utils.geometry.Sphere;import java.awt.event.*;
import javax.sound.sampled.DataLine;import javax.sound.sampled.AudioInputStream;import javax.sound.sampled.AudioSystem;import javax.sound.sampled.Clip;import javax.sound.sampled.LineUnavailableException;import javax.sound.sampled.UnsupportedAudioFileException;
import java.net.*;
import com.sun.j3d.utils.image.TextureLoader;
public class Mykeynavbeh extends Frame implements Runnable, KeyListener {
private SimpleUniverse universe = null; private Canvas3D canvas = null; private TransformGroup viewtrans = null;
private TransformGroup tg_x = null; private Transform3D t3d_x = null;
private TransformGroup tg_y = null; private Transform3D t3d_y = null;
private TransformGroup tg_f = null; private Transform3D t3d_f = null;
private TransformGroup tg_pt = null; private Transform3D t3d_pt = null;
private TransformGroup tg_p = null; private Transform3D t3d_p = null;
private Transform3D t3dstep = new Transform3D(); private Matrix4d matrix = new Matrix4d();
private Switch selector = new Switch(Switch.CHILD_MASK); private BitSet flag_i = new BitSet(2);
private Switch selector_2 = new Switch(Switch.CHILD_MASK); private BitSet flag_i_2 = new BitSet(6);
private Switch selector_3 = new Switch(Switch.CHILD_MASK); private BitSet flag_i_3 = new BitSet(2);
private Switch selector_4 = new Switch(Switch.CHILD_MASK); private BitSet flag_i_4 = new BitSet(2);
private int count = 0; private int count2 = 0;
private boolean firstTime = true; private boolean firstTime2 = true; private boolean ft = true; private boolean turnAway = false;
private String typedKey = "0"; private String keyOrder = "0";
private Thread thread = new Thread(this);
private KeyNavigatorBehavior keyNavBeh;
public Mykeynavbeh() { setLayout(new BorderLayout()); GraphicsConfiguration config = SimpleUniverse.getPreferredConfiguration();
canvas = new Canvas3D(config); add("Center", canvas); universe = new SimpleUniverse(canvas);
BranchGroup scene = createSceneGraph(); universe.getViewingPlatform().setNominalViewingTransform();
universe.getViewer().getView().setBackClipDistance(10000.0);
canvas.addKeyListener(this);
universe.addBranchGraph(scene); }
private BranchGroup createSceneGraph() { BranchGroup objRoot = new BranchGroup();
BoundingSphere bounds = new BoundingSphere(new Point3d(), 10000.0);
viewtrans = universe.getViewingPlatform().getViewPlatformTransform();
keyNavBeh = new KeyNavigatorBehavior(viewtrans); keyNavBeh.setSchedulingBounds(bounds);
BranchGroup bg = new BranchGroup(); bg.addChild(keyNavBeh); universe.addBranchGraph(bg);
objRoot.addChild(createPlanetarium()); objRoot.addChild(createPomeranians());
return objRoot; }
private BranchGroup createPlanetarium() {
BranchGroup objRoot = new BranchGroup();
tg_x = new TransformGroup(); t3d_x = new Transform3D(); tg_x.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
t3d_x.setTranslation(new Vector3d(0.0, 0.0, 0.0)); t3d_x.setScale(250.0); tg_x.setTransform(t3d_x);
tg_y = new TransformGroup(); t3d_y = new Transform3D(); tg_y.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
tg_y.addChild(createPlanetarium2());
tg_x.addChild(tg_y); objRoot.addChild(tg_x);
objRoot.compile();
return objRoot;
}
private BranchGroup createPlanetarium2() {
BranchGroup objRoot = new BranchGroup();
selector.setCapability(Switch.ALLOW_SWITCH_WRITE);
flag_i.clear(); flag_i.set(0); selector.setChildMask(flag_i);
selector.addChild(createObjLoad("model/CelestialSphere_nasa.obj")); selector.addChild(createObjLoad("model/CelestialSphere_nasa2.obj"));
objRoot.addChild(selector);
objRoot.compile();
return objRoot;
}
private BranchGroup createPomeranians() {
BranchGroup objRoot = new BranchGroup();
tg_f = new TransformGroup(); t3d_f = new Transform3D();
TransformGroup tg_tp = new TransformGroup(); Transform3D t3d_tp = new Transform3D();
tg_f.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
t3d_f.setTranslation(new Vector3d(0.0, -2.0, -10.0)); t3d_f.setScale(1.0); tg_f.setTransform(t3d_f);
t3d_tp.setTranslation(new Vector3d(-1.3, 0.0, -1.5)); // t3d_tp.setRotation(new AxisAngle4f(0.0f, 0.0f, 0.0f, 0.0f)); t3d_tp.setScale(1.0); tg_tp.setTransform(t3d_tp); tg_tp.addChild(createTouchPanel()); tg_f.addChild(tg_tp);
tg_f.addChild(createPonta_Pom()); tg_f.addChild(createLeo());
objRoot.addChild(tg_f); objRoot.compile();
return objRoot;
}
private BranchGroup createPonta_Pom() {
BranchGroup objRoot = new BranchGroup();
TransformGroup tg = new TransformGroup(); Transform3D t3d = new Transform3D();
tg_pt = new TransformGroup(); t3d_pt = new Transform3D(); tg_pt.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
tg_p = new TransformGroup(); t3d_p = new Transform3D(); tg_p.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
t3d_pt.setTranslation(new Vector3d(0.0, 0.0, 0.0)); t3d_pt.setRotation(new AxisAngle4f(0.0f, 1.0f, 0.0f, 2.9f)); tg_pt.setTransform(t3d_pt);
t3d_p.setTranslation(new Vector3d(1.1, 0.0, 0.0)); t3d_p.setRotation(new AxisAngle4f(0.0f, 1.0f, 0.0f, 3.14f)); tg_p.setTransform(t3d_p);
selector_3.setCapability(Switch.ALLOW_SWITCH_WRITE); selector_3.addChild(createObjLoad("model/Sitting_Pomeranian.obj")); selector_3.addChild(createObjLoad("model/Pome_right_paw_right_punch.obj"));
flag_i_3.clear(); flag_i_3.set(0); selector_3.setChildMask(flag_i_3);
selector_4.setCapability(Switch.ALLOW_SWITCH_WRITE); selector_4.addChild(createObjLoad("model/Sitting_Pomeranian.obj")); selector_4.addChild(createObjLoad("model/Pome_right_paw_right_punch_mirror.obj"));
flag_i_4.clear(); flag_i_4.set(0); selector_4.setChildMask(flag_i_4);
tg_pt.addChild(selector_3); tg_p.addChild(selector_4);
// tg_pt.addChild(createObjLoad("model/Sitting_Pomeranian.obj")); // tg_p.addChild(createObjLoad("model/Sitting_Pomeranian.obj"));
tg.addChild(tg_pt); tg.addChild(tg_p); objRoot.addChild(tg); objRoot.compile();
return objRoot;
}
private BranchGroup createLeo() {
BranchGroup objRoot = new BranchGroup();
TransformGroup tg = new TransformGroup(); Transform3D t3d = new Transform3D();
t3d.setTranslation(new Vector3d(-1.7, 0.5, 0.0)); t3d.setRotation(new AxisAngle4f(0.0f, 1.0f, 0.0f, 3.14f)); t3d.setScale(1.5); tg.setTransform(t3d);
selector_2.setCapability(Switch.ALLOW_SWITCH_WRITE); selector_2.addChild(createObjLoad("model/Sitting_Leo.obj")); selector_2.addChild(createObjLoad("model/Leo_right_paw_left.obj")); selector_2.addChild(createObjLoad("model/Leo_right_paw_right.obj")); selector_2.addChild(createObjLoad("model/Leo_right_paw_up.obj")); selector_2.addChild(createObjLoad("model/Leo_right_paw_down.obj")); selector_2.addChild(createObjLoad("model/Leo_right_paw_more_right.obj"));
flag_i_2.clear(); flag_i_2.set(0); selector_2.setChildMask(flag_i_2);
tg.addChild(selector_2); objRoot.addChild(tg);
objRoot.compile();
return objRoot;
}
private void punchTheOtherLightly(double angle, TransformGroup tg_pome, Transform3D t3d_pome, BitSet flag_i_pome, Switch selector_pome, boolean ft_pome) {
if (ft_pome) {
t3dstep.rotY(angle); tg_pome.getTransform(t3d_pome); t3d_pome.get(matrix); t3d_pome.setTranslation(new Vector3d(0.0, 0.0, 0.0)); t3d_pome.mul(t3dstep); t3d_pome.setTranslation(new Vector3d(matrix.m03, matrix.m13, matrix.m23)); tg_pome.setTransform(t3d_pome);
t3dstep.set(new Vector3d(0.0, 0.0, -0.35)); tg_pome.getTransform(t3d_pome); t3d_pome.mul(t3dstep); tg_pome.setTransform(t3d_pome);
}
count2++; System.out.println("count2%2: " + count2 % 2); flag_i_pome.clear(); flag_i_pome.set(count2 % 2); selector_pome.setChildMask(flag_i_pome);
}
private void lookAtTheOther(double angle, TransformGroup tg_pome, Transform3D t3d_pome, String voice_file, long sleep_time, boolean taway) {
if (!taway) { t3dstep.rotY(angle); tg_pome.getTransform(t3d_pome); t3d_pome.get(matrix); t3d_pome.setTranslation(new Vector3d(0.0, 0.0, 0.0)); t3d_pome.mul(t3dstep); t3d_pome.setTranslation(new Vector3d(matrix.m03, matrix.m13, matrix.m23)); tg_pome.setTransform(t3d_pome); } getSound(voice_file);
try { thread.sleep(sleep_time); } catch (InterruptedException ae) { }
if (!taway) { t3dstep.rotY(-angle); tg_pome.getTransform(t3d_pome); t3d_pome.get(matrix); t3d_pome.setTranslation(new Vector3d(0.0, 0.0, 0.0)); t3d_pome.mul(t3dstep); t3d_pome.setTranslation(new Vector3d(matrix.m03, matrix.m13, matrix.m23)); tg_pome.setTransform(t3d_pome);
} }
private BranchGroup createTouchPanel() {
BranchGroup root = new BranchGroup(); TransformGroup tg = new TransformGroup();
Appearance ap = new Appearance();
TransparencyAttributes attr = new TransparencyAttributes(); attr.setTransparencyMode(attr.BLENDED); ap.setTransparencyAttributes(attr);
TextureLoader loader = new TextureLoader("model/pads.png", this); ap.setTexture(loader.getTexture());
PolygonAttributes pattr = new PolygonAttributes(); pattr.setPolygonMode(PolygonAttributes.POLYGON_FILL); pattr.setCullFace(PolygonAttributes.CULL_NONE); ap.setPolygonAttributes(pattr);
Point3f[] vertex = new Point3f[4]; vertex[0] = new Point3f(2.0f, 1.5f, 0.0f); vertex[1] = new Point3f(-2.0f, 1.5f, 0.0f); vertex[2] = new Point3f(-2.0f, -1.5f, 0.0f); vertex[3] = new Point3f(2.0f, -1.5f, 0.0f);
TexCoord2f[] texCoord = new TexCoord2f[4]; texCoord[0] = new TexCoord2f(1.0f, 1.0f); texCoord[1] = new TexCoord2f(0.0f, 1.0f); texCoord[2] = new TexCoord2f(0.0f, 0.0f); texCoord[3] = new TexCoord2f(1.0f, 0.0f);
QuadArray quadA = new QuadArray(vertex.length, GeometryArray.COORDINATES | GeometryArray.TEXTURE_COORDINATE_2); quadA.setCoordinates(0, vertex); quadA.setTextureCoordinates(0, 0, texCoord); Shape3D quad3D = new Shape3D(quadA, ap);
Transform3D t3d = new Transform3D(); t3d.setTranslation(new Vector3d(-0.18, 0.28, 0.0)); t3d.setScale(0.6); tg.setTransform(t3d); tg.addChild(quad3D);
root.addChild(tg);
root.compile();
return root; }
private BranchGroup createObjLoad(String filename) {
BranchGroup objRoot = new BranchGroup();
TransformGroup tg = new TransformGroup(); Transform3D t3d = new Transform3D(); t3d.setScale(1.0); tg.setTransform(t3d);
ObjectFile loader = new ObjectFile(ObjectFile.RESIZE); Scene s = null;
File file = new java.io.File(filename);
try { s = loader.load(file.toURI().toURL()); } catch (Exception e) { System.err.println(e); System.exit(1); }
tg.addChild(s.getSceneGroup());
objRoot.addChild(tg);
objRoot.compile();
return objRoot;
}
public void getSound(String fname) { Clip clip = null;
try { URL url = this.getClass().getClassLoader().getResource(fname); AudioInputStream audioIn = AudioSystem.getAudioInputStream(url); clip = AudioSystem.getClip(); clip.open(audioIn);
clip.start();
} catch (UnsupportedAudioFileException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } catch (LineUnavailableException e) { e.printStackTrace(); } }
public static void main(String args[]) {
Mykeynavbeh window = new Mykeynavbeh();
window.setSize(800, 600);
window.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { System.exit(0); } });
window.setVisible(true); }
public void run() { }
public void keyTyped(KeyEvent e) { char key = e.getKeyChar(); typedKey = String.valueOf(key);
if (key == 'S') {
t3dstep.rotY(-Math.PI / 32); tg_y.getTransform(t3d_y); t3d_y.get(matrix); t3d_y.setTranslation(new Vector3d(0.0, 0.0, 0.0)); t3d_y.mul(t3dstep); t3d_y.setTranslation(new Vector3d(matrix.m03, matrix.m13, matrix.m23)); tg_y.setTransform(t3d_y);
flag_i_2.clear(); flag_i_2.set(1); selector_2.setChildMask(flag_i_2);
}
if (key == 'F') {
t3dstep.rotY(Math.PI / 32); tg_y.getTransform(t3d_y); t3d_y.get(matrix); t3d_y.setTranslation(new Vector3d(0.0, 0.0, 0.0)); t3d_y.mul(t3dstep); t3d_y.setTranslation(new Vector3d(matrix.m03, matrix.m13, matrix.m23)); tg_y.setTransform(t3d_y);
flag_i_2.clear(); flag_i_2.set(2); selector_2.setChildMask(flag_i_2);
}
if (key == 'E') {
t3dstep.rotX(-Math.PI / 128); tg_x.getTransform(t3d_x); t3d_x.get(matrix); t3d_x.setTranslation(new Vector3d(0.0, 0.0, 0.0)); t3d_x.mul(t3dstep); t3d_x.setTranslation(new Vector3d(matrix.m03, matrix.m13, matrix.m23)); tg_x.setTransform(t3d_x);
flag_i_2.clear(); flag_i_2.set(3); selector_2.setChildMask(flag_i_2);
}
if (key == 'C') {
t3dstep.rotX(Math.PI / 128); tg_x.getTransform(t3d_x); t3d_x.get(matrix); t3d_x.setTranslation(new Vector3d(0.0, 0.0, 0.0)); t3d_x.mul(t3dstep); t3d_x.setTranslation(new Vector3d(matrix.m03, matrix.m13, matrix.m23)); tg_x.setTransform(t3d_x);
flag_i_2.clear(); flag_i_2.set(4); selector_2.setChildMask(flag_i_2);
}
if (key == '@') { count++; System.out.println("@_count % 2: " + count % 2); flag_i.clear(); flag_i.set(count % 2); selector.setChildMask(flag_i);
flag_i_2.clear(); flag_i_2.set(5); selector_2.setChildMask(flag_i_2);
}
if (key == '^') {
t3dstep.rotY(-Math.PI / 32); tg_f.getTransform(t3d_f); t3d_f.get(matrix); t3d_f.setTranslation(new Vector3d(0.0, 0.0, 0.0)); t3d_f.mul(t3dstep); t3d_f.setTranslation(new Vector3d(matrix.m03, matrix.m13, matrix.m23)); tg_f.setTransform(t3d_f);
}
if (key == '~') {
t3dstep.rotY(Math.PI / 32); tg_f.getTransform(t3d_f); t3d_f.get(matrix); t3d_f.setTranslation(new Vector3d(0.0, 0.0, 0.0)); t3d_f.mul(t3dstep); t3d_f.setTranslation(new Vector3d(matrix.m03, matrix.m13, matrix.m23)); tg_f.setTransform(t3d_f);
}
if (key == 'a') {
keyOrder = keyOrder + typedKey; System.out.println("keyOrder_a: " + keyOrder);
}
if (key == 'b') {
keyOrder = keyOrder + typedKey; System.out.println("keyOrder_a: " + keyOrder);
}
if (key == 'c') {
keyOrder = keyOrder + typedKey; System.out.println("keyOrder_c: " + keyOrder);
}
if (key == 'd') {
keyOrder = keyOrder + typedKey; System.out.println("keyOrder_c: " + keyOrder);
}
if (key == 'e') {
keyOrder = keyOrder + typedKey; System.out.println("keyOrder_e: " + keyOrder);
}
if (key == 'f') {
keyOrder = keyOrder + typedKey; System.out.println("keyOrder_e: " + keyOrder);
}
if (key == 'g') {
keyOrder = keyOrder + typedKey; System.out.println("keyOrder_a: " + keyOrder);
}
if (key == 'h') {
keyOrder = keyOrder + typedKey; System.out.println("keyOrder_h: " + keyOrder);
}
if (key == 'i') {
keyOrder = keyOrder + typedKey; System.out.println("keyOrder_e: " + keyOrder);
}
if (key == 'l') {
keyOrder = keyOrder + typedKey; System.out.println("keyOrder_e: " + keyOrder);
}
if (key == 'm') {
keyOrder = keyOrder + typedKey; System.out.println("keyOrder_e: " + keyOrder);
}
if (key == 'n') {
keyOrder = keyOrder + typedKey; System.out.println("keyOrder_a: " + keyOrder);
}
if (key == 'o') {
keyOrder = keyOrder + typedKey; System.out.println("keyOrder_h: " + keyOrder);
}
if (key == 'p') {
keyOrder = keyOrder + typedKey; System.out.println("keyOrder_a: " + keyOrder);
}
if (key == 'r') {
keyOrder = keyOrder + typedKey; System.out.println("keyOrder_a: " + keyOrder);
}
if (key == 's') {
keyOrder = keyOrder + typedKey; System.out.println("keyOrder_s: " + keyOrder);
}
if (key == 't') {
keyOrder = keyOrder + typedKey; System.out.println("keyOrder_t: " + keyOrder);
}
if (key == 'v') {
keyOrder = keyOrder + typedKey; System.out.println("keyOrder_t: " + keyOrder);
}
if (key == 'w') {
keyOrder = keyOrder + typedKey; System.out.println("keyOrder_a: " + keyOrder);
}
if (key == 'y') {
keyOrder = keyOrder + typedKey; System.out.println("keyOrder_a: " + keyOrder);
}
if (key == '.') {
keyOrder = keyOrder + typedKey; System.out.println("keyOrder_.: " + keyOrder);
switch (keyOrder) {
case "0cts.": getSound("sound/CygnustheSwan_s10.wav"); try { thread.sleep(1500); } catch (InterruptedException ae) { } getSound("sound/CygnustheSwan_ppt.wav"); try { thread.sleep(150); } catch (InterruptedException ae) { } getSound("sound/CygnustheSwan_ppt.wav"); break;
case "0oth.": getSound("sound/OriontheHunter_s10.wav"); try { thread.sleep(1500); } catch (InterruptedException ae) { } getSound("sound/OriontheHunter_ppt.wav"); try { thread.sleep(150); } catch (InterruptedException ae) { } getSound("sound/OriontheHunter_ppt.wav"); break;
case "0tir.": getSound("sound/This_is_Rigel_s10.wav"); break;
case "0ritoc.": getSound("sound/RigelintheOrionconstellation_s10.wav"); try { thread.sleep(2200); } catch (InterruptedException ae) { } getSound("sound/RigelintheOrionconstellation_ppt.wav"); try { thread.sleep(50); } catch (InterruptedException ae) { } getSound("sound/RigelintheOrionconstellation_ppt.wav"); break;
case "0tib.": getSound("sound/This_is_Betelgeuse_s10.wav"); break;
case "0bitoc.": getSound("sound/BetelgeuseintheOrionconstellation_s10.wav"); try { thread.sleep(2400); } catch (InterruptedException ae) { } getSound("sound/BetelgeuseintheOrionconstellation_ppt.wav"); try { thread.sleep(50); } catch (InterruptedException ae) { } getSound("sound/BetelgeuseintheOrionconstellation_ppt.wav"); break;
case "0ttb.": getSound("sound/TaurustheBull_s10.wav"); try { thread.sleep(1500); } catch (InterruptedException ae) { } getSound("sound/TaurustheBull_ppt.wav"); try { thread.sleep(150); } catch (InterruptedException ae) { } getSound("sound/TaurustheBull_ppt.wav"); break;
case "0atc.": getSound("sound/AurigatheCharioteer_s10.wav"); try { thread.sleep(1700); } catch (InterruptedException ae) { } getSound("sound/AurigatheCharioteer_ppt.wav"); try { thread.sleep(80); } catch (InterruptedException ae) { } getSound("sound/AurigatheCharioteer_ppt.wav"); break;
case "0tic.": getSound("sound/This_is_Capella_s10.wav"); break;
case "0citac.": getSound("sound/CapellaintheAurigaconstellation_s10.wav"); try { thread.sleep(2200); } catch (InterruptedException ae) { } getSound("sound/CapellaintheAurigaconstellation_ppt.wav"); try { thread.sleep(50); } catch (InterruptedException ae) { } getSound("sound/CapellaintheAurigaconstellation_ppt.wav"); break;
case "0gtt.": getSound("sound/GeminitheTwins_s10.wav"); try { thread.sleep(1500); } catch (InterruptedException ae) { } getSound("sound/GeminitheTwins_ppt.wav"); try { thread.sleep(50); } catch (InterruptedException ae) { } getSound("sound/GeminitheTwins_ppt.wav"); try { thread.sleep(1500); } catch (InterruptedException ae) { } lookAtTheOther(-Math.PI / 16, tg_pt, t3d_pt, "sound/Do_you_think_we_can.wav", 2500, turnAway); try { thread.sleep(50); } catch (InterruptedException ae) { } lookAtTheOther(Math.PI / 16, tg_p, t3d_p, "sound/We_will_become_a_part_of.wav", 11500, turnAway);
getSound("sound/I_can't_wait.wav"); break;
case "0ltl.": getSound("sound/LeotheLion_s10.wav"); try { thread.sleep(1500); } catch (InterruptedException ae) { } getSound("sound/LeotheLion_ppt.wav"); try { thread.sleep(80); } catch (InterruptedException ae) { } getSound("sound/LeotheLion_ppt.wav"); break;
case "0cmtgd.": getSound("sound/CanisMajortheGreatDog_s10.wav"); try { thread.sleep(2300); } catch (InterruptedException ae) { } getSound("sound/CanisMajortheGreatDog_ppt.wav"); try { thread.sleep(50); } catch (InterruptedException ae) { } getSound("sound/CanisMajortheGreatDog_ppt.wav"); break;
case "0tisitbsitns.": getSound("sound/This_is_Sirius._It's_s10.wav"); break;
case "0sitcmc.": getSound("sound/SiriusintheCanisMajorconstellation_s10.wav"); try { thread.sleep(2800); } catch (InterruptedException ae) { } getSound("sound/SiriusintheCanisMajorconstellation_ppt.wav"); try { thread.sleep(50); } catch (InterruptedException ae) { } getSound("sound/SiriusintheCanisMajorconstellation_ppt.wav"); break;
case "0cmtld.": getSound("sound/CanisMinortheLesserDog_s10.wav"); try { thread.sleep(2300); } catch (InterruptedException ae) { } getSound("sound/CanisMinortheLesserDog_ppt.wav"); try { thread.sleep(50); } catch (InterruptedException ae) { } getSound("sound/CanisMinortheLesserDog_ppt.wav"); break;
case "0tip.": getSound("sound/This_is_Procyon_s10.wav"); break;
case "0pitcmc.": getSound("sound/ProcyonintheCanisMinorconstellation_s10.wav"); try { thread.sleep(2800); } catch (InterruptedException ae) { } getSound("sound/ProcyonintheCanisMinorconstellation_ppt.wav"); try { thread.sleep(50); } catch (InterruptedException ae) { } getSound("sound/ProcyonintheCanisMinorconstellation_ppt.wav"); break;
case "0lth.": getSound("sound/LyratheHarp_s10.wav"); try { thread.sleep(1500); } catch (InterruptedException ae) { } getSound("sound/LyratheHarp_ppt.wav"); try { thread.sleep(80); } catch (InterruptedException ae) { } getSound("sound/LyratheHarp_ppt.wav"); break;
case "0tiv.": getSound("sound/This_is_Vega_s10.wav"); break;
case "0vitlc.": getSound("sound/VegaintheLyraconstellation_s10.wav"); try { thread.sleep(2200); } catch (InterruptedException ae) { } getSound("sound/VegaintheLyraconstellation_ppt.wav"); try { thread.sleep(50); } catch (InterruptedException ae) { } getSound("sound/VegaintheLyraconstellation_ppt.wav"); break;
case "0ate.": getSound("sound/AquilatheEagle_s10.wav"); try { thread.sleep(1800); } catch (InterruptedException ae) { } getSound("sound/AquilatheEagle_ppt.wav"); try { thread.sleep(150); } catch (InterruptedException ae) { } getSound("sound/AquilatheEagle_ppt.wav"); break;
case "0tial.": getSound("sound/This_is_Altair_s10.wav"); break;
case "0aitac.": getSound("sound/AltairintheAquilaconstellation_s10.wav"); try { thread.sleep(2400); } catch (InterruptedException ae) { } getSound("sound/AltairintheAquilaconstellation_ppt.wav"); try { thread.sleep(50); } catch (InterruptedException ae) { } getSound("sound/AltairintheAquilaconstellation_ppt.wav"); break;
case "0vaaaetf.": getSound("sound/Vega_and_Altair_are_s10.wav"); try { thread.sleep(2300); } catch (InterruptedException ae) { } lookAtTheOther(-Math.PI / 16, tg_pt, t3d_pt, "sound/I_know_the_story_of_them.wav", 14000, turnAway); try { thread.sleep(50); } catch (InterruptedException ae) { } lookAtTheOther(Math.PI / 16, tg_p, t3d_p, "sound/It's_impossible.wav", 10000, turnAway);
flag_i_2.clear(); flag_i_2.set(0); selector_2.setChildMask(flag_i_2);
for (int k = 0; k < 32; k++) {
t3dstep.rotY(-Math.PI / 32); tg_f.getTransform(t3d_f); t3d_f.get(matrix); t3d_f.setTranslation(new Vector3d(0.0, 0.0, 0.0)); t3d_f.mul(t3dstep); t3d_f.setTranslation(new Vector3d(matrix.m03, matrix.m13, matrix.m23)); tg_f.setTransform(t3d_f);
t3dstep.rotY(-Math.PI / 32); tg_y.getTransform(t3d_y); t3d_y.get(matrix); t3d_y.setTranslation(new Vector3d(0.0, 0.0, 0.0)); t3d_y.mul(t3dstep); t3d_y.setTranslation(new Vector3d(matrix.m03, matrix.m13, matrix.m23)); tg_y.setTransform(t3d_y);
try { thread.sleep(7); } catch (InterruptedException ae) { } }
getSound("sound/I_knew_you'd_say_that!_You_+6.0_db.wav");
for (int i = 0; i < 2; i++) {
try { thread.sleep(200); } catch (InterruptedException ae) { }
if (firstTime) { ft = true; firstTime = false; } else { ft = false; } if (i == 0) { if (turnAway) { t3dstep.rotY(-Math.PI / 6); tg_pt.getTransform(t3d_pt); t3d_pt.get(matrix); t3d_pt.setTranslation(new Vector3d(0.0, 0.0, 0.0)); t3d_pt.mul(t3dstep); t3d_pt.setTranslation(new Vector3d(matrix.m03, matrix.m13, matrix.m23)); tg_pt.setTransform(t3d_pt);
t3dstep.rotY(Math.PI / 6); tg_p.getTransform(t3d_p); t3d_p.get(matrix); t3d_p.setTranslation(new Vector3d(0.0, 0.0, 0.0)); t3d_p.mul(t3dstep); t3d_p.setTranslation(new Vector3d(matrix.m03, matrix.m13, matrix.m23)); tg_p.setTransform(t3d_p); } }
punchTheOtherLightly(-Math.PI / 4, tg_pt, t3d_pt, flag_i_3, selector_3, ft); }
try { thread.sleep(3000); } catch (InterruptedException ae) { } getSound("sound/I_didn't_mean_that.wav");
for (int i = 0; i < 2; i++) {
try { thread.sleep(200); } catch (InterruptedException ae) { }
if (firstTime2) { ft = true; firstTime2 = false; } else { ft = false; } punchTheOtherLightly(Math.PI / 4, tg_p, t3d_p, flag_i_4, selector_4, ft); }
try { thread.sleep(500); } catch (InterruptedException ae) { }
for (int i = 0; i < 2; i++) {
getSound("sound/Yesyou_did_+6.0_db.wav");
for (int j = 0; j < 8; j++) {
try { thread.sleep(150); } catch (InterruptedException ae) { }
punchTheOtherLightly(-Math.PI / 4, tg_pt, t3d_pt, flag_i_3, selector_3, ft); }
getSound("sound/NoI_didn't.wav");
for (int j = 0; j < 8; j++) {
try { thread.sleep(150); } catch (InterruptedException ae) { }
punchTheOtherLightly(Math.PI / 4, tg_p, t3d_p, flag_i_4, selector_4, ft); }
}
t3dstep.set(new Vector3d(0.0, 0.0, 0.35)); tg_pt.getTransform(t3d_pt); t3d_pt.mul(t3dstep); tg_pt.setTransform(t3d_pt);
t3dstep.rotY(Math.PI * 5 / 12); tg_pt.getTransform(t3d_pt); t3d_pt.get(matrix); t3d_pt.setTranslation(new Vector3d(0.0, 0.0, 0.0)); t3d_pt.mul(t3dstep); t3d_pt.setTranslation(new Vector3d(matrix.m03, matrix.m13, matrix.m23)); tg_pt.setTransform(t3d_pt);
t3dstep.set(new Vector3d(0.0, 0.0, 0.35)); tg_p.getTransform(t3d_p); t3d_p.mul(t3dstep); tg_p.setTransform(t3d_p);
t3dstep.rotY(-Math.PI * 5 / 12); tg_p.getTransform(t3d_p); t3d_p.get(matrix); t3d_p.setTranslation(new Vector3d(0.0, 0.0, 0.0)); t3d_p.mul(t3dstep); t3d_p.setTranslation(new Vector3d(matrix.m03, matrix.m13, matrix.m23)); tg_p.setTransform(t3d_p);
firstTime = true; firstTime2 = true; ft = true; turnAway = true; break;
case "0ptwh.": getSound("sound/PegasustheWingedHorse_s10.wav"); try { thread.sleep(2000); } catch (InterruptedException ae) { } getSound("sound/PegasustheWingedHorse_ppt.wav"); try { thread.sleep(50); } catch (InterruptedException ae) { } getSound("sound/PegasustheWingedHorse_ppt.wav"); break;
case "0atwb.": getSound("sound/AquariustheWaterBearer_s10.wav"); try { thread.sleep(2000); } catch (InterruptedException ae) { } getSound("sound/AquariustheWaterBearer_ppt.wav"); try { thread.sleep(50); } catch (InterruptedException ae) { } getSound("sound/AquariustheWaterBearer_ppt.wav"); break;
case "0ctsg.": getSound("sound/CapricornustheSeaGoat_s10.wav"); try { thread.sleep(2000); } catch (InterruptedException ae) { } getSound("sound/CapricornustheSeaGoat_ppt.wav"); try { thread.sleep(50); } catch (InterruptedException ae) { } getSound("sound/CapricornustheSeaGoat_ppt.wav"); break;
case "0sts.": getSound("sound/ScorpiustheScorpion_s10.wav"); try { thread.sleep(2000); } catch (InterruptedException ae) { } getSound("sound/ScorpiustheScorpion_ppt.wav"); try { thread.sleep(50); } catch (InterruptedException ae) { } getSound("sound/ScorpiustheScorpion_ppt.wav"); break;
case "0lts.": getSound("sound/LibratheScale_s10.wav"); try { thread.sleep(2000); } catch (InterruptedException ae) { } getSound("sound/LibratheScale_ppt.wav"); try { thread.sleep(50); } catch (InterruptedException ae) { } getSound("sound/LibratheScale_ppt.wav"); break;
case "0bth.": getSound("sound/BootestheHerdsman_s10.wav"); try { thread.sleep(1500); } catch (InterruptedException ae) { } getSound("sound/BootestheHerdsman_ppt.wav"); try { thread.sleep(50); } catch (InterruptedException ae) { } getSound("sound/BootestheHerdsman_ppt.wav"); break;
case "0tiar.": getSound("sound/This_is_Arcturus_s10.wav"); break;
case "0aitbc.": getSound("sound/ArcturusintheBootesconstellation_s10.wav"); try { thread.sleep(2500); } catch (InterruptedException ae) { } getSound("sound/ArcturusintheBootesconstellation_ppt.wav"); try { thread.sleep(50); } catch (InterruptedException ae) { } getSound("sound/ArcturusintheBootesconstellation_ppt.wav"); break;
case "0cbtnc.": getSound("sound/CoronaBorealistheNorthernCrown_s10.wav"); try { thread.sleep(2200); } catch (InterruptedException ae) { } getSound("sound/CoronaBorealistheNorthernCrown_ppt.wav"); try { thread.sleep(50); } catch (InterruptedException ae) { } getSound("sound/CoronaBorealistheNorthernCrown_ppt.wav"); break;
}
keyOrder = "0"; System.out.println("keyOrder_0: " + keyOrder);
} }
public void keyReleased(KeyEvent e) { keyNavBeh.setEnable(true); }
public void keyPressed(KeyEvent e) {
char key = e.getKeyChar();
if (key == '-') { keyNavBeh.setEnable(false); } }
}