diff options
author | kcr <kcr@28c7f869-5b4e-e670-f602-82bfaf57f300> | 2004-06-09 03:28:13 +0000 |
---|---|---|
committer | kcr <kcr@28c7f869-5b4e-e670-f602-82bfaf57f300> | 2004-06-09 03:28:13 +0000 |
commit | 53ebfcc5ad5554b67d2287f8b02c22ec8405af0f (patch) | |
tree | 70c8fabf4cbef5a9d2a50735c4e502d56ce156da /src/ConfiguredUniverse | |
parent | 4dead457a59220406dd9fcd40997d7a7b27571b0 (diff) |
Initial creation of j3d-examples sources in CVS repository
Diffstat (limited to 'src/ConfiguredUniverse')
-rw-r--r-- | src/ConfiguredUniverse/ConfigObjLoad.java | 309 | ||||
-rw-r--r-- | src/ConfiguredUniverse/README.txt | 137 | ||||
-rw-r--r-- | src/ConfiguredUniverse/build.xml | 66 | ||||
-rw-r--r-- | src/ConfiguredUniverse/j3d1x1 | 93 | ||||
-rw-r--r-- | src/ConfiguredUniverse/j3d1x1-behavior | 144 | ||||
-rw-r--r-- | src/ConfiguredUniverse/j3d1x1-stereo | 108 | ||||
-rw-r--r-- | src/ConfiguredUniverse/j3d1x1-vr | 207 | ||||
-rw-r--r-- | src/ConfiguredUniverse/j3d1x1-window | 84 | ||||
-rw-r--r-- | src/ConfiguredUniverse/j3d1x2-flat | 129 | ||||
-rw-r--r-- | src/ConfiguredUniverse/j3d1x2-rot30 | 94 | ||||
-rw-r--r-- | src/ConfiguredUniverse/j3d1x3-cave | 166 | ||||
-rw-r--r-- | src/ConfiguredUniverse/j3d1x3-cave-vr | 217 | ||||
-rw-r--r-- | src/ConfiguredUniverse/j3d1x3-rot45 | 105 | ||||
-rw-r--r-- | src/ConfiguredUniverse/j3d2x2-flat | 130 |
14 files changed, 1989 insertions, 0 deletions
diff --git a/src/ConfiguredUniverse/ConfigObjLoad.java b/src/ConfiguredUniverse/ConfigObjLoad.java new file mode 100644 index 0000000..9568957 --- /dev/null +++ b/src/ConfiguredUniverse/ConfigObjLoad.java @@ -0,0 +1,309 @@ +/* + * $RCSfile$ + * + * Copyright (c) 2004 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$ + */ + +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.*; +import java.io.*; +import com.sun.j3d.utils.behaviors.vp.*; +import com.sun.j3d.utils.behaviors.sensor.Mouse6DPointerBehavior; +import java.net.URL; +import java.net.MalformedURLException; +import java.util.Map; + +public class ConfigObjLoad { + + private boolean spin = false; + private boolean noTriangulate = false; + private boolean noStripify = false; + private double creaseAngle = 60.0; + private URL filename = null; + + private ConfiguredUniverse u; + + public BranchGroup createSceneGraph() { + // Create the root of the branch graph + BranchGroup objRoot = new BranchGroup(); + + // Create a Transformgroup to scale all objects so they + // appear in the scene. + TransformGroup objScale = new TransformGroup(); + Transform3D t3d = new Transform3D(); + t3d.setScale(0.7); + objScale.setTransform(t3d); + objRoot.addChild(objScale); + + // Create the transform group node and initialize it to the + // identity. Enable the TRANSFORM_WRITE capability so that + // our behavior code can modify it at runtime. Add it to the + // root of the subgraph. + TransformGroup objTrans = new TransformGroup(); + objTrans.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); + objTrans.setCapability(TransformGroup.ALLOW_TRANSFORM_READ); + objScale.addChild(objTrans); + + int flags = ObjectFile.RESIZE; + if (!noTriangulate) flags |= ObjectFile.TRIANGULATE; + if (!noStripify) flags |= ObjectFile.STRIPIFY; + ObjectFile f = new ObjectFile(flags, + (float)(creaseAngle * Math.PI / 180.0)); + Scene s = null; + try { + s = f.load(filename); + } + catch (FileNotFoundException e) { + System.err.println(e); + System.exit(1); + } + catch (ParsingErrorException e) { + System.err.println(e); + System.exit(1); + } + catch (IncorrectFormatException e) { + System.err.println(e); + System.exit(1); + } + + objTrans.addChild(s.getSceneGroup()); + + BoundingSphere bounds = + new BoundingSphere(new Point3d(0.0,0.0,0.0), 100.0); + + if (spin) { + Transform3D yAxis = new Transform3D(); + Alpha rotationAlpha = new Alpha(-1, Alpha.INCREASING_ENABLE, + 0, 0, + 4000, 0, 0, + 0, 0, 0); + + RotationInterpolator rotator = + new RotationInterpolator(rotationAlpha, objTrans, yAxis, + 0.0f, (float) Math.PI*2.0f); + rotator.setSchedulingBounds(bounds); + objTrans.addChild(rotator); + } + + // Set up the background + Color3f bgColor = new Color3f(0.05f, 0.05f, 0.5f); + Background bgNode = new Background(bgColor); + bgNode.setApplicationBounds(bounds); + objRoot.addChild(bgNode); + + // Set up the ambient light + Color3f ambientColor = new Color3f(0.1f, 0.1f, 0.1f); + AmbientLight ambientLightNode = new AmbientLight(ambientColor); + ambientLightNode.setInfluencingBounds(bounds); + objRoot.addChild(ambientLightNode); + + // Set up the directional lights + Color3f light1Color = new Color3f(1.0f, 1.0f, 0.9f); + Vector3f light1Direction = new Vector3f(1.0f, 1.0f, 1.0f); + Color3f light2Color = new Color3f(1.0f, 1.0f, 1.0f); + Vector3f light2Direction = new Vector3f(-1.0f, -1.0f, -1.0f); + + DirectionalLight light1 + = new DirectionalLight(light1Color, light1Direction); + light1.setInfluencingBounds(bounds); + objRoot.addChild(light1); + + DirectionalLight light2 + = new DirectionalLight(light2Color, light2Direction); + light2.setInfluencingBounds(bounds); + objRoot.addChild(light2); + + return objRoot; + } + + private void usage() + { + System.out.println( + "Usage: java ObjLoad [-s] [-n] [-t] [-c degrees] <.obj file>"); + System.out.println(" -s Spin (no user interaction)"); + System.out.println(" -n No triangulation"); + System.out.println(" -t No stripification"); + System.out.println( + " -c Set crease angle for normal generation (default is 60 without"); + System.out.println( + " smoothing group info, otherwise 180 within smoothing groups)"); + System.exit(0); + } // End of usage + + + public void init() { + if (filename == null) { + try { + filename = new URL("file:../geometry/galleon.obj"); + } + 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"); + + // Create a simple scene and attach it to the virtual universe + BranchGroup scene = createSceneGraph(); + u = new ConfiguredUniverse(configURL); + + // Get the ViewingPlatform. + ViewingPlatform viewingPlatform = u.getViewingPlatform(); + + // This will move the ViewPlatform back a bit so the objects in the + // scene can be viewed. This will only have an effect if the config + // file sets the window eyepoint policy to something other than + // RELATIVE_TO_COEXISTENCE, which is the default eyepoint policy + // applied by ConfiguredUniverse. + // + // The default view attach policy for ConfiguredUniverse applications + // is NOMINAL_SCREEN. This sets the view platform origin in the + // physical world to the center of coexistence, which allows eye + // positions expressed relative to coexistence to see the appropriate + // field of view automatically. + viewingPlatform.setNominalViewingTransform(); + + // Add a ViewPlatformBehavior if not specified in the config file. + if (!spin && viewingPlatform.getViewPlatformBehavior() == null) { + OrbitBehavior orbit = new OrbitBehavior(u.getCanvas(), + OrbitBehavior.REVERSE_ALL); + BoundingSphere bounds = + new BoundingSphere(new Point3d(0.0, 0.0, 0.0), 100.0); + + orbit.setSchedulingBounds(bounds); + viewingPlatform.setViewPlatformBehavior(orbit); + } + + // See if there's a 6 degree of freedom mouse in the environment. + // We look for one named "mouse6d". + Map sensorMap = null; + sensorMap = u.getNamedSensors(); + if (sensorMap != null) { + Sensor mouse6d = (Sensor)sensorMap.get("mouse6d"); + if (mouse6d != null) { + Mouse6DPointerBehavior behavior = + new Mouse6DPointerBehavior(mouse6d, 1.0, true); + + BoundingSphere bounds = + new BoundingSphere(new Point3d(0.0,0.0,0.0), 100.0); + behavior.setSchedulingBounds(bounds); + + scene.addChild(behavior); + scene.addChild(behavior.getEcho()); + } + } + + // Listen for a typed "q", "Q", or "Escape" key on each canvas to + // allow a convenient exit from full screen configurations. + Canvas3D[] canvases; + canvases = u.getViewer().getCanvas3Ds(); + + class QuitListener extends KeyAdapter { + public void keyTyped(KeyEvent e) { + char c = e.getKeyChar(); + if (c == 'q' || c == 'Q' || c == 27) + System.exit(0); + } + } + + QuitListener quitListener = new QuitListener(); + for (int i = 0; i < canvases.length; i++) + canvases[i].addKeyListener(quitListener); + + // Make the scenegraph live. + u.addBranchGraph(scene); + } + + public ConfigObjLoad(String[] args) { + if (args.length != 0) { + for (int i = 0; i < args.length; i++) { + if (args[i].startsWith("-")) { + if (args[i].equals("-s")) { + spin = true; + } else if (args[i].equals("-n")) { + noTriangulate = true; + } else if (args[i].equals("-t")) { + noStripify = true; + } else if (args[i].equals("-c")) { + if (i < args.length - 1) { + creaseAngle = (new Double(args[++i])).doubleValue(); + } else usage(); + } else { + usage(); + } + } else { + try { + if ((args[i].indexOf("file:") == 0) || + (args[i].indexOf("http") == 0)) { + filename = new URL(args[i]); + } + else if (args[i].charAt(0) != '/') { + filename = new URL("file:./" + args[i]); + } + else { + filename = new URL("file:" + args[i]); + } + } + catch (MalformedURLException e) { + System.err.println(e); + System.exit(1); + } + } + } + } + init(); + } + + public static void main(String[] args) { + new ConfigObjLoad(args); + } +} diff --git a/src/ConfiguredUniverse/README.txt b/src/ConfiguredUniverse/README.txt new file mode 100644 index 0000000..14263c6 --- /dev/null +++ b/src/ConfiguredUniverse/README.txt @@ -0,0 +1,137 @@ +/* + * @(#)README.txt 1.1 01/10/19 20:44:35 + * + * Copyright (c) 1996-2001 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: + * + * - Redistributions 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 AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES + * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR + * DISTRIBUTING THE SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN + * OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR + * FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR + * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF + * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE SOFTWARE, + * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + * + * You acknowledge that Software is not designed,licensed or intended + * for use in the design, construction, operation or maintenance of + * any nuclear facility. + */ + +This directory contains a simple example application that demonstrates the +ConfiguredUniverse utility class available in the com.sun.j3d.utils.universe +package. J3DFly, available separately, is a fully featured application that +also uses ConfiguredUniverse. + +ConfiguredUniverse is an extension of SimpleUniverse that can set up an +interactive viewing environment based upon the contents of a site-specific +configuration file. This is useful when an application needs to run without +change across a broad range of viewing configurations and locally available +input and audio devices. InputDevice implementations can be instantiated by +ConfiguredUniverse and their Sensors can be retrieved by applications along +with the names bound to them in the configuration file. + +Supported viewing configurations include windows on conventional desktops, +stereo-enabled views, fullscreen immersive displays on single or multiple +screens, and virtual reality installations such as cave and head-mounted +displays incorporating 6-degree-of-freedom sensor devices. + +The ConfigObjLoad application is a modified version of the ObjLoad example +program which uses the ConfiguredUniverse utility instead of SimpleUniverse. +It also differs in the following other respects: + + It is an application and cannot be run in a browser. ConfiguredUniverse + creates a JFrame, JPanel, and Canvas3D itself for each screen and is + oriented towards multiple fullscreen viewing environments, although + conventional windowed displays are also supported. The components + created are easily accessable so applications can still incorporate them + 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 + in this directory. + + Alternative custom view platform behaviors other than OrbitBehavior can + be used by specifying the behavior in the configuration file. + + It can retrieve a 6DOF Sensor specified in the configuration file and + use it to demonstrate the Mouse6DPointerBehavior class. + + Typing a "q" or the Escape key will terminate the example program. This + is useful for fullscreen configurations. + +To load a specific configuration file, set the j3d.configURL property on the +command line: + + java -Dj3d.configURL=<URL string> ConfigObjLoad <args> <obj file> + +For example, to load j3d1x2-rot30 in the current directory, run + + java -Dj3d.configURL=file:j3d1x2-rot30 ConfigObjLoad <args> <obj file> + +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-behavior: single fullscreen desktop configuration with a + configurable view platform behavior. + + j3d1x1-stereo: single fullscreen desktop configuration with stereo + viewing. + + j3d1x1-vr: single fullscreen desktop configuration with stereo viewing, + head tracker, and 6DOF mouse. + + j3d1x1-window: single screen windowed desktop configuration. + + j3d1x2-flat: dual-screen flat desktop configuration. + + j3d1x2-rot30: 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, + and right of the user. + + j3d1x3-cave-vr: 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 + angled by 45 degrees from the center screen. + + j3d2x2-flat: 4-screen projector configuration arranged in a 2x2 power + wall. + +Note: JDK 1.4 or newer is required when configuring multiple screens if the +X11 Xinerama extension is being used to create a single virtual screen. +This is due to a limitation of the getScreenDevices() method in the JDK 1.3 +version of GraphicsConfiguration which returns only a single GraphicsDevice +from a virtual screen. ConfiguredUniverse will report this condition as an +error in specifying more screens than are available. + +Also: Graphics performance may be degraded in some environments when using a +virtual screen device. See the description of the j3d.disableXinerama +property for possible performance improvements when using Xinerama. + diff --git a/src/ConfiguredUniverse/build.xml b/src/ConfiguredUniverse/build.xml new file mode 100644 index 0000000..cbf53a8 --- /dev/null +++ b/src/ConfiguredUniverse/build.xml @@ -0,0 +1,66 @@ +<?xml version="1.0"?> + +<!-- +/* + * $RCSfile$ + * + * Copyright (c) 2004 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$ + */ + --> + +<project basedir="." default="compile"> + <target name="compile"> + <javac debug="true" deprecation="true" destdir="." srcdir="."> + </javac> + </target> + + <target name="all" depends="compile"> + </target> + + <target description="Clean all build products." name="clean"> + <delete> + <fileset dir="."> + <include name="**/*.class"/> + </fileset> + </delete> + </target> + +</project> diff --git a/src/ConfiguredUniverse/j3d1x1 b/src/ConfiguredUniverse/j3d1x1 new file mode 100644 index 0000000..a491e66 --- /dev/null +++ b/src/ConfiguredUniverse/j3d1x1 @@ -0,0 +1,93 @@ +/* + * @(#)j3d1x1 1.2 01/10/29 15:28:11 + * + * Copyright (c) 1996-2001 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: + * + * - Redistributions 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 AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES + * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR + * DISTRIBUTING THE SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN + * OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR + * FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR + * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF + * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE SOFTWARE, + * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + * + * You acknowledge that Software is not designed,licensed or intended + * for use in the design, construction, operation or maintenance of + * any nuclear facility. + */ + +/* + ************************************************************************ + * + * 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/ConfiguredUniverse/j3d1x1-behavior b/src/ConfiguredUniverse/j3d1x1-behavior new file mode 100644 index 0000000..403b221 --- /dev/null +++ b/src/ConfiguredUniverse/j3d1x1-behavior @@ -0,0 +1,144 @@ +/* + * @(#)j3d1x1-behavior 1.2 01/10/29 15:32:55 + * + * Copyright (c) 1996-2001 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: + * + * - Redistributions 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 AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES + * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR + * DISTRIBUTING THE SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN + * OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR + * FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR + * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF + * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE SOFTWARE, + * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + * + * You acknowledge that Software is not designed,licensed or intended + * for use in the design, construction, operation or maintenance of + * any nuclear facility. + */ + +/* + ************************************************************************ + * + * 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/ConfiguredUniverse/j3d1x1-stereo b/src/ConfiguredUniverse/j3d1x1-stereo new file mode 100644 index 0000000..1adde3b --- /dev/null +++ b/src/ConfiguredUniverse/j3d1x1-stereo @@ -0,0 +1,108 @@ +/* + * @(#)j3d1x1-stereo 1.2 01/10/29 15:40:14 + * + * Copyright (c) 1996-2001 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: + * + * - Redistributions 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 AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES + * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR + * DISTRIBUTING THE SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN + * OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR + * FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR + * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF + * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE SOFTWARE, + * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + * + * You acknowledge that Software is not designed,licensed or intended + * for use in the design, construction, operation or maintenance of + * any nuclear facility. + */ + +/* + ************************************************************************ + * + * 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/ConfiguredUniverse/j3d1x1-vr b/src/ConfiguredUniverse/j3d1x1-vr new file mode 100644 index 0000000..aded1f3 --- /dev/null +++ b/src/ConfiguredUniverse/j3d1x1-vr @@ -0,0 +1,207 @@ +/* + * @(#)j3d1x1-vr 1.2 01/10/29 15:41:30 + * + * Copyright (c) 1996-2001 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: + * + * - Redistributions 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 AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES + * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR + * DISTRIBUTING THE SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN + * OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR + * FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR + * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF + * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE SOFTWARE, + * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + * + * You acknowledge that Software is not designed,licensed or intended + * for use in the design, construction, operation or maintenance of + * any nuclear facility. + */ + +/* + ************************************************************************ + * + * 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/ConfiguredUniverse/j3d1x1-window b/src/ConfiguredUniverse/j3d1x1-window new file mode 100644 index 0000000..5b3484b --- /dev/null +++ b/src/ConfiguredUniverse/j3d1x1-window @@ -0,0 +1,84 @@ +/* + * @(#)j3d1x1-window 1.2 01/10/29 15:26:11 + * + * Copyright (c) 1996-2001 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: + * + * - Redistributions 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 AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES + * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR + * DISTRIBUTING THE SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN + * OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR + * FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR + * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF + * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE SOFTWARE, + * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + * + * You acknowledge that Software is not designed,licensed or intended + * for use in the design, construction, operation or maintenance of + * any nuclear facility. + */ + +/* + ************************************************************************ + * + * 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/ConfiguredUniverse/j3d1x2-flat b/src/ConfiguredUniverse/j3d1x2-flat new file mode 100644 index 0000000..85a0767 --- /dev/null +++ b/src/ConfiguredUniverse/j3d1x2-flat @@ -0,0 +1,129 @@ +/* + * @(#)j3d1x2-flat 1.2 01/10/29 15:44:19 + * + * Copyright (c) 1996-2001 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: + * + * - Redistributions 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 AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES + * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR + * DISTRIBUTING THE SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN + * OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR + * FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR + * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF + * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE SOFTWARE, + * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + * + * You acknowledge that Software is not designed,licensed or intended + * for use in the design, construction, operation or maintenance of + * any nuclear facility. + */ + +/* + ************************************************************************ + * + * 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/ConfiguredUniverse/j3d1x2-rot30 b/src/ConfiguredUniverse/j3d1x2-rot30 new file mode 100644 index 0000000..8ab4436 --- /dev/null +++ b/src/ConfiguredUniverse/j3d1x2-rot30 @@ -0,0 +1,94 @@ +/* + * @(#)j3d1x2-rot30 1.1 01/10/19 20:24:29 + * + * Copyright (c) 1996-2001 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: + * + * - Redistributions 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 AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES + * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR + * DISTRIBUTING THE SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN + * OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR + * FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR + * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF + * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE SOFTWARE, + * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + * + * You acknowledge that Software is not designed,licensed or intended + * for use in the design, construction, operation or maintenance of + * any nuclear facility. + */ + +/* + ************************************************************************ + * + * 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/ConfiguredUniverse/j3d1x3-cave b/src/ConfiguredUniverse/j3d1x3-cave new file mode 100644 index 0000000..d9a1472 --- /dev/null +++ b/src/ConfiguredUniverse/j3d1x3-cave @@ -0,0 +1,166 @@ +/* + * @(#)j3d1x3-cave 1.3 01/10/29 18:35:26 + * + * Copyright (c) 1996-2001 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: + * + * - Redistributions 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 AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES + * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR + * DISTRIBUTING THE SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN + * OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR + * FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR + * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF + * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE SOFTWARE, + * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + * + * You acknowledge that Software is not designed,licensed or intended + * for use in the design, construction, operation or maintenance of + * any nuclear facility. + */ + +/* + ************************************************************************ + * + * 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/ConfiguredUniverse/j3d1x3-cave-vr b/src/ConfiguredUniverse/j3d1x3-cave-vr new file mode 100644 index 0000000..cd892a0 --- /dev/null +++ b/src/ConfiguredUniverse/j3d1x3-cave-vr @@ -0,0 +1,217 @@ +/* + * @(#)j3d1x3-cave-vr 1.3 01/10/29 18:34:16 + * + * Copyright (c) 1996-2001 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: + * + * - Redistributions 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 AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES + * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR + * DISTRIBUTING THE SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN + * OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR + * FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR + * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF + * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE SOFTWARE, + * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + * + * You acknowledge that Software is not designed,licensed or intended + * for use in the design, construction, operation or maintenance of + * any nuclear facility. + */ + +/* + ************************************************************************ + * + * 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/ConfiguredUniverse/j3d1x3-rot45 b/src/ConfiguredUniverse/j3d1x3-rot45 new file mode 100644 index 0000000..de44c81 --- /dev/null +++ b/src/ConfiguredUniverse/j3d1x3-rot45 @@ -0,0 +1,105 @@ +/* + * @(#)j3d1x3-rot45 1.1 01/10/19 20:24:38 + * + * Copyright (c) 1996-2001 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: + * + * - Redistributions 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 AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES + * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR + * DISTRIBUTING THE SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN + * OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR + * FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR + * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF + * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE SOFTWARE, + * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + * + * You acknowledge that Software is not designed,licensed or intended + * for use in the design, construction, operation or maintenance of + * any nuclear facility. + */ + +/* + ************************************************************************ + * + * 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/ConfiguredUniverse/j3d2x2-flat b/src/ConfiguredUniverse/j3d2x2-flat new file mode 100644 index 0000000..b5bc83f --- /dev/null +++ b/src/ConfiguredUniverse/j3d2x2-flat @@ -0,0 +1,130 @@ +/* + * @(#)j3d2x2-flat 1.2 01/10/29 15:47:10 + * + * Copyright (c) 1996-2001 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: + * + * - Redistributions 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 AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES + * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR + * DISTRIBUTING THE SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN + * OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR + * FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR + * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF + * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE SOFTWARE, + * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + * + * You acknowledge that Software is not designed,licensed or intended + * for use in the design, construction, operation or maintenance of + * any nuclear facility. + */ + +/* + ************************************************************************ + * + * 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)) |