From f7decc35f64cd13be2a832347f78a5ba97d13a4d Mon Sep 17 00:00:00 2001 From: jada Date: Fri, 17 Feb 2006 02:11:00 +0000 Subject: 1. Converted example programs, under appearance, background and collision, to use JFrame instead of MainFrame. 2. Created a GUI .form file for each example program. 3. Rename universe configuration file, ie. add .cfg as file extension. --- .../j3d/examples/appearance/AppearanceMixed.form | 36 ++++ .../j3d/examples/appearance/AppearanceMixed.java | 134 +++++++------ .../j3d/examples/appearance/AppearanceTest.form | 36 ++++ .../j3d/examples/appearance/AppearanceTest.java | 128 +++++++----- .../examples/background/BackgroundGeometry.form | 37 ++++ .../examples/background/BackgroundGeometry.java | 145 ++++++++------ .../j3d/examples/collision/TickTockCollision.form | 36 ++++ .../j3d/examples/collision/TickTockCollision.java | 103 +++++++--- .../configured_universe/ConfigObjLoad.java | 19 +- .../j3d/examples/configured_universe/README.txt | 28 +-- .../j3d/examples/configured_universe/j3d1x1 | 98 --------- .../examples/configured_universe/j3d1x1-behavior | 149 -------------- .../configured_universe/j3d1x1-behavior.cfg | 149 ++++++++++++++ .../j3d/examples/configured_universe/j3d1x1-stereo | 113 ----------- .../examples/configured_universe/j3d1x1-stereo.cfg | 113 +++++++++++ .../j3d/examples/configured_universe/j3d1x1-vr | 212 -------------------- .../j3d/examples/configured_universe/j3d1x1-vr.cfg | 212 ++++++++++++++++++++ .../j3d/examples/configured_universe/j3d1x1-window | 89 --------- .../examples/configured_universe/j3d1x1-window.cfg | 89 +++++++++ .../j3d/examples/configured_universe/j3d1x1.cfg | 98 +++++++++ .../j3d/examples/configured_universe/j3d1x2-flat | 134 ------------- .../examples/configured_universe/j3d1x2-flat.cfg | 134 +++++++++++++ .../j3d/examples/configured_universe/j3d1x2-rot30 | 99 --------- .../examples/configured_universe/j3d1x2-rot30.cfg | 99 +++++++++ .../j3d/examples/configured_universe/j3d1x3-cave | 171 ---------------- .../examples/configured_universe/j3d1x3-cave-vr | 222 --------------------- .../configured_universe/j3d1x3-cave-vr.cfg | 222 +++++++++++++++++++++ .../examples/configured_universe/j3d1x3-cave.cfg | 171 ++++++++++++++++ .../j3d/examples/configured_universe/j3d1x3-rot45 | 110 ---------- .../examples/configured_universe/j3d1x3-rot45.cfg | 110 ++++++++++ .../j3d/examples/configured_universe/j3d2x2-flat | 135 ------------- .../examples/configured_universe/j3d2x2-flat.cfg | 135 +++++++++++++ 32 files changed, 2011 insertions(+), 1755 deletions(-) create mode 100644 src/classes/org/jdesktop/j3d/examples/appearance/AppearanceMixed.form create mode 100644 src/classes/org/jdesktop/j3d/examples/appearance/AppearanceTest.form create mode 100644 src/classes/org/jdesktop/j3d/examples/background/BackgroundGeometry.form create mode 100644 src/classes/org/jdesktop/j3d/examples/collision/TickTockCollision.form delete mode 100644 src/classes/org/jdesktop/j3d/examples/configured_universe/j3d1x1 delete mode 100644 src/classes/org/jdesktop/j3d/examples/configured_universe/j3d1x1-behavior create mode 100644 src/classes/org/jdesktop/j3d/examples/configured_universe/j3d1x1-behavior.cfg delete mode 100644 src/classes/org/jdesktop/j3d/examples/configured_universe/j3d1x1-stereo create mode 100644 src/classes/org/jdesktop/j3d/examples/configured_universe/j3d1x1-stereo.cfg delete mode 100644 src/classes/org/jdesktop/j3d/examples/configured_universe/j3d1x1-vr create mode 100644 src/classes/org/jdesktop/j3d/examples/configured_universe/j3d1x1-vr.cfg delete mode 100644 src/classes/org/jdesktop/j3d/examples/configured_universe/j3d1x1-window create mode 100644 src/classes/org/jdesktop/j3d/examples/configured_universe/j3d1x1-window.cfg create mode 100644 src/classes/org/jdesktop/j3d/examples/configured_universe/j3d1x1.cfg delete mode 100644 src/classes/org/jdesktop/j3d/examples/configured_universe/j3d1x2-flat create mode 100644 src/classes/org/jdesktop/j3d/examples/configured_universe/j3d1x2-flat.cfg delete mode 100644 src/classes/org/jdesktop/j3d/examples/configured_universe/j3d1x2-rot30 create mode 100644 src/classes/org/jdesktop/j3d/examples/configured_universe/j3d1x2-rot30.cfg delete mode 100644 src/classes/org/jdesktop/j3d/examples/configured_universe/j3d1x3-cave delete mode 100644 src/classes/org/jdesktop/j3d/examples/configured_universe/j3d1x3-cave-vr create mode 100644 src/classes/org/jdesktop/j3d/examples/configured_universe/j3d1x3-cave-vr.cfg create mode 100644 src/classes/org/jdesktop/j3d/examples/configured_universe/j3d1x3-cave.cfg delete mode 100644 src/classes/org/jdesktop/j3d/examples/configured_universe/j3d1x3-rot45 create mode 100644 src/classes/org/jdesktop/j3d/examples/configured_universe/j3d1x3-rot45.cfg delete mode 100644 src/classes/org/jdesktop/j3d/examples/configured_universe/j3d2x2-flat create mode 100644 src/classes/org/jdesktop/j3d/examples/configured_universe/j3d2x2-flat.cfg diff --git a/src/classes/org/jdesktop/j3d/examples/appearance/AppearanceMixed.form b/src/classes/org/jdesktop/j3d/examples/appearance/AppearanceMixed.form new file mode 100644 index 0000000..2440a43 --- /dev/null +++ b/src/classes/org/jdesktop/j3d/examples/appearance/AppearanceMixed.form @@ -0,0 +1,36 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/classes/org/jdesktop/j3d/examples/appearance/AppearanceMixed.java b/src/classes/org/jdesktop/j3d/examples/appearance/AppearanceMixed.java index bed5d0b..f499fd0 100644 --- a/src/classes/org/jdesktop/j3d/examples/appearance/AppearanceMixed.java +++ b/src/classes/org/jdesktop/j3d/examples/appearance/AppearanceMixed.java @@ -44,22 +44,22 @@ package org.jdesktop.j3d.examples.appearance; -import java.applet.Applet; -import java.awt.*; -import java.awt.GraphicsConfiguration; -import com.sun.j3d.utils.applet.MainFrame; -import com.sun.j3d.utils.universe.*; import com.sun.j3d.utils.image.TextureLoader; +import com.sun.j3d.utils.universe.*; import javax.media.j3d.*; import javax.vecmath.*; +import java.awt.GraphicsConfiguration; import org.jdesktop.j3d.examples.Resources; -public class AppearanceMixed extends Applet { - - private java.net.URL bgImage; - private java.net.URL texImage; +/** + * Simple Java 3D example program to display a spinning cube. + */ +public class AppearanceMixed extends javax.swing.JFrame { - private SimpleUniverse u = null; + private java.net.URL texImage = null; + private java.net.URL bgImage = null; + private SimpleUniverse univ = null; + private BranchGroup scene = null; static class MyCanvas3D extends Canvas3D { private GraphicsContext3D gc; @@ -432,16 +432,34 @@ public class AppearanceMixed extends Applet { } - public AppearanceMixed() { - } + private Canvas3D createUniverse() { + // Get the preferred graphics configuration for the default screen + GraphicsConfiguration config = + SimpleUniverse.getPreferredConfiguration(); + + // Create a MyCanvas3D using the preferred configuration + MyCanvas3D c = new MyCanvas3D(config); + + // Create simple universe with view branch + univ = new SimpleUniverse(c); - public AppearanceMixed(java.net.URL bgurl, java.net.URL texurl) { - bgImage = bgurl; - texImage = texurl; + // This will move the ViewPlatform back a bit so the + // objects in the scene can be viewed. + univ.getViewingPlatform().setNominalViewingTransform(); + + // Ensure at least 5 msec per frame (i.e., < 200Hz) + univ.getViewer().getView().setMinimumFrameCycleTime(5); + + return c; } - public void init() { + + /** + * Creates new form AppearanceTest + */ + public AppearanceMixed() { + if (bgImage == null) { - // the path to the image for an applet + // the path to the image for an applet bgImage = Resources.getResource("resources/images/bg.jpg"); if (bgImage == null) { System.err.println("resources/images/bg.jpg not found"); @@ -458,48 +476,52 @@ public class AppearanceMixed extends Applet { } } - setLayout(new BorderLayout()); - GraphicsConfiguration config = - SimpleUniverse.getPreferredConfiguration(); + // Initialize the GUI components + initComponents(); - MyCanvas3D c = new MyCanvas3D(config); - add("Center", c); + // Create Canvas3D and SimpleUniverse; add canvas to drawing panel + Canvas3D c = createUniverse(); + drawingPanel.add(c, java.awt.BorderLayout.CENTER); - // Create a simple scene and attach it to the virtual universe - BranchGroup scene = createSceneGraph(); - u = new SimpleUniverse(c); - - // This will move the ViewPlatform back a bit so the - // objects in the scene can be viewed. - u.getViewingPlatform().setNominalViewingTransform(); - - u.addBranchGraph(scene); + // Create the content branch and add it to the universe + scene = createSceneGraph(); + univ.addBranchGraph(scene); } - public void destroy() { - u.cleanup(); - } - - - // - // The following allows AppearanceMixed to be run as an application - // as well as an applet - // - public static void main(String[] args) { - // the path to the image file for an application - java.net.URL bgurl = null; - java.net.URL texurl = null; - bgurl = Resources.getResource("resources/images/bg.jpg"); - if (bgurl == null) { - System.err.println("resources/images/bg.jpg not found"); - System.exit(1); - } - texurl = Resources.getResource("resources/images/apimage.jpg"); - if (texurl == null) { - System.err.println("resources/images/apimage.jpg not found"); - System.exit(1); - } - - new MainFrame(new AppearanceMixed(bgurl, texurl), 700, 700); + // ---------------------------------------------------------------- + + /** This method is called from within the constructor to + * initialize the form. + * WARNING: Do NOT modify this code. The content of this method is + * always regenerated by the Form Editor. + */ + // //GEN-BEGIN:initComponents + private void initComponents() { + drawingPanel = new javax.swing.JPanel(); + + setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); + setTitle("AppearanceTest"); + drawingPanel.setLayout(new java.awt.BorderLayout()); + + drawingPanel.setPreferredSize(new java.awt.Dimension(700, 700)); + getContentPane().add(drawingPanel, java.awt.BorderLayout.CENTER); + + pack(); + }// //GEN-END:initComponents + + /** + * @param args the command line arguments + */ + public static void main(String args[]) { + java.awt.EventQueue.invokeLater(new Runnable() { + public void run() { + new AppearanceMixed().setVisible(true); + } + }); } + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JPanel drawingPanel; + // End of variables declaration//GEN-END:variables + } diff --git a/src/classes/org/jdesktop/j3d/examples/appearance/AppearanceTest.form b/src/classes/org/jdesktop/j3d/examples/appearance/AppearanceTest.form new file mode 100644 index 0000000..43cd90f --- /dev/null +++ b/src/classes/org/jdesktop/j3d/examples/appearance/AppearanceTest.form @@ -0,0 +1,36 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/classes/org/jdesktop/j3d/examples/appearance/AppearanceTest.java b/src/classes/org/jdesktop/j3d/examples/appearance/AppearanceTest.java index 03f25d8..86091f7 100644 --- a/src/classes/org/jdesktop/j3d/examples/appearance/AppearanceTest.java +++ b/src/classes/org/jdesktop/j3d/examples/appearance/AppearanceTest.java @@ -44,21 +44,22 @@ package org.jdesktop.j3d.examples.appearance; -import java.applet.Applet; -import java.awt.*; -import com.sun.j3d.utils.applet.MainFrame; -import com.sun.j3d.utils.universe.*; import com.sun.j3d.utils.image.TextureLoader; +import com.sun.j3d.utils.universe.*; import javax.media.j3d.*; import javax.vecmath.*; +import java.awt.GraphicsConfiguration; import org.jdesktop.j3d.examples.Resources; -public class AppearanceTest extends Applet { +/** + * Simple Java 3D example program to display a spinning cube. + */ +public class AppearanceTest extends javax.swing.JFrame { private java.net.URL texImage = null; private java.net.URL bgImage = null; - - private SimpleUniverse u = null; + private SimpleUniverse univ = null; + private BranchGroup scene = null; private BranchGroup createSceneGraph() { // Create the root of the branch graph @@ -305,16 +306,32 @@ public class AppearanceTest extends Applet { return objTrans; } + private Canvas3D createUniverse() { + // Get the preferred graphics configuration for the default screen + GraphicsConfiguration config = + SimpleUniverse.getPreferredConfiguration(); - public AppearanceTest() { - } + // Create a Canvas3D using the preferred configuration + Canvas3D c = new Canvas3D(config); + + // Create simple universe with view branch + univ = new SimpleUniverse(c); + + // This will move the ViewPlatform back a bit so the + // objects in the scene can be viewed. + univ.getViewingPlatform().setNominalViewingTransform(); - public AppearanceTest(java.net.URL bgurl, java.net.URL texurl) { - bgImage = bgurl; - texImage = texurl; + // Ensure at least 5 msec per frame (i.e., < 200Hz) + univ.getViewer().getView().setMinimumFrameCycleTime(5); + + return c; } - - public void init() { + + /** + * Creates new form AppearanceTest + */ + public AppearanceTest() { + if (bgImage == null) { // the path to the image for an applet bgImage = Resources.getResource("resources/images/bg.jpg"); @@ -332,50 +349,53 @@ public class AppearanceTest extends Applet { System.exit(1); } } - - setLayout(new BorderLayout()); - GraphicsConfiguration config = - SimpleUniverse.getPreferredConfiguration(); - - Canvas3D c = new Canvas3D(config); - add("Center", c); - // Create a simple scene and attach it to the virtual universe - BranchGroup scene = createSceneGraph(); - u = new SimpleUniverse(c); + // Initialize the GUI components + initComponents(); - // This will move the ViewPlatform back a bit so the - // objects in the scene can be viewed. - u.getViewingPlatform().setNominalViewingTransform(); - - u.addBranchGraph(scene); - } + // Create Canvas3D and SimpleUniverse; add canvas to drawing panel + Canvas3D c = createUniverse(); + drawingPanel.add(c, java.awt.BorderLayout.CENTER); - public void destroy() { - u.cleanup(); + // Create the content branch and add it to the universe + scene = createSceneGraph(); + univ.addBranchGraph(scene); } - - // - // The following allows AppearanceTest to be run as an application - // as well as an applet - // - public static void main(String[] args) { - // the path to the image file for an application - java.net.URL bgurl = null; - java.net.URL texurl = null; - - bgurl = Resources.getResource("resources/images/bg.jpg"); - if (bgurl == null) { - System.err.println("resources/images/bg.jpg not found"); - System.exit(1); - } - texurl = Resources.getResource("resources/images/apimage.jpg"); - if (texurl == null) { - System.err.println("resources/images/apimage.jpg not found"); - System.exit(1); - } - - new MainFrame(new AppearanceTest(bgurl, texurl), 700, 700); + // ---------------------------------------------------------------- + + /** This method is called from within the constructor to + * initialize the form. + * WARNING: Do NOT modify this code. The content of this method is + * always regenerated by the Form Editor. + */ + // //GEN-BEGIN:initComponents + private void initComponents() { + drawingPanel = new javax.swing.JPanel(); + + setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); + setTitle("AppearanceTest"); + drawingPanel.setLayout(new java.awt.BorderLayout()); + + drawingPanel.setPreferredSize(new java.awt.Dimension(700, 700)); + getContentPane().add(drawingPanel, java.awt.BorderLayout.CENTER); + + pack(); + }// //GEN-END:initComponents + + /** + * @param args the command line arguments + */ + public static void main(String args[]) { + java.awt.EventQueue.invokeLater(new Runnable() { + public void run() { + new AppearanceMixed().setVisible(true); + } + }); } + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JPanel drawingPanel; + // End of variables declaration//GEN-END:variables + } diff --git a/src/classes/org/jdesktop/j3d/examples/background/BackgroundGeometry.form b/src/classes/org/jdesktop/j3d/examples/background/BackgroundGeometry.form new file mode 100644 index 0000000..9e76404 --- /dev/null +++ b/src/classes/org/jdesktop/j3d/examples/background/BackgroundGeometry.form @@ -0,0 +1,37 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/classes/org/jdesktop/j3d/examples/background/BackgroundGeometry.java b/src/classes/org/jdesktop/j3d/examples/background/BackgroundGeometry.java index 86c380a..e3391b4 100644 --- a/src/classes/org/jdesktop/j3d/examples/background/BackgroundGeometry.java +++ b/src/classes/org/jdesktop/j3d/examples/background/BackgroundGeometry.java @@ -46,22 +46,22 @@ package org.jdesktop.j3d.examples.background; import com.sun.j3d.utils.image.TextureLoader; import com.sun.j3d.utils.behaviors.mouse.*; -import java.applet.Applet; -import java.awt.*; -import com.sun.j3d.utils.applet.MainFrame; import com.sun.j3d.utils.geometry.*; import com.sun.j3d.utils.universe.*; import javax.media.j3d.*; import javax.vecmath.*; +import java.awt.GraphicsConfiguration; import org.jdesktop.j3d.examples.Resources; -public class BackgroundGeometry extends Applet { - - BoundingSphere bounds = new BoundingSphere(new Point3d(0.0,0.0,0.0), 100.0); +/** + * Simple Java 3D example program to display a spinning cube. + */ +public class BackgroundGeometry extends javax.swing.JFrame { + private SimpleUniverse univ = null; + private BranchGroup scene = null; private java.net.URL bgImage = null; - - private SimpleUniverse u = null; + private BoundingSphere bounds = new BoundingSphere(new Point3d(0.0,0.0,0.0), 100.0); public BranchGroup createSceneGraph() { @@ -153,47 +153,32 @@ public class BackgroundGeometry extends Applet { lgt2.setInfluencingBounds(bounds); objScale.addChild(lgt1); objScale.addChild(lgt2); - return objRoot; } - public BackgroundGeometry (){ - } + private Canvas3D createUniverse() { + // Get the preferred graphics configuration for the default screen + GraphicsConfiguration config = + SimpleUniverse.getPreferredConfiguration(); - public BackgroundGeometry(java.net.URL bgurl) { - bgImage = bgurl; - } + // Create a Canvas3D using the preferred configuration + Canvas3D c = new Canvas3D(config); - public void init() { + // Create simple universe with view branch + univ = new SimpleUniverse(c); - if (bgImage == null) { - // the path to the image for an applet - bgImage = Resources.getResource("resources/images/bg.jpg"); - if (bgImage == null) { - System.err.println("resources/images/bg.jpg not found"); - System.exit(1); - } - - } - setLayout(new BorderLayout()); - GraphicsConfiguration config = - SimpleUniverse.getPreferredConfiguration(); + // This will move the ViewPlatform back a bit so the + // objects in the scene can be viewed. + univ.getViewingPlatform().setNominalViewingTransform(); - Canvas3D c = new Canvas3D(config); - add("Center", c); - - BranchGroup scene = createSceneGraph(); - u = new SimpleUniverse(c); - - // This will move the ViewPlatform back a bit so the - // objects in the scene can be viewed. - u.getViewingPlatform().setNominalViewingTransform(); + // Ensure at least 5 msec per frame (i.e., < 200Hz) + univ.getViewer().getView().setMinimumFrameCycleTime(5); TransformGroup viewTrans = - u.getViewingPlatform().getViewPlatformTransform(); - - // Create the rotate behavior node + univ.getViewingPlatform().getViewPlatformTransform(); + + // Create the rotate behavior node MouseRotate behavior1 = new MouseRotate(viewTrans); scene.addChild(behavior1); behavior1.setSchedulingBounds(bounds); @@ -208,28 +193,74 @@ public class BackgroundGeometry extends Applet { scene.addChild(behavior3); behavior3.setSchedulingBounds(bounds); + return c; + } + + /** + * Creates new form HelloUniverse + */ + public BackgroundGeometry() { + + if (bgImage == null) { + // the path to the image for an applet + bgImage = Resources.getResource("resources/images/bg.jpg"); + if (bgImage == null) { + System.err.println("resources/images/bg.jpg not found"); + System.exit(1); + } + } + + // Initialize the GUI components + initComponents(); + + // Create the content branch and add it to the universe + scene = createSceneGraph(); + + // Create Canvas3D and SimpleUniverse; add canvas to drawing panel + Canvas3D c = createUniverse(); + drawingPanel.add(c, java.awt.BorderLayout.CENTER); + // Let Java 3D perform optimizations on this scene graph. scene.compile(); - u.addBranchGraph(scene); + univ.addBranchGraph(scene); } - public void destroy() { - u.cleanup(); - } - - public static void main(String argv[]) { - System.out.println("Usage: mouse buttons to rotate, zoom or translate the view platform transform"); - System.out.println(" Note that the background geometry only changes with rotation"); - // the path to the image file for an application - java.net.URL bgurl = null; - - bgurl = Resources.getResource("resources/images/bg.jpg"); - if (bgurl == null) { - System.err.println("resources/images/bg.jpg not found"); - System.exit(1); - } - new MainFrame(new BackgroundGeometry(bgurl), 750, 750); + // ---------------------------------------------------------------- + + /** This method is called from within the constructor to + * initialize the form. + * WARNING: Do NOT modify this code. The content of this method is + * always regenerated by the Form Editor. + */ + // //GEN-BEGIN:initComponents + private void initComponents() { + drawingPanel = new javax.swing.JPanel(); + + setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); + setTitle("BackgroundGeometry"); + drawingPanel.setLayout(new java.awt.BorderLayout()); + + drawingPanel.setOpaque(false); + drawingPanel.setPreferredSize(new java.awt.Dimension(700, 700)); + getContentPane().add(drawingPanel, java.awt.BorderLayout.CENTER); + + pack(); + }// //GEN-END:initComponents + + /** + * @param args the command line arguments + */ + public static void main(String args[]) { + java.awt.EventQueue.invokeLater(new Runnable() { + public void run() { + new BackgroundGeometry().setVisible(true); + } + }); } + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JPanel drawingPanel; + // End of variables declaration//GEN-END:variables + } - diff --git a/src/classes/org/jdesktop/j3d/examples/collision/TickTockCollision.form b/src/classes/org/jdesktop/j3d/examples/collision/TickTockCollision.form new file mode 100644 index 0000000..5a555b4 --- /dev/null +++ b/src/classes/org/jdesktop/j3d/examples/collision/TickTockCollision.form @@ -0,0 +1,36 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/classes/org/jdesktop/j3d/examples/collision/TickTockCollision.java b/src/classes/org/jdesktop/j3d/examples/collision/TickTockCollision.java index 731dff7..5a85067 100644 --- a/src/classes/org/jdesktop/j3d/examples/collision/TickTockCollision.java +++ b/src/classes/org/jdesktop/j3d/examples/collision/TickTockCollision.java @@ -44,19 +44,22 @@ package org.jdesktop.j3d.examples.collision; -import java.applet.Applet; import java.awt.*; import java.awt.event.*; -import com.sun.j3d.utils.applet.MainFrame; -import com.sun.j3d.utils.geometry.ColorCube; import com.sun.j3d.utils.universe.*; +import com.sun.j3d.utils.geometry.ColorCube; import javax.media.j3d.*; import javax.vecmath.*; +import java.awt.GraphicsConfiguration; -public class TickTockCollision extends Applet { +/** + * Simple Java 3D example program to display a spinning cube. + */ +public class TickTockCollision extends javax.swing.JFrame { + + private SimpleUniverse univ = null; + private BranchGroup scene = null; - private SimpleUniverse u = null; - public BranchGroup createSceneGraph() { // Create the root of the branch graph BranchGroup objRoot = new BranchGroup(); @@ -149,7 +152,6 @@ public class TickTockCollision extends Applet { return objRoot; } - private Group createBox(double scale, Vector3d pos) { // Create a transform group node to scale and position the object. Transform3D t = new Transform3D(); @@ -182,38 +184,77 @@ public class TickTockCollision extends Applet { return objTrans; } + private Canvas3D createUniverse() { + // Get the preferred graphics configuration for the default screen + GraphicsConfiguration config = + SimpleUniverse.getPreferredConfiguration(); - public TickTockCollision() { - } - - public void init() { - setLayout(new BorderLayout()); - GraphicsConfiguration config = - SimpleUniverse.getPreferredConfiguration(); + // Create a Canvas3D using the preferred configuration + Canvas3D c = new Canvas3D(config); - Canvas3D c = new Canvas3D(config); - add("Center", c); + // Create simple universe with view branch + univ = new SimpleUniverse(c); - // Create a simple scene and attach it to the virtual universe - BranchGroup scene = createSceneGraph(); - u = new SimpleUniverse(c); + // This will move the ViewPlatform back a bit so the + // objects in the scene can be viewed. + univ.getViewingPlatform().setNominalViewingTransform(); - // This will move the ViewPlatform back a bit so the - // objects in the scene can be viewed. - u.getViewingPlatform().setNominalViewingTransform(); + // Ensure at least 5 msec per frame (i.e., < 200Hz) + univ.getViewer().getView().setMinimumFrameCycleTime(5); - u.addBranchGraph(scene); + return c; } - public void destroy() { - u.cleanup(); + /** + * Creates new form HelloUniverse + */ + public TickTockCollision() { + // Initialize the GUI components + initComponents(); + + // Create Canvas3D and SimpleUniverse; add canvas to drawing panel + Canvas3D c = createUniverse(); + drawingPanel.add(c, java.awt.BorderLayout.CENTER); + + // Create the content branch and add it to the universe + scene = createSceneGraph(); + univ.addBranchGraph(scene); } - // - // The following allows TickTockCollision to be run as an application - // as well as an applet - // - public static void main(String[] args) { - new MainFrame(new TickTockCollision(), 700, 700); + // ---------------------------------------------------------------- + + /** This method is called from within the constructor to + * initialize the form. + * WARNING: Do NOT modify this code. The content of this method is + * always regenerated by the Form Editor. + */ + // //GEN-BEGIN:initComponents + private void initComponents() { + drawingPanel = new javax.swing.JPanel(); + + setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); + setTitle("TickTockCollision"); + drawingPanel.setLayout(new java.awt.BorderLayout()); + + drawingPanel.setPreferredSize(new java.awt.Dimension(700, 700)); + getContentPane().add(drawingPanel, java.awt.BorderLayout.CENTER); + + pack(); + }// //GEN-END:initComponents + + /** + * @param args the command line arguments + */ + public static void main(String args[]) { + java.awt.EventQueue.invokeLater(new Runnable() { + public void run() { + new TickTockCollision().setVisible(true); + } + }); } + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JPanel drawingPanel; + // End of variables declaration//GEN-END:variables + } diff --git a/src/classes/org/jdesktop/j3d/examples/configured_universe/ConfigObjLoad.java b/src/classes/org/jdesktop/j3d/examples/configured_universe/ConfigObjLoad.java index f96b2ed..fb94bfd 100644 --- a/src/classes/org/jdesktop/j3d/examples/configured_universe/ConfigObjLoad.java +++ b/src/classes/org/jdesktop/j3d/examples/configured_universe/ConfigObjLoad.java @@ -48,9 +48,7 @@ import com.sun.j3d.loaders.objectfile.ObjectFile; import com.sun.j3d.loaders.ParsingErrorException; import com.sun.j3d.loaders.IncorrectFormatException; import com.sun.j3d.loaders.Scene; -import java.awt.*; import java.awt.event.*; -import com.sun.j3d.utils.applet.MainFrame; import com.sun.j3d.utils.universe.*; import javax.media.j3d.*; import javax.vecmath.*; @@ -60,6 +58,7 @@ import com.sun.j3d.utils.behaviors.sensor.Mouse6DPointerBehavior; import java.net.URL; import java.net.MalformedURLException; import java.util.Map; +import org.jdesktop.j3d.examples.Resources; public class ConfigObjLoad { @@ -181,19 +180,17 @@ public class ConfigObjLoad { public void init() { if (filename == null) { - try { - filename = new URL("file:../geometry/galleon.obj"); + filename = Resources.getResource("resources/geometry/galleon.obj"); + if (filename == null) { + System.err.println("resources/geometry/galleon.obj not found"); + System.exit(1); } - catch (MalformedURLException e) { - System.err.println(e); - System.exit(1); - } - } + } // Get the config file URL from the j3d.configURL property or use the // default config file "j3d1x1-window" in the current directory. - URL configURL = ConfiguredUniverse.getConfigURL("file:j3d1x1-window"); - + //URL configURL = ConfiguredUniverse.getConfigURL("file:j3d1x1-window"); + URL configURL = Resources.getResource("configured_universe/j3d1x1-windows.cfg"); // Create a simple scene and attach it to the virtual universe BranchGroup scene = createSceneGraph(); u = new ConfiguredUniverse(configURL); diff --git a/src/classes/org/jdesktop/j3d/examples/configured_universe/README.txt b/src/classes/org/jdesktop/j3d/examples/configured_universe/README.txt index fd2af8e..5aa2197 100644 --- a/src/classes/org/jdesktop/j3d/examples/configured_universe/README.txt +++ b/src/classes/org/jdesktop/j3d/examples/configured_universe/README.txt @@ -72,7 +72,7 @@ It also differs in the following other respects: into their own user interfaces. The configuration file to load is specified by the j3d.configURL - property. If one is not specified, it will load the file j3d1x1-window + property. If one is not specified, it will load the file j3d1x1-window.cfg in this directory. Alternative custom view platform behaviors other than OrbitBehavior can @@ -89,44 +89,44 @@ command line: java -Dj3d.configURL= ConfigObjLoad -For example, to load j3d1x2-rot30 in the current directory, run +For example, to load j3d1x2-rot30.cfg in the current directory, run - java -Dj3d.configURL=file:j3d1x2-rot30 ConfigObjLoad + java -Dj3d.configURL=file:j3d1x2-rot30.cfg ConfigObjLoad This directory includes the following sample configuration files. Normally a configuration file is site-specific but many of these can used as-is. Others may need customization for screen sizes, available input devices, and PhysicalBody parameters. - j3d1x1: single fullscreen desktop configuration. + j3d1x1.cfg: single fullscreen desktop configuration. - j3d1x1-behavior: single fullscreen desktop configuration with a + j3d1x1-behavior.cfg: single fullscreen desktop configuration with a configurable view platform behavior. - j3d1x1-stereo: single fullscreen desktop configuration with stereo + j3d1x1-stereo.cfg: single fullscreen desktop configuration with stereo viewing. - j3d1x1-vr: single fullscreen desktop configuration with stereo viewing, + j3d1x1-vr.cfg: single fullscreen desktop configuration with stereo viewing, head tracker, and 6DOF mouse. - j3d1x1-window: single screen windowed desktop configuration. + j3d1x1-window.cfg: single screen windowed desktop configuration. - j3d1x2-flat: dual-screen flat desktop configuration. + j3d1x2-flat.cfg: dual-screen flat desktop configuration. - j3d1x2-rot30: dual-screen desktop configuration with each screen rotated + j3d1x2-rot30.cfg: dual-screen desktop configuration with each screen rotated toward the other by 30 degrees about Y. - j3d1x3-cave: 3-projector configuration with screens to the left, front, + j3d1x3-cave.cfg: 3-projector configuration with screens to the left, front, and right of the user. - j3d1x3-cave-vr: 3-projector configuration with screens to the left, + j3d1x3-cave-vr.cfg: 3-projector configuration with screens to the left, front, and right of the user. Includes head tracking and stereo viewing. - j3d1x3-rot45: 3-screen desktop configuration with left and right screens + j3d1x3-rot45.cfg: 3-screen desktop configuration with left and right screens angled by 45 degrees from the center screen. - j3d2x2-flat: 4-screen projector configuration arranged in a 2x2 power + j3d2x2-flat.cfg: 4-screen projector configuration arranged in a 2x2 power wall. Note: JDK 1.4 or newer is required when configuring multiple screens if the diff --git a/src/classes/org/jdesktop/j3d/examples/configured_universe/j3d1x1 b/src/classes/org/jdesktop/j3d/examples/configured_universe/j3d1x1 deleted file mode 100644 index 41173e3..0000000 --- a/src/classes/org/jdesktop/j3d/examples/configured_universe/j3d1x1 +++ /dev/null @@ -1,98 +0,0 @@ -/* - * $RCSfile$ - * - * Copyright (c) 2006 Sun Microsystems, Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistribution of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * - Redistribution in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * Neither the name of Sun Microsystems, Inc. or the names of - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * 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 MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL - * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF - * USING, MODIFYING OR DISTRIBUTING THIS 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 THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGES. - * - * You acknowledge that this software is not designed, licensed or - * intended for use in the design, construction, operation or - * maintenance of any nuclear facility. - * - * $Revision$ - * $Date$ - * $State$ - */ - -/* - ************************************************************************ - * - * Java 3D configuration file for a single fullscreen desktop configuration. - * - ************************************************************************ - */ - -// Create a new screen object and associate it with a logical name and a -// number. This number is used as an index to retrieve the AWT GraphicsDevice -// from the array that GraphicsEnvironment.getScreenDevices() returns. -// -// NOTE: The GraphicsDevice order in the array is specific to the local -// site and display system. -// -(NewScreen center 0) - -// Create a fullscreen window -// -(ScreenAttribute center WindowSize NoBorderFullScreen) - -// Set the available image area for the full screen. This is important when an -// explicit ScreenScale view attribute is defined for precise scaling between -// objects in the virtual world and their projections into the physical world. -// The defaults are 0.365 meters for width and 0.292 meters for height. -// -(ScreenAttribute center PhysicalScreenWidth 0.360) -(ScreenAttribute center PhysicalScreenHeight 0.288) - -// Set the TrackerBaseToImagePlate transform for this screen. The coexistence -// to tracker base transform is identity by default, so the tracker base origin -// and orientation will also set the origin and orientation of coexistence -// coordinates in the physical world. This is the primary purpose of setting -// this transform when neither head tracking nor multiple screens are being -// used. -// -// The tracker base and center of coexistence are set here to the middle of the -// screen's image plate. Their basis vectors are aligned with the image plate -// basis vectors. The physical eyepoint position will be set relative to -// coexistence coordinates below. -// -(ScreenAttribute center TrackerBaseToImagePlate - (Translate 0.180 0.144 0.000)) - -// Create a view using the defined screen. -// -(NewView view0) -(ViewAttribute view0 Screen center) - -// Set the eyepoint relative to coexistence coordinates. Here it is set 45cm -// toward the user along +Z. Skewed projections can be created by offsetting -// the eyepoint along X and/or Y. -// -(ViewAttribute view0 CenterEyeInCoexistence (0.0 0.0 0.45)) diff --git a/src/classes/org/jdesktop/j3d/examples/configured_universe/j3d1x1-behavior b/src/classes/org/jdesktop/j3d/examples/configured_universe/j3d1x1-behavior deleted file mode 100644 index d291913..0000000 --- a/src/classes/org/jdesktop/j3d/examples/configured_universe/j3d1x1-behavior +++ /dev/null @@ -1,149 +0,0 @@ -/* - * $RCSfile$ - * - * Copyright (c) 2006 Sun Microsystems, Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistribution of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * - Redistribution in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * Neither the name of Sun Microsystems, Inc. or the names of - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * 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 MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL - * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF - * USING, MODIFYING OR DISTRIBUTING THIS 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 THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGES. - * - * You acknowledge that this software is not designed, licensed or - * intended for use in the design, construction, operation or - * maintenance of any nuclear facility. - * - * $Revision$ - * $Date$ - * $State$ - */ - -/* - ************************************************************************ - * - * Java 3D configuration file for single fullscreen desktop configuration. - * A view platform behavior is created and configured here as well. - * - ************************************************************************ - */ - -// Create a new screen object and associate it with a logical name and a -// number. This number is used as an index to retrieve the AWT GraphicsDevice -// from the array that GraphicsEnvironment.getScreenDevices() returns. -// -// NOTE: The GraphicsDevice order in the array is specific to the local -// site and display system. -// -(NewScreen center 0) - -// Create a fullscreen window -// -(ScreenAttribute center WindowSize NoBorderFullScreen) - -// Set the available image area for the full screen. -// -(ScreenAttribute center PhysicalScreenWidth 0.360) -(ScreenAttribute center PhysicalScreenHeight 0.288) - -// Set the TrackerBaseToImagePlate transform for this screen. The coexistence -// to tracker base transform is identity by default, so the tracker base origin -// and orientation will also set the origin and orientation of coexistence -// coordinates in the physical world. This is the primary purpose of setting -// this transform when neither head tracking nor multiple screens are being -// used. -// -// The tracker base and center of coexistence are set here to the middle of the -// screen's image plate. Their basis vectors are aligned with the image plate -// basis vectors. The physical eyepoint position will be set relative to -// coexistence coordinates below. -// -(ScreenAttribute center TrackerBaseToImagePlate - (Translate 0.180 0.144 0.000)) - -// Create a view using the defined screen. -// -(NewView view0) -(ViewAttribute view0 Screen center) - -// Set the eyepoint relative to coexistence coordinates. Here it is set 45cm -// toward the user along +Z. Skewed projections can be set by by offsetting -// the eyepoint along X and Y. -// -(ViewAttribute view0 CenterEyeInCoexistence (0.0 0.0 0.45)) - -// Create a view platform behavior. Here we use OrbitBehavior, although any -// concrete subclass of the abstract ViewPlatformBehavior with a parameterless -// constructor could be used. The logical name to assign to this behavior is -// specified by the 2nd argument to the NewViewPlatformBehavior command, while -// the 3rd argument is the name of the ViewPlatformBehavior subclass. It is -// instantiated through introspection. -// -// Attributes defined by the abstract ViewPlatformBehavior superclass itself -// can be set directly with the ViewPlatformBehaviorAttribute command. The -// details of the subclass implementation are not known to ConfiguredUniverse, -// so any configuration information needed by such a subclass is set by the -// ViewPlatformBehaviorProperty command. The property name specified by that -// command is taken to be a method name of the subclass and invoked through -// introspection. -// -// View platform behaviors often need sensors or canvases as event sources to -// drive the behavior action. An implementation of ViewPlatformBehavior always -// gets the current ViewingPlatform through the setViewingPlatform() method. -// The canvases used by the ViewingPlatform can be retrieved by calling its -// getViewers() method and then calling each Viewer's getCanvas3Ds() -// method. Sensors can be retrived by calling the ViewingPlatform method -// getUniverse(), checking to see if the returned SimpleUniverse is a -// ConfiguredUniverse, and then calling its getNamedSensors() method. -// -(NewViewPlatformBehavior vpb com.sun.j3d.utils.behaviors.vp.OrbitBehavior) - -// Set the scheduling bounds to be a BoundingSphere with its center at -// (0.0 0.0 0.0) and a radius of 100 meters. -// -(ViewPlatformBehaviorAttribute vpb SchedulingBounds - (BoundingSphere (0.0 0.0 0.0) 100.0)) - -// Set properties specific to OrbitBehavior. All arguments following the -// method name are wrapped and passed to the specified method as an array of -// Objects. Strings "true" and "false" get turned into Boolean, and number -// strings get turned into Double. Constructs such as (0.0 1.0 2.0) and -// ((0.0 1.0 2.0 0.5) (3.0 4.0 5.0 1.0) (6.0 7.0 8.0 0.0)) get converted to -// Point3d and Matrix4d respectively. Note that last row of a Matrix4d doesn't -// need to be specified; it is implicitly (0.0 0.0 0.0 1.0). -// -// The REVERSE_ALL flags are usually passed to the OrbitBehavior constructor. -// Since it is being instantiated with its parameterless constructor the -// reverse flags are set here explicitly. -// -(ViewPlatformBehaviorProperty vpb ReverseTranslate true) -(ViewPlatformBehaviorProperty vpb ReverseRotate true) -(ViewPlatformBehaviorProperty vpb ReverseZoom true) - -// Create a new view platform and set the view platform behavior. -// -(NewViewPlatform vp) -(ViewPlatformAttribute vp ViewPlatformBehavior vpb) diff --git a/src/classes/org/jdesktop/j3d/examples/configured_universe/j3d1x1-behavior.cfg b/src/classes/org/jdesktop/j3d/examples/configured_universe/j3d1x1-behavior.cfg new file mode 100644 index 0000000..d291913 --- /dev/null +++ b/src/classes/org/jdesktop/j3d/examples/configured_universe/j3d1x1-behavior.cfg @@ -0,0 +1,149 @@ +/* + * $RCSfile$ + * + * Copyright (c) 2006 Sun Microsystems, Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistribution of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistribution in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of Sun Microsystems, Inc. or the names of + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 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 MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL + * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF + * USING, MODIFYING OR DISTRIBUTING THIS 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 THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGES. + * + * You acknowledge that this software is not designed, licensed or + * intended for use in the design, construction, operation or + * maintenance of any nuclear facility. + * + * $Revision$ + * $Date$ + * $State$ + */ + +/* + ************************************************************************ + * + * Java 3D configuration file for single fullscreen desktop configuration. + * A view platform behavior is created and configured here as well. + * + ************************************************************************ + */ + +// Create a new screen object and associate it with a logical name and a +// number. This number is used as an index to retrieve the AWT GraphicsDevice +// from the array that GraphicsEnvironment.getScreenDevices() returns. +// +// NOTE: The GraphicsDevice order in the array is specific to the local +// site and display system. +// +(NewScreen center 0) + +// Create a fullscreen window +// +(ScreenAttribute center WindowSize NoBorderFullScreen) + +// Set the available image area for the full screen. +// +(ScreenAttribute center PhysicalScreenWidth 0.360) +(ScreenAttribute center PhysicalScreenHeight 0.288) + +// Set the TrackerBaseToImagePlate transform for this screen. The coexistence +// to tracker base transform is identity by default, so the tracker base origin +// and orientation will also set the origin and orientation of coexistence +// coordinates in the physical world. This is the primary purpose of setting +// this transform when neither head tracking nor multiple screens are being +// used. +// +// The tracker base and center of coexistence are set here to the middle of the +// screen's image plate. Their basis vectors are aligned with the image plate +// basis vectors. The physical eyepoint position will be set relative to +// coexistence coordinates below. +// +(ScreenAttribute center TrackerBaseToImagePlate + (Translate 0.180 0.144 0.000)) + +// Create a view using the defined screen. +// +(NewView view0) +(ViewAttribute view0 Screen center) + +// Set the eyepoint relative to coexistence coordinates. Here it is set 45cm +// toward the user along +Z. Skewed projections can be set by by offsetting +// the eyepoint along X and Y. +// +(ViewAttribute view0 CenterEyeInCoexistence (0.0 0.0 0.45)) + +// Create a view platform behavior. Here we use OrbitBehavior, although any +// concrete subclass of the abstract ViewPlatformBehavior with a parameterless +// constructor could be used. The logical name to assign to this behavior is +// specified by the 2nd argument to the NewViewPlatformBehavior command, while +// the 3rd argument is the name of the ViewPlatformBehavior subclass. It is +// instantiated through introspection. +// +// Attributes defined by the abstract ViewPlatformBehavior superclass itself +// can be set directly with the ViewPlatformBehaviorAttribute command. The +// details of the subclass implementation are not known to ConfiguredUniverse, +// so any configuration information needed by such a subclass is set by the +// ViewPlatformBehaviorProperty command. The property name specified by that +// command is taken to be a method name of the subclass and invoked through +// introspection. +// +// View platform behaviors often need sensors or canvases as event sources to +// drive the behavior action. An implementation of ViewPlatformBehavior always +// gets the current ViewingPlatform through the setViewingPlatform() method. +// The canvases used by the ViewingPlatform can be retrieved by calling its +// getViewers() method and then calling each Viewer's getCanvas3Ds() +// method. Sensors can be retrived by calling the ViewingPlatform method +// getUniverse(), checking to see if the returned SimpleUniverse is a +// ConfiguredUniverse, and then calling its getNamedSensors() method. +// +(NewViewPlatformBehavior vpb com.sun.j3d.utils.behaviors.vp.OrbitBehavior) + +// Set the scheduling bounds to be a BoundingSphere with its center at +// (0.0 0.0 0.0) and a radius of 100 meters. +// +(ViewPlatformBehaviorAttribute vpb SchedulingBounds + (BoundingSphere (0.0 0.0 0.0) 100.0)) + +// Set properties specific to OrbitBehavior. All arguments following the +// method name are wrapped and passed to the specified method as an array of +// Objects. Strings "true" and "false" get turned into Boolean, and number +// strings get turned into Double. Constructs such as (0.0 1.0 2.0) and +// ((0.0 1.0 2.0 0.5) (3.0 4.0 5.0 1.0) (6.0 7.0 8.0 0.0)) get converted to +// Point3d and Matrix4d respectively. Note that last row of a Matrix4d doesn't +// need to be specified; it is implicitly (0.0 0.0 0.0 1.0). +// +// The REVERSE_ALL flags are usually passed to the OrbitBehavior constructor. +// Since it is being instantiated with its parameterless constructor the +// reverse flags are set here explicitly. +// +(ViewPlatformBehaviorProperty vpb ReverseTranslate true) +(ViewPlatformBehaviorProperty vpb ReverseRotate true) +(ViewPlatformBehaviorProperty vpb ReverseZoom true) + +// Create a new view platform and set the view platform behavior. +// +(NewViewPlatform vp) +(ViewPlatformAttribute vp ViewPlatformBehavior vpb) diff --git a/src/classes/org/jdesktop/j3d/examples/configured_universe/j3d1x1-stereo b/src/classes/org/jdesktop/j3d/examples/configured_universe/j3d1x1-stereo deleted file mode 100644 index 3db4070..0000000 --- a/src/classes/org/jdesktop/j3d/examples/configured_universe/j3d1x1-stereo +++ /dev/null @@ -1,113 +0,0 @@ -/* - * $RCSfile$ - * - * Copyright (c) 2006 Sun Microsystems, Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistribution of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * - Redistribution in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * Neither the name of Sun Microsystems, Inc. or the names of - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * 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 MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL - * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF - * USING, MODIFYING OR DISTRIBUTING THIS 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 THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGES. - * - * You acknowledge that this software is not designed, licensed or - * intended for use in the design, construction, operation or - * maintenance of any nuclear facility. - * - * $Revision$ - * $Date$ - * $State$ - */ - -/* - ************************************************************************ - * - * Java 3D configuration file for single fullscreen stereo desktop - * configuration with no head tracking. - * - ************************************************************************ - */ - -// Create a new screen object and associate it with a logical name and a -// number. This number is used as an index to retrieve the AWT GraphicsDevice -// from the array that GraphicsEnvironment.getScreenDevices() returns. -// -// NOTE: The GraphicsDevice order in the array is specific to the local -// site and display system. -// -(NewScreen center 0) - -// Create a fullscreen window -// -(ScreenAttribute center WindowSize NoBorderFullScreen) - -// Set the available image area for the full screen. -// -(ScreenAttribute center PhysicalScreenWidth 0.360) -(ScreenAttribute center PhysicalScreenHeight 0.288) - -// Set the TrackerBaseToImagePlate transform for this screen. The coexistence -// to tracker base transform is identity by default, so the tracker base origin -// and orientation will also set the origin and orientation of coexistence -// coordinates in the physical world. This is the primary purpose of setting -// this transform when neither head tracking nor multiple screens are being -// used. -// -// The tracker base and center of coexistence are set here to the middle of the -// screen's image plate. Their basis vectors are aligned with the image plate -// basis vectors. The physical eyepoint position will be set relative to -// coexistence coordinates below. -// -(ScreenAttribute center TrackerBaseToImagePlate - (Translate 0.180 0.144 0.000)) - -// Define the physical body. -// -// The head origin is halfway between the eyes, with X extending to the right, -// Y up, and positive Z extending into the skull. -// -(NewPhysicalBody SiteUser) - -// Set the interpupilary distance. This sets the LeftEyePosition and -// RightEyePosition to offsets of half this distance along both directions of -// the X axis. -// -(PhysicalBodyAttribute SiteUser StereoEyeSeparation 0.066) - -// Create a view using the defined screen and physical body. -// -(NewView view0) -(ViewAttribute view0 Screen center) -(ViewAttribute view0 PhysicalBody SiteUser) - -// Set the eyepoint relative to coexistence coordinates. Here it is set 45cm -// toward the user along +Z. -// -(ViewAttribute view0 CenterEyeInCoexistence (0.0 0.0 0.45)) - -// Enable stereo viewing. -// -(ViewAttribute view0 StereoEnable true) diff --git a/src/classes/org/jdesktop/j3d/examples/configured_universe/j3d1x1-stereo.cfg b/src/classes/org/jdesktop/j3d/examples/configured_universe/j3d1x1-stereo.cfg new file mode 100644 index 0000000..3db4070 --- /dev/null +++ b/src/classes/org/jdesktop/j3d/examples/configured_universe/j3d1x1-stereo.cfg @@ -0,0 +1,113 @@ +/* + * $RCSfile$ + * + * Copyright (c) 2006 Sun Microsystems, Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistribution of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistribution in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of Sun Microsystems, Inc. or the names of + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 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 MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL + * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF + * USING, MODIFYING OR DISTRIBUTING THIS 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 THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGES. + * + * You acknowledge that this software is not designed, licensed or + * intended for use in the design, construction, operation or + * maintenance of any nuclear facility. + * + * $Revision$ + * $Date$ + * $State$ + */ + +/* + ************************************************************************ + * + * Java 3D configuration file for single fullscreen stereo desktop + * configuration with no head tracking. + * + ************************************************************************ + */ + +// Create a new screen object and associate it with a logical name and a +// number. This number is used as an index to retrieve the AWT GraphicsDevice +// from the array that GraphicsEnvironment.getScreenDevices() returns. +// +// NOTE: The GraphicsDevice order in the array is specific to the local +// site and display system. +// +(NewScreen center 0) + +// Create a fullscreen window +// +(ScreenAttribute center WindowSize NoBorderFullScreen) + +// Set the available image area for the full screen. +// +(ScreenAttribute center PhysicalScreenWidth 0.360) +(ScreenAttribute center PhysicalScreenHeight 0.288) + +// Set the TrackerBaseToImagePlate transform for this screen. The coexistence +// to tracker base transform is identity by default, so the tracker base origin +// and orientation will also set the origin and orientation of coexistence +// coordinates in the physical world. This is the primary purpose of setting +// this transform when neither head tracking nor multiple screens are being +// used. +// +// The tracker base and center of coexistence are set here to the middle of the +// screen's image plate. Their basis vectors are aligned with the image plate +// basis vectors. The physical eyepoint position will be set relative to +// coexistence coordinates below. +// +(ScreenAttribute center TrackerBaseToImagePlate + (Translate 0.180 0.144 0.000)) + +// Define the physical body. +// +// The head origin is halfway between the eyes, with X extending to the right, +// Y up, and positive Z extending into the skull. +// +(NewPhysicalBody SiteUser) + +// Set the interpupilary distance. This sets the LeftEyePosition and +// RightEyePosition to offsets of half this distance along both directions of +// the X axis. +// +(PhysicalBodyAttribute SiteUser StereoEyeSeparation 0.066) + +// Create a view using the defined screen and physical body. +// +(NewView view0) +(ViewAttribute view0 Screen center) +(ViewAttribute view0 PhysicalBody SiteUser) + +// Set the eyepoint relative to coexistence coordinates. Here it is set 45cm +// toward the user along +Z. +// +(ViewAttribute view0 CenterEyeInCoexistence (0.0 0.0 0.45)) + +// Enable stereo viewing. +// +(ViewAttribute view0 StereoEnable true) diff --git a/src/classes/org/jdesktop/j3d/examples/configured_universe/j3d1x1-vr b/src/classes/org/jdesktop/j3d/examples/configured_universe/j3d1x1-vr deleted file mode 100644 index 587f481..0000000 --- a/src/classes/org/jdesktop/j3d/examples/configured_universe/j3d1x1-vr +++ /dev/null @@ -1,212 +0,0 @@ -/* - * $RCSfile$ - * - * Copyright (c) 2006 Sun Microsystems, Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistribution of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * - Redistribution in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * Neither the name of Sun Microsystems, Inc. or the names of - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * 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 MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL - * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF - * USING, MODIFYING OR DISTRIBUTING THIS 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 THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGES. - * - * You acknowledge that this software is not designed, licensed or - * intended for use in the design, construction, operation or - * maintenance of any nuclear facility. - * - * $Revision$ - * $Date$ - * $State$ - */ - -/* - ************************************************************************ - * - * Java 3D configuration file for a single screen stereo desktop display - * using a head tracker and 6DOF mouse. - * - ************************************************************************ - */ - -// Configure the head tracker. The NewDevice command binds a logical name -// (the 2nd argument) to an InputDevice implementation whose class name is -// specified in the 3rd argument. The InputDevice implementation for a head -// tracker must generate position and orientation data relative to a fixed -// frame of reference in the physical world, the "tracker base" of the Java -// 3D view model. -// -// The InputDevice is instantiated through introspection of the class name. -// Available InputDevice implementations are site-specific, so substitute -// the class name in a NewDevice command below with one that is available at -// the local site. -// -// Note that properties are used to configure an InputDevice instead of -// attributes. The details of an InputDevice implementation are not known to -// ConfiguredUniverse, so the property name is invoked as a method through -// introspection. The example properties below must be replaced with the ones -// needed, if any, by specific InputDevice implementations. -// -// All property arguments following the method name are wrapped and passed to -// the specified method as an array of Objects. Strings "true" and "false" -// get wrapped into Boolean, and number strings get wrapped into Double. -// Construct such as (0.0 1.0 2.0) and ((0.0 1.0 2.0 0.5) (3.0 4.0 5.0 1.0) -// (6.0 7.0 8.0 0.0)) get converted to Point3d and Matrix4d respectively. -// Note that last row of a Matrix4d doesn't need to be specified; it is -// implicitly (0.0 0.0 0.0 1.0). -// -(NewDevice glasses LogitechRedBarron) -(DeviceProperty glasses SerialPort "/dev/ttya") // Unix paths need quoting. -(DeviceProperty glasses ReceiverBaseline 0.1450) -(DeviceProperty glasses ReceiverLeftLeg 0.0875) -(DeviceProperty glasses ReceiverHeight 0.0470) -(DeviceProperty glasses ReceiverTopOffset 0.0000) - -// Configure an InputDevice to use for a 6 degree of freedom mouse if -// required. In some implementations the same InputDevice instance can be -// used both for head tracking and multiple peripheral sensing devices. -// This example assumes an implementation that requires multiple instances, -// one for each sensor, sharing the same physical hardware used for the -// tracker base. In either case all the sensors must generate position and -// orientation relative to the same fixed tracker base frame of reference. -// -(NewDevice wand LogitechRedBarron) -(DeviceProperty wand SerialPort "/dev/ttyb") -(DeviceProperty wand ReceiverBaseline 0.0700) -(DeviceProperty wand ReceiverLeftLeg 0.0625) -(DeviceProperty wand ReceiverHeight 0.0510) -(DeviceProperty wand ReceiverTopOffset 0.0000) - -// Create logical names for the available sensors in the specified input -// devices. The last argument is the sensor's index in the input device. -// -(NewSensor head glasses 0) -(NewSensor mouse6d wand 0) - -// Set the 6DOF mouse sensor hotspot in the local sensor coordinate system. -// The hotspot is simply the "active" point relative to the sensor origin -// which interacts with the virtual world, such as the point used for picking -// or grabbing an object. Its interpretation is up to the sensor behavior. -// -// It is set here to 10 centimeters from the base to allow reaching into the -// screen without bumping the device into the glass, and to prevent the device -// itself from obscuring the pointer echo. -// -(SensorAttribute mouse6d Hotspot (0.0 0.0 -0.10)) - - -// Create a new screen object and associate it with a logical name and a -// number. This number is used as an index to retrieve the AWT GraphicsDevice -// from the array that GraphicsEnvironment.getScreenDevices() returns. -// -// NOTE: The GraphicsDevice order in the array is specific to the local -// site and display system. -// -(NewScreen center 0) - -// Set the actual available image area. This measured as 0.350 meters in -// width and 0.245 meters in height for the monitor in the sample setup when -// running in stereo resolution. -// -(ScreenAttribute center PhysicalScreenWidth 0.350) -(ScreenAttribute center PhysicalScreenHeight 0.245) -(ScreenAttribute center WindowSize NoBorderFullScreen) - -// Set the TrackerBaseToImagePlate transform for this screen. This transforms -// points in tracker base coordinates to image plate coordinates. -// -// For this sample setup the tracker base is leaning at 50 degrees about its -// X-axis over the top edge of the monitor. The middle of the tracker base -// (its origin) is offset by (0.175, 0.345, 0.020) from the lower left -// corner of the screen (origin of the image plate). -// -(ScreenAttribute center TrackerBaseToImagePlate - (RotateTranslate (Rotate 50.000 0.000 0.000) - (Translate 0.175 0.345 0.020))) - - -// Create a physical environment. This contains the available input devices, -// audio devices, and sensors, and defines the coexistence coordinate system. -// -(NewPhysicalEnvironment SampleSite) - -// Register the input devices defined in this file. -// -(PhysicalEnvironmentAttribute SampleSite InputDevice glasses) -(PhysicalEnvironmentAttribute SampleSite InputDevice wand) - -// Register the sensor which will drive head tracking. -// -(PhysicalEnvironmentAttribute SampleSite HeadTracker head) - -// Define coexistence coordinates. -// -// Coexistence coordinates are defined relative to the tracker base to simplify -// calibration measurements, just as the tracker base is used as the common -// reference frame for the TrackerBaseToImagePlate calibration. -// -// Here the coexistence origin is set to the middle of the center screen, using -// the same basis vectors as its image plate. This will put the tracker base -// origin at (0.0 0.220 0.020) relative to the coexistence origin along its -// basis vectors. -// -(PhysicalEnvironmentAttribute SampleSite CoexistenceToTrackerBase - (TranslateRotate (Translate 0.0 -0.220 -0.020) - (Rotate -50.0 0.0 0.0))) - -// Define the physical body. -// -// The head origin is halfway between the eyes, with X extending to the right, -// Y up, and positive Z extending into the skull. -// -(NewPhysicalBody SiteUser) - -// Set the interpupilary distance. This sets the LeftEyePosition and -// RightEyePosition to offsets of half this distance along both directions of -// the X axis. -// -(PhysicalBodyAttribute SiteUser StereoEyeSeparation 0.066) - -// Define the position and orientation of the head relative to the tracker -// mounted on the head. -// -(PhysicalBodyAttribute SiteUser HeadToHeadTracker ((1.0 0.0 0.0 0.000) - (0.0 1.0 0.0 0.020) - (0.0 0.0 1.0 0.018))) - - -// Create a view using the defined screens, PhysicalEnvironment, and -// PhysicalBody. -// -(NewView view0) -(ViewAttribute view0 Screen center) -(ViewAttribute view0 PhysicalEnvironment SampleSite) -(ViewAttribute view0 PhysicalBody SiteUser) - -// Enable stereo viewing. Enable head tracking to get the position of the eyes -// with respect to coexistence. -// -(ViewAttribute view0 StereoEnable true) -(ViewAttribute view0 TrackingEnable True) diff --git a/src/classes/org/jdesktop/j3d/examples/configured_universe/j3d1x1-vr.cfg b/src/classes/org/jdesktop/j3d/examples/configured_universe/j3d1x1-vr.cfg new file mode 100644 index 0000000..587f481 --- /dev/null +++ b/src/classes/org/jdesktop/j3d/examples/configured_universe/j3d1x1-vr.cfg @@ -0,0 +1,212 @@ +/* + * $RCSfile$ + * + * Copyright (c) 2006 Sun Microsystems, Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistribution of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistribution in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of Sun Microsystems, Inc. or the names of + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 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 MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL + * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF + * USING, MODIFYING OR DISTRIBUTING THIS 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 THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGES. + * + * You acknowledge that this software is not designed, licensed or + * intended for use in the design, construction, operation or + * maintenance of any nuclear facility. + * + * $Revision$ + * $Date$ + * $State$ + */ + +/* + ************************************************************************ + * + * Java 3D configuration file for a single screen stereo desktop display + * using a head tracker and 6DOF mouse. + * + ************************************************************************ + */ + +// Configure the head tracker. The NewDevice command binds a logical name +// (the 2nd argument) to an InputDevice implementation whose class name is +// specified in the 3rd argument. The InputDevice implementation for a head +// tracker must generate position and orientation data relative to a fixed +// frame of reference in the physical world, the "tracker base" of the Java +// 3D view model. +// +// The InputDevice is instantiated through introspection of the class name. +// Available InputDevice implementations are site-specific, so substitute +// the class name in a NewDevice command below with one that is available at +// the local site. +// +// Note that properties are used to configure an InputDevice instead of +// attributes. The details of an InputDevice implementation are not known to +// ConfiguredUniverse, so the property name is invoked as a method through +// introspection. The example properties below must be replaced with the ones +// needed, if any, by specific InputDevice implementations. +// +// All property arguments following the method name are wrapped and passed to +// the specified method as an array of Objects. Strings "true" and "false" +// get wrapped into Boolean, and number strings get wrapped into Double. +// Construct such as (0.0 1.0 2.0) and ((0.0 1.0 2.0 0.5) (3.0 4.0 5.0 1.0) +// (6.0 7.0 8.0 0.0)) get converted to Point3d and Matrix4d respectively. +// Note that last row of a Matrix4d doesn't need to be specified; it is +// implicitly (0.0 0.0 0.0 1.0). +// +(NewDevice glasses LogitechRedBarron) +(DeviceProperty glasses SerialPort "/dev/ttya") // Unix paths need quoting. +(DeviceProperty glasses ReceiverBaseline 0.1450) +(DeviceProperty glasses ReceiverLeftLeg 0.0875) +(DeviceProperty glasses ReceiverHeight 0.0470) +(DeviceProperty glasses ReceiverTopOffset 0.0000) + +// Configure an InputDevice to use for a 6 degree of freedom mouse if +// required. In some implementations the same InputDevice instance can be +// used both for head tracking and multiple peripheral sensing devices. +// This example assumes an implementation that requires multiple instances, +// one for each sensor, sharing the same physical hardware used for the +// tracker base. In either case all the sensors must generate position and +// orientation relative to the same fixed tracker base frame of reference. +// +(NewDevice wand LogitechRedBarron) +(DeviceProperty wand SerialPort "/dev/ttyb") +(DeviceProperty wand ReceiverBaseline 0.0700) +(DeviceProperty wand ReceiverLeftLeg 0.0625) +(DeviceProperty wand ReceiverHeight 0.0510) +(DeviceProperty wand ReceiverTopOffset 0.0000) + +// Create logical names for the available sensors in the specified input +// devices. The last argument is the sensor's index in the input device. +// +(NewSensor head glasses 0) +(NewSensor mouse6d wand 0) + +// Set the 6DOF mouse sensor hotspot in the local sensor coordinate system. +// The hotspot is simply the "active" point relative to the sensor origin +// which interacts with the virtual world, such as the point used for picking +// or grabbing an object. Its interpretation is up to the sensor behavior. +// +// It is set here to 10 centimeters from the base to allow reaching into the +// screen without bumping the device into the glass, and to prevent the device +// itself from obscuring the pointer echo. +// +(SensorAttribute mouse6d Hotspot (0.0 0.0 -0.10)) + + +// Create a new screen object and associate it with a logical name and a +// number. This number is used as an index to retrieve the AWT GraphicsDevice +// from the array that GraphicsEnvironment.getScreenDevices() returns. +// +// NOTE: The GraphicsDevice order in the array is specific to the local +// site and display system. +// +(NewScreen center 0) + +// Set the actual available image area. This measured as 0.350 meters in +// width and 0.245 meters in height for the monitor in the sample setup when +// running in stereo resolution. +// +(ScreenAttribute center PhysicalScreenWidth 0.350) +(ScreenAttribute center PhysicalScreenHeight 0.245) +(ScreenAttribute center WindowSize NoBorderFullScreen) + +// Set the TrackerBaseToImagePlate transform for this screen. This transforms +// points in tracker base coordinates to image plate coordinates. +// +// For this sample setup the tracker base is leaning at 50 degrees about its +// X-axis over the top edge of the monitor. The middle of the tracker base +// (its origin) is offset by (0.175, 0.345, 0.020) from the lower left +// corner of the screen (origin of the image plate). +// +(ScreenAttribute center TrackerBaseToImagePlate + (RotateTranslate (Rotate 50.000 0.000 0.000) + (Translate 0.175 0.345 0.020))) + + +// Create a physical environment. This contains the available input devices, +// audio devices, and sensors, and defines the coexistence coordinate system. +// +(NewPhysicalEnvironment SampleSite) + +// Register the input devices defined in this file. +// +(PhysicalEnvironmentAttribute SampleSite InputDevice glasses) +(PhysicalEnvironmentAttribute SampleSite InputDevice wand) + +// Register the sensor which will drive head tracking. +// +(PhysicalEnvironmentAttribute SampleSite HeadTracker head) + +// Define coexistence coordinates. +// +// Coexistence coordinates are defined relative to the tracker base to simplify +// calibration measurements, just as the tracker base is used as the common +// reference frame for the TrackerBaseToImagePlate calibration. +// +// Here the coexistence origin is set to the middle of the center screen, using +// the same basis vectors as its image plate. This will put the tracker base +// origin at (0.0 0.220 0.020) relative to the coexistence origin along its +// basis vectors. +// +(PhysicalEnvironmentAttribute SampleSite CoexistenceToTrackerBase + (TranslateRotate (Translate 0.0 -0.220 -0.020) + (Rotate -50.0 0.0 0.0))) + +// Define the physical body. +// +// The head origin is halfway between the eyes, with X extending to the right, +// Y up, and positive Z extending into the skull. +// +(NewPhysicalBody SiteUser) + +// Set the interpupilary distance. This sets the LeftEyePosition and +// RightEyePosition to offsets of half this distance along both directions of +// the X axis. +// +(PhysicalBodyAttribute SiteUser StereoEyeSeparation 0.066) + +// Define the position and orientation of the head relative to the tracker +// mounted on the head. +// +(PhysicalBodyAttribute SiteUser HeadToHeadTracker ((1.0 0.0 0.0 0.000) + (0.0 1.0 0.0 0.020) + (0.0 0.0 1.0 0.018))) + + +// Create a view using the defined screens, PhysicalEnvironment, and +// PhysicalBody. +// +(NewView view0) +(ViewAttribute view0 Screen center) +(ViewAttribute view0 PhysicalEnvironment SampleSite) +(ViewAttribute view0 PhysicalBody SiteUser) + +// Enable stereo viewing. Enable head tracking to get the position of the eyes +// with respect to coexistence. +// +(ViewAttribute view0 StereoEnable true) +(ViewAttribute view0 TrackingEnable True) diff --git a/src/classes/org/jdesktop/j3d/examples/configured_universe/j3d1x1-window b/src/classes/org/jdesktop/j3d/examples/configured_universe/j3d1x1-window deleted file mode 100644 index eec0e31..0000000 --- a/src/classes/org/jdesktop/j3d/examples/configured_universe/j3d1x1-window +++ /dev/null @@ -1,89 +0,0 @@ -/* - * $RCSfile$ - * - * Copyright (c) 2006 Sun Microsystems, Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistribution of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * - Redistribution in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * Neither the name of Sun Microsystems, Inc. or the names of - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * 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 MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL - * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF - * USING, MODIFYING OR DISTRIBUTING THIS 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 THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGES. - * - * You acknowledge that this software is not designed, licensed or - * intended for use in the design, construction, operation or - * maintenance of any nuclear facility. - * - * $Revision$ - * $Date$ - * $State$ - */ - -/* - ************************************************************************ - * - * Java 3D configuration file for a conventional single screen, windowed - * desktop configuration. - * - ************************************************************************ - */ - -// Create a new screen object and associate it with a logical name and a -// number. This number is used as an index to retrieve the AWT GraphicsDevice -// from the array that GraphicsEnvironment.getScreenDevices() returns. -// -// NOTE: The GraphicsDevice order in the array is specific to the local -// site and display system. -// -(NewScreen center 0) - -// Create a 700x700 pixel window on the screen. -// -(ScreenAttribute center WindowSize (700.0 700.0)) - -// Create a view using the defined screen. -// -(NewView view0) -(ViewAttribute view0 Screen center) - -// ConfiguredUniverse is oriented toward multi-screen viewing environments, so -// it sets the following attributes to those listed. For a conventional window -// on a single screen desktop configuration we need to set them back to their -// normal defaults. -// -// View.windowEyePointPolicy RELATIVE_TO_COEXISTENCE -// View.windowMovementPolicy VIRTUAL_WORLD -// View.windowResizePolicy VIRTUAL_WORLD -// View.coexistenceCenteringEnable false -// ViewPlatform.viewAttachPolicy NOMINAL_SCREEN -// -(ViewAttribute view0 WindowEyepointPolicy RELATIVE_TO_FIELD_OF_VIEW) -(ViewAttribute view0 WindowMovementPolicy PHYSICAL_WORLD) -(ViewAttribute view0 WindowResizePolicy PHYSICAL_WORLD) -(ViewAttribute view0 CoexistenceCenteringEnable true) - -(NewViewPlatform vp) -(ViewPlatformAttribute vp ViewAttachPolicy NOMINAL_HEAD) diff --git a/src/classes/org/jdesktop/j3d/examples/configured_universe/j3d1x1-window.cfg b/src/classes/org/jdesktop/j3d/examples/configured_universe/j3d1x1-window.cfg new file mode 100644 index 0000000..eec0e31 --- /dev/null +++ b/src/classes/org/jdesktop/j3d/examples/configured_universe/j3d1x1-window.cfg @@ -0,0 +1,89 @@ +/* + * $RCSfile$ + * + * Copyright (c) 2006 Sun Microsystems, Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistribution of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistribution in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of Sun Microsystems, Inc. or the names of + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 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 MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL + * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF + * USING, MODIFYING OR DISTRIBUTING THIS 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 THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGES. + * + * You acknowledge that this software is not designed, licensed or + * intended for use in the design, construction, operation or + * maintenance of any nuclear facility. + * + * $Revision$ + * $Date$ + * $State$ + */ + +/* + ************************************************************************ + * + * Java 3D configuration file for a conventional single screen, windowed + * desktop configuration. + * + ************************************************************************ + */ + +// Create a new screen object and associate it with a logical name and a +// number. This number is used as an index to retrieve the AWT GraphicsDevice +// from the array that GraphicsEnvironment.getScreenDevices() returns. +// +// NOTE: The GraphicsDevice order in the array is specific to the local +// site and display system. +// +(NewScreen center 0) + +// Create a 700x700 pixel window on the screen. +// +(ScreenAttribute center WindowSize (700.0 700.0)) + +// Create a view using the defined screen. +// +(NewView view0) +(ViewAttribute view0 Screen center) + +// ConfiguredUniverse is oriented toward multi-screen viewing environments, so +// it sets the following attributes to those listed. For a conventional window +// on a single screen desktop configuration we need to set them back to their +// normal defaults. +// +// View.windowEyePointPolicy RELATIVE_TO_COEXISTENCE +// View.windowMovementPolicy VIRTUAL_WORLD +// View.windowResizePolicy VIRTUAL_WORLD +// View.coexistenceCenteringEnable false +// ViewPlatform.viewAttachPolicy NOMINAL_SCREEN +// +(ViewAttribute view0 WindowEyepointPolicy RELATIVE_TO_FIELD_OF_VIEW) +(ViewAttribute view0 WindowMovementPolicy PHYSICAL_WORLD) +(ViewAttribute view0 WindowResizePolicy PHYSICAL_WORLD) +(ViewAttribute view0 CoexistenceCenteringEnable true) + +(NewViewPlatform vp) +(ViewPlatformAttribute vp ViewAttachPolicy NOMINAL_HEAD) diff --git a/src/classes/org/jdesktop/j3d/examples/configured_universe/j3d1x1.cfg b/src/classes/org/jdesktop/j3d/examples/configured_universe/j3d1x1.cfg new file mode 100644 index 0000000..41173e3 --- /dev/null +++ b/src/classes/org/jdesktop/j3d/examples/configured_universe/j3d1x1.cfg @@ -0,0 +1,98 @@ +/* + * $RCSfile$ + * + * Copyright (c) 2006 Sun Microsystems, Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistribution of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistribution in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of Sun Microsystems, Inc. or the names of + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 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 MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL + * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF + * USING, MODIFYING OR DISTRIBUTING THIS 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 THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGES. + * + * You acknowledge that this software is not designed, licensed or + * intended for use in the design, construction, operation or + * maintenance of any nuclear facility. + * + * $Revision$ + * $Date$ + * $State$ + */ + +/* + ************************************************************************ + * + * Java 3D configuration file for a single fullscreen desktop configuration. + * + ************************************************************************ + */ + +// Create a new screen object and associate it with a logical name and a +// number. This number is used as an index to retrieve the AWT GraphicsDevice +// from the array that GraphicsEnvironment.getScreenDevices() returns. +// +// NOTE: The GraphicsDevice order in the array is specific to the local +// site and display system. +// +(NewScreen center 0) + +// Create a fullscreen window +// +(ScreenAttribute center WindowSize NoBorderFullScreen) + +// Set the available image area for the full screen. This is important when an +// explicit ScreenScale view attribute is defined for precise scaling between +// objects in the virtual world and their projections into the physical world. +// The defaults are 0.365 meters for width and 0.292 meters for height. +// +(ScreenAttribute center PhysicalScreenWidth 0.360) +(ScreenAttribute center PhysicalScreenHeight 0.288) + +// Set the TrackerBaseToImagePlate transform for this screen. The coexistence +// to tracker base transform is identity by default, so the tracker base origin +// and orientation will also set the origin and orientation of coexistence +// coordinates in the physical world. This is the primary purpose of setting +// this transform when neither head tracking nor multiple screens are being +// used. +// +// The tracker base and center of coexistence are set here to the middle of the +// screen's image plate. Their basis vectors are aligned with the image plate +// basis vectors. The physical eyepoint position will be set relative to +// coexistence coordinates below. +// +(ScreenAttribute center TrackerBaseToImagePlate + (Translate 0.180 0.144 0.000)) + +// Create a view using the defined screen. +// +(NewView view0) +(ViewAttribute view0 Screen center) + +// Set the eyepoint relative to coexistence coordinates. Here it is set 45cm +// toward the user along +Z. Skewed projections can be created by offsetting +// the eyepoint along X and/or Y. +// +(ViewAttribute view0 CenterEyeInCoexistence (0.0 0.0 0.45)) diff --git a/src/classes/org/jdesktop/j3d/examples/configured_universe/j3d1x2-flat b/src/classes/org/jdesktop/j3d/examples/configured_universe/j3d1x2-flat deleted file mode 100644 index 667ea52..0000000 --- a/src/classes/org/jdesktop/j3d/examples/configured_universe/j3d1x2-flat +++ /dev/null @@ -1,134 +0,0 @@ -/* - * $RCSfile$ - * - * Copyright (c) 2006 Sun Microsystems, Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistribution of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * - Redistribution in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * Neither the name of Sun Microsystems, Inc. or the names of - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * 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 MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL - * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF - * USING, MODIFYING OR DISTRIBUTING THIS 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 THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGES. - * - * You acknowledge that this software is not designed, licensed or - * intended for use in the design, construction, operation or - * maintenance of any nuclear facility. - * - * $Revision$ - * $Date$ - * $State$ - */ - -/* - ************************************************************************ - * - * Java 3D configuration file for dual-screen (flat) desktop configuration - * with no head tracking. - * - ************************************************************************ - */ - -// Create new screen objects and associate them with logical names and numbers. -// These numbers are used as indices to retrieve the AWT GraphicsDevice from -// the array that GraphicsEnvironment.getScreenDevices() returns. -// -// NOTE: The GraphicsDevice order in the array is specific to the local -// site and display system. -// -(NewScreen left 0) -(NewScreen right 1) - -// Set the screen dimensions. -// -(ScreenAttribute left PhysicalScreenWidth 0.360) -(ScreenAttribute left PhysicalScreenHeight 0.288) - -(ScreenAttribute right PhysicalScreenWidth 0.360) -(ScreenAttribute right PhysicalScreenHeight 0.288) - -// Specify full screen windows. -// -(ScreenAttribute left WindowSize NoBorderFullScreen) -(ScreenAttribute right WindowSize NoBorderFullScreen) - -// Set the TrackerBaseToImagePlate transforms for these screens. This -// transforms points in tracker base coordinates to each screen's image plate -// coordinates, where the origin of the image plate is defined to be the lower -// left corner of the screen with X increasing to the right, Y increasing to -// the top, and Z increasing away from the screen. -// -// Without head or sensor tracking the tracker base is still needed as a fixed -// frame of reference for describing the orientation and position of each -// screen to the others. The coexistence to tracker base transform is set to -// identity by default, so the tracker base origin and orientation will also -// set the origin and orientation of coexistence coordinates in the physical -// world. -// -// The tracker base and center of coexistence is set here to the middle of the -// edge shared by the two screens. -// -(ScreenAttribute left TrackerBaseToImagePlate - (Translate 0.360 0.144 0.0)) -(ScreenAttribute right TrackerBaseToImagePlate - (Translate 0.000 0.144 0.0)) - -// Sometimes it is desirable to include the bevels in between the monitors in -// the TrackerBaseToImagePlate transforms, so that the abutting bevels obscure -// the view of the virtual world instead of stretching it out between the -// monitors. For a bevel width of 4.5 cm on each monitor, the above commands -// would become the following: -// -// (ScreenAttribute left TrackerBaseToImagePlate -// (Translate 0.405 0.144 0.0)) -// (ScreenAttribute right TrackerBaseToImagePlate -// (Translate -0.045 0.144 0.0)) -// -// Conversely, a similar technique may be used to include overlap between the -// screens. This is useful for projection systems which use edge blending -// to provide seamless integration between screens. - - -// Create a view using the defined screens. -// -(NewView view0) -(ViewAttribute view0 Screen left) -(ViewAttribute view0 Screen right) - -// Set the eyepoint relative to coexistence coordinates. Here it is set 45cm -// toward the user along Z, extending out from the midpoint of the edge shared -// by the two screens. This will create the appropriate skewed projection -// frustums for each image plate. -// -// If a planar display surface is all that is required, the same effect could -// be achieved in a virtual screen enviroment such as Xinerama by simply -// creating a canvas that spans both screens. In some display environments the -// use of a canvas that spans multiple physical screens may cause significant -// performance degradation, however. -// -// See j3d1x2-rot30 for an example of a non-planar configuration that cannot be -// achieved through a single canvas spanning both screens. -// -(ViewAttribute view0 CenterEyeInCoexistence (0.0 0.0 0.45)) diff --git a/src/classes/org/jdesktop/j3d/examples/configured_universe/j3d1x2-flat.cfg b/src/classes/org/jdesktop/j3d/examples/configured_universe/j3d1x2-flat.cfg new file mode 100644 index 0000000..667ea52 --- /dev/null +++ b/src/classes/org/jdesktop/j3d/examples/configured_universe/j3d1x2-flat.cfg @@ -0,0 +1,134 @@ +/* + * $RCSfile$ + * + * Copyright (c) 2006 Sun Microsystems, Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistribution of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistribution in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of Sun Microsystems, Inc. or the names of + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 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 MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL + * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF + * USING, MODIFYING OR DISTRIBUTING THIS 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 THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGES. + * + * You acknowledge that this software is not designed, licensed or + * intended for use in the design, construction, operation or + * maintenance of any nuclear facility. + * + * $Revision$ + * $Date$ + * $State$ + */ + +/* + ************************************************************************ + * + * Java 3D configuration file for dual-screen (flat) desktop configuration + * with no head tracking. + * + ************************************************************************ + */ + +// Create new screen objects and associate them with logical names and numbers. +// These numbers are used as indices to retrieve the AWT GraphicsDevice from +// the array that GraphicsEnvironment.getScreenDevices() returns. +// +// NOTE: The GraphicsDevice order in the array is specific to the local +// site and display system. +// +(NewScreen left 0) +(NewScreen right 1) + +// Set the screen dimensions. +// +(ScreenAttribute left PhysicalScreenWidth 0.360) +(ScreenAttribute left PhysicalScreenHeight 0.288) + +(ScreenAttribute right PhysicalScreenWidth 0.360) +(ScreenAttribute right PhysicalScreenHeight 0.288) + +// Specify full screen windows. +// +(ScreenAttribute left WindowSize NoBorderFullScreen) +(ScreenAttribute right WindowSize NoBorderFullScreen) + +// Set the TrackerBaseToImagePlate transforms for these screens. This +// transforms points in tracker base coordinates to each screen's image plate +// coordinates, where the origin of the image plate is defined to be the lower +// left corner of the screen with X increasing to the right, Y increasing to +// the top, and Z increasing away from the screen. +// +// Without head or sensor tracking the tracker base is still needed as a fixed +// frame of reference for describing the orientation and position of each +// screen to the others. The coexistence to tracker base transform is set to +// identity by default, so the tracker base origin and orientation will also +// set the origin and orientation of coexistence coordinates in the physical +// world. +// +// The tracker base and center of coexistence is set here to the middle of the +// edge shared by the two screens. +// +(ScreenAttribute left TrackerBaseToImagePlate + (Translate 0.360 0.144 0.0)) +(ScreenAttribute right TrackerBaseToImagePlate + (Translate 0.000 0.144 0.0)) + +// Sometimes it is desirable to include the bevels in between the monitors in +// the TrackerBaseToImagePlate transforms, so that the abutting bevels obscure +// the view of the virtual world instead of stretching it out between the +// monitors. For a bevel width of 4.5 cm on each monitor, the above commands +// would become the following: +// +// (ScreenAttribute left TrackerBaseToImagePlate +// (Translate 0.405 0.144 0.0)) +// (ScreenAttribute right TrackerBaseToImagePlate +// (Translate -0.045 0.144 0.0)) +// +// Conversely, a similar technique may be used to include overlap between the +// screens. This is useful for projection systems which use edge blending +// to provide seamless integration between screens. + + +// Create a view using the defined screens. +// +(NewView view0) +(ViewAttribute view0 Screen left) +(ViewAttribute view0 Screen right) + +// Set the eyepoint relative to coexistence coordinates. Here it is set 45cm +// toward the user along Z, extending out from the midpoint of the edge shared +// by the two screens. This will create the appropriate skewed projection +// frustums for each image plate. +// +// If a planar display surface is all that is required, the same effect could +// be achieved in a virtual screen enviroment such as Xinerama by simply +// creating a canvas that spans both screens. In some display environments the +// use of a canvas that spans multiple physical screens may cause significant +// performance degradation, however. +// +// See j3d1x2-rot30 for an example of a non-planar configuration that cannot be +// achieved through a single canvas spanning both screens. +// +(ViewAttribute view0 CenterEyeInCoexistence (0.0 0.0 0.45)) diff --git a/src/classes/org/jdesktop/j3d/examples/configured_universe/j3d1x2-rot30 b/src/classes/org/jdesktop/j3d/examples/configured_universe/j3d1x2-rot30 deleted file mode 100644 index 68f4a6e..0000000 --- a/src/classes/org/jdesktop/j3d/examples/configured_universe/j3d1x2-rot30 +++ /dev/null @@ -1,99 +0,0 @@ -/* - * $RCSfile$ - * - * Copyright (c) 2006 Sun Microsystems, Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistribution of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * - Redistribution in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * Neither the name of Sun Microsystems, Inc. or the names of - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * 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 MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL - * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF - * USING, MODIFYING OR DISTRIBUTING THIS 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 THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGES. - * - * You acknowledge that this software is not designed, licensed or - * intended for use in the design, construction, operation or - * maintenance of any nuclear facility. - * - * $Revision$ - * $Date$ - * $State$ - */ - -/* - ************************************************************************ - * - * Java 3D configuration file for a dual-screen desktop configuration - * with each screen rotated toward the other by 30 degrees about Y from - * planar. The inside angle between them is 120 degrees. - * - ************************************************************************ - */ - -// Create new screen objects and associate them with logical names and numbers. -// These numbers are used as indices to retrieve the AWT GraphicsDevice from -// the array that GraphicsEnvironment.getScreenDevices() returns. -// -// NOTE: The GraphicsDevice order in the array is specific to the local -// site and display system. -// -(NewScreen left 0) -(NewScreen right 1) - -// Set the available image areas for full screens. -// -(ScreenAttribute left PhysicalScreenWidth 0.360) -(ScreenAttribute left PhysicalScreenHeight 0.288) - -(ScreenAttribute right PhysicalScreenWidth 0.360) -(ScreenAttribute right PhysicalScreenHeight 0.288) - -// Specify full screen windows. -// -(ScreenAttribute left WindowSize NoBorderFullScreen) -(ScreenAttribute right WindowSize NoBorderFullScreen) - -// Set the TrackerBaseToImagePlate transforms for these screens. -// -// The tracker base is set here to the middle of the edge shared by the two -// screens. Each screen is rotated 30 degrees toward the other about the -// tracker base +Y axis, so that the tracker base +Z is centered between the -// two screens. -// -(ScreenAttribute left TrackerBaseToImagePlate - (RotateTranslate (Rotate 0.000 -30.000 0.0) - (Translate 0.360 0.144 0.0))) - -(ScreenAttribute right TrackerBaseToImagePlate - (RotateTranslate (Rotate 0.000 30.000 0.0) - (Translate 0.000 0.144 0.0))) - - -// Create a view using the defined screens. -// -(NewView view0) -(ViewAttribute view0 Screen left) -(ViewAttribute view0 Screen right) -(ViewAttribute view0 CenterEyeInCoexistence (0.0 0.0 0.45)) diff --git a/src/classes/org/jdesktop/j3d/examples/configured_universe/j3d1x2-rot30.cfg b/src/classes/org/jdesktop/j3d/examples/configured_universe/j3d1x2-rot30.cfg new file mode 100644 index 0000000..68f4a6e --- /dev/null +++ b/src/classes/org/jdesktop/j3d/examples/configured_universe/j3d1x2-rot30.cfg @@ -0,0 +1,99 @@ +/* + * $RCSfile$ + * + * Copyright (c) 2006 Sun Microsystems, Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistribution of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistribution in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of Sun Microsystems, Inc. or the names of + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 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 MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL + * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF + * USING, MODIFYING OR DISTRIBUTING THIS 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 THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGES. + * + * You acknowledge that this software is not designed, licensed or + * intended for use in the design, construction, operation or + * maintenance of any nuclear facility. + * + * $Revision$ + * $Date$ + * $State$ + */ + +/* + ************************************************************************ + * + * Java 3D configuration file for a dual-screen desktop configuration + * with each screen rotated toward the other by 30 degrees about Y from + * planar. The inside angle between them is 120 degrees. + * + ************************************************************************ + */ + +// Create new screen objects and associate them with logical names and numbers. +// These numbers are used as indices to retrieve the AWT GraphicsDevice from +// the array that GraphicsEnvironment.getScreenDevices() returns. +// +// NOTE: The GraphicsDevice order in the array is specific to the local +// site and display system. +// +(NewScreen left 0) +(NewScreen right 1) + +// Set the available image areas for full screens. +// +(ScreenAttribute left PhysicalScreenWidth 0.360) +(ScreenAttribute left PhysicalScreenHeight 0.288) + +(ScreenAttribute right PhysicalScreenWidth 0.360) +(ScreenAttribute right PhysicalScreenHeight 0.288) + +// Specify full screen windows. +// +(ScreenAttribute left WindowSize NoBorderFullScreen) +(ScreenAttribute right WindowSize NoBorderFullScreen) + +// Set the TrackerBaseToImagePlate transforms for these screens. +// +// The tracker base is set here to the middle of the edge shared by the two +// screens. Each screen is rotated 30 degrees toward the other about the +// tracker base +Y axis, so that the tracker base +Z is centered between the +// two screens. +// +(ScreenAttribute left TrackerBaseToImagePlate + (RotateTranslate (Rotate 0.000 -30.000 0.0) + (Translate 0.360 0.144 0.0))) + +(ScreenAttribute right TrackerBaseToImagePlate + (RotateTranslate (Rotate 0.000 30.000 0.0) + (Translate 0.000 0.144 0.0))) + + +// Create a view using the defined screens. +// +(NewView view0) +(ViewAttribute view0 Screen left) +(ViewAttribute view0 Screen right) +(ViewAttribute view0 CenterEyeInCoexistence (0.0 0.0 0.45)) diff --git a/src/classes/org/jdesktop/j3d/examples/configured_universe/j3d1x3-cave b/src/classes/org/jdesktop/j3d/examples/configured_universe/j3d1x3-cave deleted file mode 100644 index afc532c..0000000 --- a/src/classes/org/jdesktop/j3d/examples/configured_universe/j3d1x3-cave +++ /dev/null @@ -1,171 +0,0 @@ -/* - * $RCSfile$ - * - * Copyright (c) 2006 Sun Microsystems, Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistribution of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * - Redistribution in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * Neither the name of Sun Microsystems, Inc. or the names of - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * 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 MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL - * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF - * USING, MODIFYING OR DISTRIBUTING THIS 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 THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGES. - * - * You acknowledge that this software is not designed, licensed or - * intended for use in the design, construction, operation or - * maintenance of any nuclear facility. - * - * $Revision$ - * $Date$ - * $State$ - */ - -/* - ************************************************************************ - * - * Java 3D configuration file for a cave environment. This cave - * consists of 3 projectors with 3 screens to the left, front, and right - * of the user, all at 90 degrees to each other. - * - * The projectors in the VirtualPortal sample site are actually turned - * on their sides to get more height. Screen 0 is rotated 90 degrees - * counter-clockwise, while screens 1 and 2 are rotated 90 degrees - * clockwise. - * - ************************************************************************ - */ - -// Create new screen objects and associate them with logical names and numbers. -// These numbers are used as indices to retrieve the AWT GraphicsDevice from -// the array that GraphicsEnvironment.getScreenDevices() returns. -// -// NOTE: The GraphicsDevice order in the array is specific to the local -// site and display system. -// -(NewScreen left 0) -(NewScreen center 1) -(NewScreen right 2) - - -// Set the available image areas as well as their positition and orientation -// relative to the tracker base. Although this config file doesn't enable -// head tracking, the tracker base is still needed as a point of reference to -// describe the position and orientation of the screens relative to the -// environment. -// -// From the orientation of a user standing within this VirtualPortal site and -// facing the center screen, the tracker base is along the vertical midline of -// the screen, 0.248 meters down from the top edge, and 1.340 meters in front -// of it. The tracker base is oriented so that its +X axis points to the left, -// its +Y axis points toward the screen, and its +Z axis points toward the -// floor. -// -(ScreenAttribute left PhysicalScreenWidth 2.480) -(ScreenAttribute left PhysicalScreenHeight 1.705) -(ScreenAttribute left WindowSize NoBorderFullScreen) -(ScreenAttribute left TrackerBaseToImagePlate - (( 0.0 0.0 -1.0 2.230) - ( 0.0 -1.0 0.0 1.340) - (-1.0 0.0 0.0 0.885))) - -(ScreenAttribute center PhysicalScreenWidth 2.485) -(ScreenAttribute center PhysicalScreenHeight 1.745) -(ScreenAttribute center WindowSize NoBorderFullScreen) -(ScreenAttribute center TrackerBaseToImagePlate - (( 0.0 0.0 1.0 0.248) - (-1.0 0.0 0.0 0.885) - ( 0.0 -1.0 0.0 1.340))) - -(ScreenAttribute right PhysicalScreenWidth 2.480) -(ScreenAttribute right PhysicalScreenHeight 1.775) -(ScreenAttribute right WindowSize NoBorderFullScreen) -(ScreenAttribute right TrackerBaseToImagePlate - (( 0.0 0.0 1.0 0.2488) - ( 0.0 -1.0 0.0 1.340) - ( 1.0 0.0 0.0 0.860))) - -// Set the location of the center of coexistence relative to the tracker base. -// Here it set to the center of the center screen. This config file will set -// the location of the user's eyes relative to this point. The default view -// attach policy of NOMINAL_SCREEN used by ConfiguredUniverse will place the -// origin of the view platform in coexistence coordinates at the center of -// coexistence. -// -(NewPhysicalEnvironment VirtualPortal) -(PhysicalEnvironmentAttribute VirtualPortal - CoexistenceToTrackerBase - ((-1.0 0.0 0.0 0.000) - ( 0.0 0.0 -1.0 1.340) - ( 0.0 -1.0 0.0 0.994))) - -// The above center of coexistence is appropriate for the sample geometry -// files available in the programs/examples directory. Often a more -// immersive point of view is required for larger virtual worlds. This can be -// achieved by placing the center of coexistence closer to the nominal position -// of the user's head, so that the view platform origin in coexistence -// coordinates will map there as well. -// -// Here we set the location of the center of coexistence 0.5 meters along the -// tracker base +Z axis, 1.737 meters from the floor (about 5 ft 8.4 inches). -// -// (PhysicalEnvironmentAttribute VirtualPortal -// CoexistenceToTrackerBase -// ((-1.0 0.0 0.0 0.0) -// ( 0.0 0.0 -1.0 0.0) -// ( 0.0 -1.0 0.0 0.5))) - - -// Now define the view. -// -(NewView view0) -(ViewAttribute view0 Screen left) -(ViewAttribute view0 Screen center) -(ViewAttribute view0 Screen right) -(ViewAttribute view0 PhysicalEnvironment VirtualPortal) - -// Set the user eye position in the display environment. It is set here to -// 1.340 meters back from the center screen (directly under the tracker), and -// 1.737 meters from the floor (about 5 ft 8.4 inches). -// -(ViewAttribute view0 CenterEyeInCoexistence (0.0 0.494 1.340)) - -// Here is an alternative center eye position to use with the immersive -// coexistence coordinate system defined in comments above. -// -// (ViewAttribute view0 CenterEyeInCoexistence (0.0 0.0 0.0)) - -// Set the screen scale. This is scale factor from virtual to physical -// coordinates. -// -(ViewAttribute view0 ScreenScalePolicy SCALE_SCREEN_SIZE) - -// Alternative for explict scaling. -// -// (ViewAttribute view0 ScreenScalePolicy SCALE_EXPLICIT) -// (ViewAttribute view0 ScreenScale 5.00) - -// No stereo viewing for this configuration. -// -(ViewAttribute view0 StereoEnable False) diff --git a/src/classes/org/jdesktop/j3d/examples/configured_universe/j3d1x3-cave-vr b/src/classes/org/jdesktop/j3d/examples/configured_universe/j3d1x3-cave-vr deleted file mode 100644 index 029decf..0000000 --- a/src/classes/org/jdesktop/j3d/examples/configured_universe/j3d1x3-cave-vr +++ /dev/null @@ -1,222 +0,0 @@ -/* - * $RCSfile$ - * - * Copyright (c) 2006 Sun Microsystems, Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistribution of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * - Redistribution in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * Neither the name of Sun Microsystems, Inc. or the names of - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * 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 MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL - * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF - * USING, MODIFYING OR DISTRIBUTING THIS 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 THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGES. - * - * You acknowledge that this software is not designed, licensed or - * intended for use in the design, construction, operation or - * maintenance of any nuclear facility. - * - * $Revision$ - * $Date$ - * $State$ - */ - -/* - ************************************************************************ - * - * Java 3D configuration file for a cave environment with head tracking and - * stereo viewing. This cave consists of 3 projectors with 3 screens to the - * left, front, and right of the user, all at 90 degrees to each other. - * - * The projectors in the VirtualPortal sample site are actually turned - * on their sides to get more height. Screen 0 is rotated 90 degrees - * counter-clockwise, while screens 1 and 2 are rotated 90 degrees - * clockwise. - * - ************************************************************************ - */ - -// Configure the head tracker. The NewDevice command binds a logical name -// (the 2nd argument) to an InputDevice implementation whose class name is -// specified in the 3rd argument. The InputDevice implementation for a head -// tracker must generate position and orientation data relative to a fixed -// frame of reference in the physical world, the "tracker base" of the Java -// 3D view model. -// -// The InputDevice is instantiated through introspection of the class name. -// Available InputDevice implementations are site-specific, so substitute -// the class name in a NewDevice command below with one that is available at -// the local site. -// -// Note that properties are used to configure an InputDevice instead of -// attributes. The details of an InputDevice implementation are not known to -// ConfiguredUniverse, so the property name is invoked as a method through -// introspection. The example properties below must be replaced with the ones -// needed, if any, by specific InputDevice implementations. All arguments -// following the method name are wrapped and passed to the specified method as -// an array of Objects. -// -// All property arguments following the method name are wrapped and passed to -// the specified method as an array of Objects. Strings "true" and "false" -// get wrapped into Boolean, and number strings get wrapped into Double. -// Construct such as (0.0 1.0 2.0) and ((0.0 1.0 2.0 0.5) (3.0 4.0 5.0 1.0) -// (6.0 7.0 8.0 0.0)) get converted to Point3d and Matrix4d respectively. -// Note that last row of a Matrix4d doesn't need to be specified; it is -// implicitly (0.0 0.0 0.0 1.0). -// -(NewDevice glasses LogitechRedBarron) -(DeviceProperty glasses SerialPort "/dev/ttya") // Unix paths need quoting. -(DeviceProperty glasses TransmitterBaseline 0.4600) -(DeviceProperty glasses TransmitterLeftLeg 0.4400) -(DeviceProperty glasses TransmitterCalibrationDistance 0.4120) - -// Create a logical name for the head tracker sensor. The last argument is -// the sensor's index in the input device. -// -(NewSensor head glasses 0) - -// Create new screen objects and associate them with logical names and numbers. -// These numbers are used as indices to retrieve the AWT GraphicsDevice from -// the array that GraphicsEnvironment.getScreenDevices() returns. -// -// NOTE: The GraphicsDevice order in the array is specific to the local -// site and display system. -// -(NewScreen left 0) -(NewScreen center 1) -(NewScreen right 2) - - -// Set the available image areas as well as their positition and orientation -// relative to the tracker base. From the orientation of a user standing -// within this VirtualPortal site and facing the center screen, the tracker -// base is along the vertical midline of the screen, 0.248 meters down from -// the top edge, and 1.340 meters in front of it. The tracker base is -// oriented so that its +X axis points to the left, its +Y axis points toward -// the screen, and its +Z axis points toward the floor. -// -(ScreenAttribute left PhysicalScreenWidth 2.480) -(ScreenAttribute left PhysicalScreenHeight 1.705) -(ScreenAttribute left WindowSize NoBorderFullScreen) -(ScreenAttribute left TrackerBaseToImagePlate - (( 0.0 0.0 -1.0 2.230) - ( 0.0 -1.0 0.0 1.340) - (-1.0 0.0 0.0 0.885))) - -(ScreenAttribute center PhysicalScreenWidth 2.485) -(ScreenAttribute center PhysicalScreenHeight 1.745) -(ScreenAttribute center WindowSize NoBorderFullScreen) -(ScreenAttribute center TrackerBaseToImagePlate - (( 0.0 0.0 1.0 0.248) - (-1.0 0.0 0.0 0.885) - ( 0.0 -1.0 0.0 1.340))) - -(ScreenAttribute right PhysicalScreenWidth 2.480) -(ScreenAttribute right PhysicalScreenHeight 1.775) -(ScreenAttribute right WindowSize NoBorderFullScreen) -(ScreenAttribute right TrackerBaseToImagePlate - (( 0.0 0.0 1.0 0.2488) - ( 0.0 -1.0 0.0 1.340) - ( 1.0 0.0 0.0 0.860))) - -// Create a physical environment. This contains the available input devices, -// audio devices, and sensors, and defines the coexistence coordinate system -// for mapping between the virtual and physical worlds. -// -(NewPhysicalEnvironment VirtualPortal) - -// Register the input device defined in this file and the sensor which will -// drive head tracking. -// -(PhysicalEnvironmentAttribute VirtualPortal InputDevice glasses) -(PhysicalEnvironmentAttribute VirtualPortal HeadTracker head) - -// Set the location of the center of coexistence relative to the tracker base. -// Here it set to the center of the center screen. The default view attach -// policy of NOMINAL_SCREEN used by ConfiguredUniverse will place the origin of -// the view platform in coexistence coordinates at the center of coexistence. -// -(PhysicalEnvironmentAttribute VirtualPortal - CoexistenceToTrackerBase - ((-1.0 0.0 0.0 0.000) - ( 0.0 0.0 -1.0 1.340) - ( 0.0 -1.0 0.0 0.994))) - -// The above center of coexistence is appropriate for the sample geometry -// files available in the programs/examples directory. Often a more -// immersive point of view is required for larger virtual worlds. This can be -// achieved by placing the center of coexistence closer to the nominal position -// of the user's head, so that the view platform origin in coexistence -// coordinates will map there as well. -// -// Here we set the location of the center of coexistence 0.5 meters along the -// tracker base +Z axis, 1.737 meters from the floor (about 5 ft 8.4 inches). -// -// (PhysicalEnvironmentAttribute VirtualPortal -// CoexistenceToTrackerBase -// ((-1.0 0.0 0.0 0.0) -// ( 0.0 0.0 -1.0 0.0) -// ( 0.0 -1.0 0.0 0.5))) - - -// Define the physical body. -// -// The head origin is halfway between the eyes, with X extending to the right, -// Y up, and positive Z extending into the skull. -// -(NewPhysicalBody LabRat) -(PhysicalBodyAttribute LabRat StereoEyeSeparation .07) - -// Define the position and orientation of the head relative to the tracker -// mounted on the head. -// -(PhysicalBodyAttribute LabRat HeadToHeadTracker - ((-1.0 0.0 0.0 0.00) - ( 0.0 0.0 -1.0 0.05) - ( 0.0 -1.0 0.0 0.11))) -// Now define the view. -// -(NewView view0) -(ViewAttribute view0 Screen left) -(ViewAttribute view0 Screen center) -(ViewAttribute view0 Screen right) -(ViewAttribute view0 PhysicalBody LabRat) -(ViewAttribute view0 PhysicalEnvironment VirtualPortal) - -// Set the screen scale. This is scale factor from virtual to physical -// coordinates. -// -(ViewAttribute view0 ScreenScalePolicy SCALE_SCREEN_SIZE) - -// Alternative for explict scaling. -// -//(ViewAttribute view0 ScreenScalePolicy SCALE_EXPLICIT) -//(ViewAttribute view0 ScreenScale 5.00) - -// Enable stereo viewing. Enable head tracking to get the position of the eyes -// with respect to coexistence. Boolean values may be specified as either -// true, True, false, or False. -// -(ViewAttribute view0 StereoEnable true) -(ViewAttribute view0 TrackingEnable True) diff --git a/src/classes/org/jdesktop/j3d/examples/configured_universe/j3d1x3-cave-vr.cfg b/src/classes/org/jdesktop/j3d/examples/configured_universe/j3d1x3-cave-vr.cfg new file mode 100644 index 0000000..029decf --- /dev/null +++ b/src/classes/org/jdesktop/j3d/examples/configured_universe/j3d1x3-cave-vr.cfg @@ -0,0 +1,222 @@ +/* + * $RCSfile$ + * + * Copyright (c) 2006 Sun Microsystems, Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistribution of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistribution in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of Sun Microsystems, Inc. or the names of + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 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 MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL + * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF + * USING, MODIFYING OR DISTRIBUTING THIS 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 THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGES. + * + * You acknowledge that this software is not designed, licensed or + * intended for use in the design, construction, operation or + * maintenance of any nuclear facility. + * + * $Revision$ + * $Date$ + * $State$ + */ + +/* + ************************************************************************ + * + * Java 3D configuration file for a cave environment with head tracking and + * stereo viewing. This cave consists of 3 projectors with 3 screens to the + * left, front, and right of the user, all at 90 degrees to each other. + * + * The projectors in the VirtualPortal sample site are actually turned + * on their sides to get more height. Screen 0 is rotated 90 degrees + * counter-clockwise, while screens 1 and 2 are rotated 90 degrees + * clockwise. + * + ************************************************************************ + */ + +// Configure the head tracker. The NewDevice command binds a logical name +// (the 2nd argument) to an InputDevice implementation whose class name is +// specified in the 3rd argument. The InputDevice implementation for a head +// tracker must generate position and orientation data relative to a fixed +// frame of reference in the physical world, the "tracker base" of the Java +// 3D view model. +// +// The InputDevice is instantiated through introspection of the class name. +// Available InputDevice implementations are site-specific, so substitute +// the class name in a NewDevice command below with one that is available at +// the local site. +// +// Note that properties are used to configure an InputDevice instead of +// attributes. The details of an InputDevice implementation are not known to +// ConfiguredUniverse, so the property name is invoked as a method through +// introspection. The example properties below must be replaced with the ones +// needed, if any, by specific InputDevice implementations. All arguments +// following the method name are wrapped and passed to the specified method as +// an array of Objects. +// +// All property arguments following the method name are wrapped and passed to +// the specified method as an array of Objects. Strings "true" and "false" +// get wrapped into Boolean, and number strings get wrapped into Double. +// Construct such as (0.0 1.0 2.0) and ((0.0 1.0 2.0 0.5) (3.0 4.0 5.0 1.0) +// (6.0 7.0 8.0 0.0)) get converted to Point3d and Matrix4d respectively. +// Note that last row of a Matrix4d doesn't need to be specified; it is +// implicitly (0.0 0.0 0.0 1.0). +// +(NewDevice glasses LogitechRedBarron) +(DeviceProperty glasses SerialPort "/dev/ttya") // Unix paths need quoting. +(DeviceProperty glasses TransmitterBaseline 0.4600) +(DeviceProperty glasses TransmitterLeftLeg 0.4400) +(DeviceProperty glasses TransmitterCalibrationDistance 0.4120) + +// Create a logical name for the head tracker sensor. The last argument is +// the sensor's index in the input device. +// +(NewSensor head glasses 0) + +// Create new screen objects and associate them with logical names and numbers. +// These numbers are used as indices to retrieve the AWT GraphicsDevice from +// the array that GraphicsEnvironment.getScreenDevices() returns. +// +// NOTE: The GraphicsDevice order in the array is specific to the local +// site and display system. +// +(NewScreen left 0) +(NewScreen center 1) +(NewScreen right 2) + + +// Set the available image areas as well as their positition and orientation +// relative to the tracker base. From the orientation of a user standing +// within this VirtualPortal site and facing the center screen, the tracker +// base is along the vertical midline of the screen, 0.248 meters down from +// the top edge, and 1.340 meters in front of it. The tracker base is +// oriented so that its +X axis points to the left, its +Y axis points toward +// the screen, and its +Z axis points toward the floor. +// +(ScreenAttribute left PhysicalScreenWidth 2.480) +(ScreenAttribute left PhysicalScreenHeight 1.705) +(ScreenAttribute left WindowSize NoBorderFullScreen) +(ScreenAttribute left TrackerBaseToImagePlate + (( 0.0 0.0 -1.0 2.230) + ( 0.0 -1.0 0.0 1.340) + (-1.0 0.0 0.0 0.885))) + +(ScreenAttribute center PhysicalScreenWidth 2.485) +(ScreenAttribute center PhysicalScreenHeight 1.745) +(ScreenAttribute center WindowSize NoBorderFullScreen) +(ScreenAttribute center TrackerBaseToImagePlate + (( 0.0 0.0 1.0 0.248) + (-1.0 0.0 0.0 0.885) + ( 0.0 -1.0 0.0 1.340))) + +(ScreenAttribute right PhysicalScreenWidth 2.480) +(ScreenAttribute right PhysicalScreenHeight 1.775) +(ScreenAttribute right WindowSize NoBorderFullScreen) +(ScreenAttribute right TrackerBaseToImagePlate + (( 0.0 0.0 1.0 0.2488) + ( 0.0 -1.0 0.0 1.340) + ( 1.0 0.0 0.0 0.860))) + +// Create a physical environment. This contains the available input devices, +// audio devices, and sensors, and defines the coexistence coordinate system +// for mapping between the virtual and physical worlds. +// +(NewPhysicalEnvironment VirtualPortal) + +// Register the input device defined in this file and the sensor which will +// drive head tracking. +// +(PhysicalEnvironmentAttribute VirtualPortal InputDevice glasses) +(PhysicalEnvironmentAttribute VirtualPortal HeadTracker head) + +// Set the location of the center of coexistence relative to the tracker base. +// Here it set to the center of the center screen. The default view attach +// policy of NOMINAL_SCREEN used by ConfiguredUniverse will place the origin of +// the view platform in coexistence coordinates at the center of coexistence. +// +(PhysicalEnvironmentAttribute VirtualPortal + CoexistenceToTrackerBase + ((-1.0 0.0 0.0 0.000) + ( 0.0 0.0 -1.0 1.340) + ( 0.0 -1.0 0.0 0.994))) + +// The above center of coexistence is appropriate for the sample geometry +// files available in the programs/examples directory. Often a more +// immersive point of view is required for larger virtual worlds. This can be +// achieved by placing the center of coexistence closer to the nominal position +// of the user's head, so that the view platform origin in coexistence +// coordinates will map there as well. +// +// Here we set the location of the center of coexistence 0.5 meters along the +// tracker base +Z axis, 1.737 meters from the floor (about 5 ft 8.4 inches). +// +// (PhysicalEnvironmentAttribute VirtualPortal +// CoexistenceToTrackerBase +// ((-1.0 0.0 0.0 0.0) +// ( 0.0 0.0 -1.0 0.0) +// ( 0.0 -1.0 0.0 0.5))) + + +// Define the physical body. +// +// The head origin is halfway between the eyes, with X extending to the right, +// Y up, and positive Z extending into the skull. +// +(NewPhysicalBody LabRat) +(PhysicalBodyAttribute LabRat StereoEyeSeparation .07) + +// Define the position and orientation of the head relative to the tracker +// mounted on the head. +// +(PhysicalBodyAttribute LabRat HeadToHeadTracker + ((-1.0 0.0 0.0 0.00) + ( 0.0 0.0 -1.0 0.05) + ( 0.0 -1.0 0.0 0.11))) +// Now define the view. +// +(NewView view0) +(ViewAttribute view0 Screen left) +(ViewAttribute view0 Screen center) +(ViewAttribute view0 Screen right) +(ViewAttribute view0 PhysicalBody LabRat) +(ViewAttribute view0 PhysicalEnvironment VirtualPortal) + +// Set the screen scale. This is scale factor from virtual to physical +// coordinates. +// +(ViewAttribute view0 ScreenScalePolicy SCALE_SCREEN_SIZE) + +// Alternative for explict scaling. +// +//(ViewAttribute view0 ScreenScalePolicy SCALE_EXPLICIT) +//(ViewAttribute view0 ScreenScale 5.00) + +// Enable stereo viewing. Enable head tracking to get the position of the eyes +// with respect to coexistence. Boolean values may be specified as either +// true, True, false, or False. +// +(ViewAttribute view0 StereoEnable true) +(ViewAttribute view0 TrackingEnable True) diff --git a/src/classes/org/jdesktop/j3d/examples/configured_universe/j3d1x3-cave.cfg b/src/classes/org/jdesktop/j3d/examples/configured_universe/j3d1x3-cave.cfg new file mode 100644 index 0000000..afc532c --- /dev/null +++ b/src/classes/org/jdesktop/j3d/examples/configured_universe/j3d1x3-cave.cfg @@ -0,0 +1,171 @@ +/* + * $RCSfile$ + * + * Copyright (c) 2006 Sun Microsystems, Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistribution of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistribution in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of Sun Microsystems, Inc. or the names of + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 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 MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL + * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF + * USING, MODIFYING OR DISTRIBUTING THIS 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 THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGES. + * + * You acknowledge that this software is not designed, licensed or + * intended for use in the design, construction, operation or + * maintenance of any nuclear facility. + * + * $Revision$ + * $Date$ + * $State$ + */ + +/* + ************************************************************************ + * + * Java 3D configuration file for a cave environment. This cave + * consists of 3 projectors with 3 screens to the left, front, and right + * of the user, all at 90 degrees to each other. + * + * The projectors in the VirtualPortal sample site are actually turned + * on their sides to get more height. Screen 0 is rotated 90 degrees + * counter-clockwise, while screens 1 and 2 are rotated 90 degrees + * clockwise. + * + ************************************************************************ + */ + +// Create new screen objects and associate them with logical names and numbers. +// These numbers are used as indices to retrieve the AWT GraphicsDevice from +// the array that GraphicsEnvironment.getScreenDevices() returns. +// +// NOTE: The GraphicsDevice order in the array is specific to the local +// site and display system. +// +(NewScreen left 0) +(NewScreen center 1) +(NewScreen right 2) + + +// Set the available image areas as well as their positition and orientation +// relative to the tracker base. Although this config file doesn't enable +// head tracking, the tracker base is still needed as a point of reference to +// describe the position and orientation of the screens relative to the +// environment. +// +// From the orientation of a user standing within this VirtualPortal site and +// facing the center screen, the tracker base is along the vertical midline of +// the screen, 0.248 meters down from the top edge, and 1.340 meters in front +// of it. The tracker base is oriented so that its +X axis points to the left, +// its +Y axis points toward the screen, and its +Z axis points toward the +// floor. +// +(ScreenAttribute left PhysicalScreenWidth 2.480) +(ScreenAttribute left PhysicalScreenHeight 1.705) +(ScreenAttribute left WindowSize NoBorderFullScreen) +(ScreenAttribute left TrackerBaseToImagePlate + (( 0.0 0.0 -1.0 2.230) + ( 0.0 -1.0 0.0 1.340) + (-1.0 0.0 0.0 0.885))) + +(ScreenAttribute center PhysicalScreenWidth 2.485) +(ScreenAttribute center PhysicalScreenHeight 1.745) +(ScreenAttribute center WindowSize NoBorderFullScreen) +(ScreenAttribute center TrackerBaseToImagePlate + (( 0.0 0.0 1.0 0.248) + (-1.0 0.0 0.0 0.885) + ( 0.0 -1.0 0.0 1.340))) + +(ScreenAttribute right PhysicalScreenWidth 2.480) +(ScreenAttribute right PhysicalScreenHeight 1.775) +(ScreenAttribute right WindowSize NoBorderFullScreen) +(ScreenAttribute right TrackerBaseToImagePlate + (( 0.0 0.0 1.0 0.2488) + ( 0.0 -1.0 0.0 1.340) + ( 1.0 0.0 0.0 0.860))) + +// Set the location of the center of coexistence relative to the tracker base. +// Here it set to the center of the center screen. This config file will set +// the location of the user's eyes relative to this point. The default view +// attach policy of NOMINAL_SCREEN used by ConfiguredUniverse will place the +// origin of the view platform in coexistence coordinates at the center of +// coexistence. +// +(NewPhysicalEnvironment VirtualPortal) +(PhysicalEnvironmentAttribute VirtualPortal + CoexistenceToTrackerBase + ((-1.0 0.0 0.0 0.000) + ( 0.0 0.0 -1.0 1.340) + ( 0.0 -1.0 0.0 0.994))) + +// The above center of coexistence is appropriate for the sample geometry +// files available in the programs/examples directory. Often a more +// immersive point of view is required for larger virtual worlds. This can be +// achieved by placing the center of coexistence closer to the nominal position +// of the user's head, so that the view platform origin in coexistence +// coordinates will map there as well. +// +// Here we set the location of the center of coexistence 0.5 meters along the +// tracker base +Z axis, 1.737 meters from the floor (about 5 ft 8.4 inches). +// +// (PhysicalEnvironmentAttribute VirtualPortal +// CoexistenceToTrackerBase +// ((-1.0 0.0 0.0 0.0) +// ( 0.0 0.0 -1.0 0.0) +// ( 0.0 -1.0 0.0 0.5))) + + +// Now define the view. +// +(NewView view0) +(ViewAttribute view0 Screen left) +(ViewAttribute view0 Screen center) +(ViewAttribute view0 Screen right) +(ViewAttribute view0 PhysicalEnvironment VirtualPortal) + +// Set the user eye position in the display environment. It is set here to +// 1.340 meters back from the center screen (directly under the tracker), and +// 1.737 meters from the floor (about 5 ft 8.4 inches). +// +(ViewAttribute view0 CenterEyeInCoexistence (0.0 0.494 1.340)) + +// Here is an alternative center eye position to use with the immersive +// coexistence coordinate system defined in comments above. +// +// (ViewAttribute view0 CenterEyeInCoexistence (0.0 0.0 0.0)) + +// Set the screen scale. This is scale factor from virtual to physical +// coordinates. +// +(ViewAttribute view0 ScreenScalePolicy SCALE_SCREEN_SIZE) + +// Alternative for explict scaling. +// +// (ViewAttribute view0 ScreenScalePolicy SCALE_EXPLICIT) +// (ViewAttribute view0 ScreenScale 5.00) + +// No stereo viewing for this configuration. +// +(ViewAttribute view0 StereoEnable False) diff --git a/src/classes/org/jdesktop/j3d/examples/configured_universe/j3d1x3-rot45 b/src/classes/org/jdesktop/j3d/examples/configured_universe/j3d1x3-rot45 deleted file mode 100644 index d221e74..0000000 --- a/src/classes/org/jdesktop/j3d/examples/configured_universe/j3d1x3-rot45 +++ /dev/null @@ -1,110 +0,0 @@ -/* - * $RCSfile$ - * - * Copyright (c) 2006 Sun Microsystems, Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistribution of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * - Redistribution in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * Neither the name of Sun Microsystems, Inc. or the names of - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * 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 MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL - * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF - * USING, MODIFYING OR DISTRIBUTING THIS 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 THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGES. - * - * You acknowledge that this software is not designed, licensed or - * intended for use in the design, construction, operation or - * maintenance of any nuclear facility. - * - * $Revision$ - * $Date$ - * $State$ - */ - -/* - ************************************************************************ - * - * Java 3D configuration file for 3 screens. Left and right screens are - * rotated 45 degrees from the center screen. - * - ************************************************************************ - */ - -// Create new screen objects and associate them with logical names and numbers. -// These numbers are used as indices to retrieve the AWT GraphicsDevice from -// the array that GraphicsEnvironment.getScreenDevices() returns. -// -// NOTE: The GraphicsDevice order in the array is specific to the local -// site and display system. -// -(NewScreen left 0) -(NewScreen center 1) -(NewScreen right 2) - -// Set the available image areas for full screens. -// -(ScreenAttribute left PhysicalScreenWidth 0.360) -(ScreenAttribute left PhysicalScreenHeight 0.288) - -(ScreenAttribute center PhysicalScreenWidth 0.360) -(ScreenAttribute center PhysicalScreenHeight 0.288) - -(ScreenAttribute right PhysicalScreenWidth 0.360) -(ScreenAttribute right PhysicalScreenHeight 0.288) - -// Specify full screen windows. -// -(ScreenAttribute left WindowSize NoBorderFullScreen) -(ScreenAttribute center WindowSize NoBorderFullScreen) -(ScreenAttribute right WindowSize NoBorderFullScreen) - -// Set the TrackerBaseToImagePlate transforms for these screens. -// -// The tracker base and center of coexistence are set here to the middle of the -// center screen. The basis vectors are aligned with the center screen image -// plate. The left and right screens are rotated 45 degrees toward each other -// about their shared edges with the center screen. -// -(ScreenAttribute center TrackerBaseToImagePlate - (Translate 0.180000 0.144000 0.000000)) - -// cos(45) * 0.360 * 0.5 = 0.127279; 0.360 + 0.127279 = 0.487279 -(ScreenAttribute left TrackerBaseToImagePlate - (RotateTranslate - (Rotate 0.000000 -45.000000 0.000000) - (Translate 0.487279 0.144000 0.127279))) - -// cos(45) * 0.360 * 0.5 = 0.127279 -(ScreenAttribute right TrackerBaseToImagePlate - (RotateTranslate - (Rotate 0.000000 45.000000 0.000000) - (Translate -0.127279 0.144000 0.127279))) - -// Create a view using the defined screens. -// -(NewView view0) -(ViewAttribute view0 Screen left) -(ViewAttribute view0 Screen center) -(ViewAttribute view0 Screen right) -(ViewAttribute view0 CenterEyeInCoexistence (0.0 0.0 0.5)) diff --git a/src/classes/org/jdesktop/j3d/examples/configured_universe/j3d1x3-rot45.cfg b/src/classes/org/jdesktop/j3d/examples/configured_universe/j3d1x3-rot45.cfg new file mode 100644 index 0000000..d221e74 --- /dev/null +++ b/src/classes/org/jdesktop/j3d/examples/configured_universe/j3d1x3-rot45.cfg @@ -0,0 +1,110 @@ +/* + * $RCSfile$ + * + * Copyright (c) 2006 Sun Microsystems, Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistribution of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistribution in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of Sun Microsystems, Inc. or the names of + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 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 MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL + * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF + * USING, MODIFYING OR DISTRIBUTING THIS 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 THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGES. + * + * You acknowledge that this software is not designed, licensed or + * intended for use in the design, construction, operation or + * maintenance of any nuclear facility. + * + * $Revision$ + * $Date$ + * $State$ + */ + +/* + ************************************************************************ + * + * Java 3D configuration file for 3 screens. Left and right screens are + * rotated 45 degrees from the center screen. + * + ************************************************************************ + */ + +// Create new screen objects and associate them with logical names and numbers. +// These numbers are used as indices to retrieve the AWT GraphicsDevice from +// the array that GraphicsEnvironment.getScreenDevices() returns. +// +// NOTE: The GraphicsDevice order in the array is specific to the local +// site and display system. +// +(NewScreen left 0) +(NewScreen center 1) +(NewScreen right 2) + +// Set the available image areas for full screens. +// +(ScreenAttribute left PhysicalScreenWidth 0.360) +(ScreenAttribute left PhysicalScreenHeight 0.288) + +(ScreenAttribute center PhysicalScreenWidth 0.360) +(ScreenAttribute center PhysicalScreenHeight 0.288) + +(ScreenAttribute right PhysicalScreenWidth 0.360) +(ScreenAttribute right PhysicalScreenHeight 0.288) + +// Specify full screen windows. +// +(ScreenAttribute left WindowSize NoBorderFullScreen) +(ScreenAttribute center WindowSize NoBorderFullScreen) +(ScreenAttribute right WindowSize NoBorderFullScreen) + +// Set the TrackerBaseToImagePlate transforms for these screens. +// +// The tracker base and center of coexistence are set here to the middle of the +// center screen. The basis vectors are aligned with the center screen image +// plate. The left and right screens are rotated 45 degrees toward each other +// about their shared edges with the center screen. +// +(ScreenAttribute center TrackerBaseToImagePlate + (Translate 0.180000 0.144000 0.000000)) + +// cos(45) * 0.360 * 0.5 = 0.127279; 0.360 + 0.127279 = 0.487279 +(ScreenAttribute left TrackerBaseToImagePlate + (RotateTranslate + (Rotate 0.000000 -45.000000 0.000000) + (Translate 0.487279 0.144000 0.127279))) + +// cos(45) * 0.360 * 0.5 = 0.127279 +(ScreenAttribute right TrackerBaseToImagePlate + (RotateTranslate + (Rotate 0.000000 45.000000 0.000000) + (Translate -0.127279 0.144000 0.127279))) + +// Create a view using the defined screens. +// +(NewView view0) +(ViewAttribute view0 Screen left) +(ViewAttribute view0 Screen center) +(ViewAttribute view0 Screen right) +(ViewAttribute view0 CenterEyeInCoexistence (0.0 0.0 0.5)) diff --git a/src/classes/org/jdesktop/j3d/examples/configured_universe/j3d2x2-flat b/src/classes/org/jdesktop/j3d/examples/configured_universe/j3d2x2-flat deleted file mode 100644 index 46df9a3..0000000 --- a/src/classes/org/jdesktop/j3d/examples/configured_universe/j3d2x2-flat +++ /dev/null @@ -1,135 +0,0 @@ -/* - * $RCSfile$ - * - * Copyright (c) 2006 Sun Microsystems, Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistribution of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * - Redistribution in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * Neither the name of Sun Microsystems, Inc. or the names of - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * 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 MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL - * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF - * USING, MODIFYING OR DISTRIBUTING THIS 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 THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGES. - * - * You acknowledge that this software is not designed, licensed or - * intended for use in the design, construction, operation or - * maintenance of any nuclear facility. - * - * $Revision$ - * $Date$ - * $State$ - */ - -/* - ************************************************************************ - * - * Java 3D configuration file for 4 screen projection configuration - * arranged in a 2x2 power wall. - * - ************************************************************************ - */ - -// Create new screen objects and associate them with logical names and numbers. -// These numbers are used as indices to retrieve the AWT GraphicsDevice from -// the array that GraphicsEnvironment.getScreenDevices() returns. -// -// NOTE: The GraphicsDevice order in the array is specific to the local -// site and display system. -// -(NewScreen topleft 0) -(NewScreen topright 1) -(NewScreen bottomleft 3) -(NewScreen bottomright 2) - -// Set the available image areas for full screens. This is important when -// precise scaling between objects in the virtual world and their projections -// into the physical world is desired through use of explicit ScreenScale view -// attributes. The defaults are 0.365 meters for width and 0.292 meters for -// height. -// -(ScreenAttribute topleft PhysicalScreenWidth 0.912) -(ScreenAttribute topleft PhysicalScreenHeight 0.680) - -(ScreenAttribute topright PhysicalScreenWidth 0.912) -(ScreenAttribute topright PhysicalScreenHeight 0.680) - -(ScreenAttribute bottomleft PhysicalScreenWidth 0.912) -(ScreenAttribute bottomleft PhysicalScreenHeight 0.685) - -(ScreenAttribute bottomright PhysicalScreenWidth 0.912) -(ScreenAttribute bottomright PhysicalScreenHeight 0.685) - - -// Specify full screen windows. -// -(ScreenAttribute topleft WindowSize NoBorderFullScreen) -(ScreenAttribute topright WindowSize NoBorderFullScreen) -(ScreenAttribute bottomleft WindowSize NoBorderFullScreen) -(ScreenAttribute bottomright WindowSize NoBorderFullScreen) - -// Set the TrackerBaseToImagePlate transforms for these screens. This -// transforms points in tracker base coordinates to each screen's image plate -// coordinates, where the origin of the image plate is defined to be the lower -// left corner of the screen with X increasing to the right, Y increasing to -// the top, and Z increasing away from the screen. -// -// Without head or sensor tracking the tracker base is still needed as a point -// of reference for describing the orientation and position of each screen to -// the others. The coexistence to tracker base transform is set to identity by -// default, so the tracker base origin and orientation will also set the origin -// and orientation of coexistence coordinates in the physical world. -// -// The tracker base and center of coexistence are set here to the center of the -// 2x2 array with its basis vectors aligned to image plate coordinates. -// -(ScreenAttribute topleft TrackerBaseToImagePlate - (Translate 0.912 0.000 0.0)) -(ScreenAttribute topright TrackerBaseToImagePlate - (Translate 0.000 0.000 0.0)) -(ScreenAttribute bottomleft TrackerBaseToImagePlate - (Translate 0.912 0.685 0.0)) -(ScreenAttribute bottomright TrackerBaseToImagePlate - (Translate 0.000 0.685 0.0)) - -// Create a view using the defined screens. -// -(NewView view0) -(ViewAttribute view0 Screen topleft) -(ViewAttribute view0 Screen topright) -(ViewAttribute view0 Screen bottomleft) -(ViewAttribute view0 Screen bottomright) - -// Set the screen scale. This is scale factor from virtual to physical -// coordinates. The default policy of SCALE_SCREEN_SIZE doesn't work well here -// since in the 2x2 arrangement the individual screens are too small. The -// explicit scale factor below assumes a normalized range of object coordinates -// of [-1.0 .. +1.0]. -// -(ViewAttribute view0 ScreenScalePolicy SCALE_EXPLICIT) -(ViewAttribute view0 ScreenScale 0.912) - -// Set the user eye position in the display environment. -// -(ViewAttribute view0 CenterEyeInCoexistence (0.0 0.0 1.0)) diff --git a/src/classes/org/jdesktop/j3d/examples/configured_universe/j3d2x2-flat.cfg b/src/classes/org/jdesktop/j3d/examples/configured_universe/j3d2x2-flat.cfg new file mode 100644 index 0000000..46df9a3 --- /dev/null +++ b/src/classes/org/jdesktop/j3d/examples/configured_universe/j3d2x2-flat.cfg @@ -0,0 +1,135 @@ +/* + * $RCSfile$ + * + * Copyright (c) 2006 Sun Microsystems, Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistribution of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistribution in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of Sun Microsystems, Inc. or the names of + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 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 MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL + * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF + * USING, MODIFYING OR DISTRIBUTING THIS 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 THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGES. + * + * You acknowledge that this software is not designed, licensed or + * intended for use in the design, construction, operation or + * maintenance of any nuclear facility. + * + * $Revision$ + * $Date$ + * $State$ + */ + +/* + ************************************************************************ + * + * Java 3D configuration file for 4 screen projection configuration + * arranged in a 2x2 power wall. + * + ************************************************************************ + */ + +// Create new screen objects and associate them with logical names and numbers. +// These numbers are used as indices to retrieve the AWT GraphicsDevice from +// the array that GraphicsEnvironment.getScreenDevices() returns. +// +// NOTE: The GraphicsDevice order in the array is specific to the local +// site and display system. +// +(NewScreen topleft 0) +(NewScreen topright 1) +(NewScreen bottomleft 3) +(NewScreen bottomright 2) + +// Set the available image areas for full screens. This is important when +// precise scaling between objects in the virtual world and their projections +// into the physical world is desired through use of explicit ScreenScale view +// attributes. The defaults are 0.365 meters for width and 0.292 meters for +// height. +// +(ScreenAttribute topleft PhysicalScreenWidth 0.912) +(ScreenAttribute topleft PhysicalScreenHeight 0.680) + +(ScreenAttribute topright PhysicalScreenWidth 0.912) +(ScreenAttribute topright PhysicalScreenHeight 0.680) + +(ScreenAttribute bottomleft PhysicalScreenWidth 0.912) +(ScreenAttribute bottomleft PhysicalScreenHeight 0.685) + +(ScreenAttribute bottomright PhysicalScreenWidth 0.912) +(ScreenAttribute bottomright PhysicalScreenHeight 0.685) + + +// Specify full screen windows. +// +(ScreenAttribute topleft WindowSize NoBorderFullScreen) +(ScreenAttribute topright WindowSize NoBorderFullScreen) +(ScreenAttribute bottomleft WindowSize NoBorderFullScreen) +(ScreenAttribute bottomright WindowSize NoBorderFullScreen) + +// Set the TrackerBaseToImagePlate transforms for these screens. This +// transforms points in tracker base coordinates to each screen's image plate +// coordinates, where the origin of the image plate is defined to be the lower +// left corner of the screen with X increasing to the right, Y increasing to +// the top, and Z increasing away from the screen. +// +// Without head or sensor tracking the tracker base is still needed as a point +// of reference for describing the orientation and position of each screen to +// the others. The coexistence to tracker base transform is set to identity by +// default, so the tracker base origin and orientation will also set the origin +// and orientation of coexistence coordinates in the physical world. +// +// The tracker base and center of coexistence are set here to the center of the +// 2x2 array with its basis vectors aligned to image plate coordinates. +// +(ScreenAttribute topleft TrackerBaseToImagePlate + (Translate 0.912 0.000 0.0)) +(ScreenAttribute topright TrackerBaseToImagePlate + (Translate 0.000 0.000 0.0)) +(ScreenAttribute bottomleft TrackerBaseToImagePlate + (Translate 0.912 0.685 0.0)) +(ScreenAttribute bottomright TrackerBaseToImagePlate + (Translate 0.000 0.685 0.0)) + +// Create a view using the defined screens. +// +(NewView view0) +(ViewAttribute view0 Screen topleft) +(ViewAttribute view0 Screen topright) +(ViewAttribute view0 Screen bottomleft) +(ViewAttribute view0 Screen bottomright) + +// Set the screen scale. This is scale factor from virtual to physical +// coordinates. The default policy of SCALE_SCREEN_SIZE doesn't work well here +// since in the 2x2 arrangement the individual screens are too small. The +// explicit scale factor below assumes a normalized range of object coordinates +// of [-1.0 .. +1.0]. +// +(ViewAttribute view0 ScreenScalePolicy SCALE_EXPLICIT) +(ViewAttribute view0 ScreenScale 0.912) + +// Set the user eye position in the display environment. +// +(ViewAttribute view0 CenterEyeInCoexistence (0.0 0.0 1.0)) -- cgit v1.2.3