Information of Java3D

Hi!
I'm interesting in get information about Java3D. I've got the tutorials of Sun, but I'm searching for something more, especially in geometries and appearances. Please if you know any web page or good document about Java3D, please let me know.
Luismahou

Have you tried http://www.j3d.org ?
A general book on 3d computer graphics will also help to understand the concepts.

Similar Messages

  • Issue Downloading Resources with Java Web Start

    I'm having an issue with Java Web Start downloading resources. After executing the JNLP file, the download will start and the main Jar will download, then the download will just stop. The downloader is still running, but the progress bar just sits and nothing happens. This only will happen on some machines, even ones on the same network. Others download fine, and the application starts correctly. I thought maybe a setting with java web start needed to be changed, but the proxy settings are set to the browser, which are the same for all machines. The JNLP file is below (however, for security reasons the codebase/homepage are left out, but they are correct in the actual file). Does anyone have any idea of what the problem might be?
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
         <jnlp codebase="..." spec="1.0+">
         <information>
         <title>Java3D Test</title>
              <vendor>None</vendor>
              <homepage href="..." />
              <description>Test application for Java3D</description>
         </information>
         <update check="always" />
    <security>
         <all-permissions/>
    </security>
    <resources>
              <j2se version="1.5+"/>
         <jar eager="true" href="TestJava3D.jar" main="true" />
              <jar href="lib/Library.jar" />
              <jar href="lib/Java3D.jar" />
              <jar href="lib/j3dnative.jar" />
         </resources>
    <application-desc main-class="testjava3d.TestJava3DMain">
    </application-desc>
    </jnlp>

    You could enable JavaConsole and turn on tracing to get more debugging info. See: http://docs.oracle.com/javase/7/docs/webnotes/tsg/TSG-Desktop/html/plugin.html#gcexdf

  • Discontinued?

    I would like to know if the Java 3D technologie was discontinnued. I never seen an version update for it.

    I would keep up this thread because i'm searching for informations about the future of Java3D wich i consider one of the best "3D language" (or structure for a 3D environment) ever made.
    I spent some time learning about various kind of bindings such as jogl or gl4java (i wonder how much is worth Java as a procedural-like language because this is what bindigns seems to make to Java) and i have some basic knowledge about C++ & OpenGL but in fact no one of this can be compared with the structure of Java3D.
    I think that the simplicity of the structure can be easily show if you try to make a Java3D-translation of any C-OpenGL sample that can be found on internet (obviously keeping in mind that is just OpenGL 1.2 compliant).
    Anyone knows were to take officials informations about Java3D future? I heard lots of rumors about his death, but nothing coming out from sun!
    Greetings.

  • JAVA3D versions and runtime errors

    hi, everybody:
    I just begin to program in java3d today and met some problems.Now I share you with my solution(s) and wish every author can end his question with the final solution in the forum.
    OS: Windows XP
    J2SDK: 1.4.1_02,1.4.2._01
    DirectX: 9.0 update
    Java3D: 1.3.1
    Error: Fail to Create Vertex Buffer---D3DERR_INVALIDCALL
    Solution: uninstall java3D1.3.1, install java3D1.2.1_04
    wellcome to add more information to this topic.

    A better solution might be to switch to the OpenGL version
    of Java 3D.
    -Paul

  • General Java3D Art question

    Hello everyone, was hoping that someone could point me in the direction of any documentation that might exist for guidelines on building 3d models and graphics for Java3D. Ideally, it would include information about what features are supported, and how settings, on shaders or lighting for example, translate to java3d.
    If something like this doesn't exist, I'd consider making one, so any art related documentation that anyone could point me in the direction of, would also be helpful.
    Thanks in advance for any assistance... Also, I'm new to the forums, so if anyone has a suggestion on a forum this topic might be more relevant to, feel free to offer it. Thanks again.
    - 3DCaveman
    "I'm just a caveman, I don't understand your modern, high tech world" - Unfrozen Caveman Lawyer

    Sorry, I think I probably didn't clearly explain what I'm looking for, I'm already a fluent user of 3d studio MAX, with numerous years of professional experience in realtime engines...
    What I'm looking for is what features out of max are supported, and what features translate over to Java3d... For example, the specular settings of a shader on a model carries over it's color from MAX, which is something that I'm not accustomed to in the other engines I've used, so wondering if there is any documentation on this topic, are multi sub object materials supported? is userdata? keyframe animation,? mesh-deformation? bones animation and character studio? Which map channels are exported? can it do reflections? refractions? etc etc... Just wondering if any documentation on this topic exists, either official, or made by users, it's definitely helpful to have as reference when working with any engine.
    Any ideas if something like this is out there somewhere or not?

  • Urgent question..how to display 2D image/text on Canvas(Java3D)?

    I am developing a first-person action game and want to add a box which show the value(eg,what weapon you are carrying,any value) on the canvas like CS,but I dont know how to set it up.I want to know how to create it?

    Hey,
    I'm new to java3d, but I'm pretty sure that you can draw 2D strings/images on top of a Canvas3D. Just make a custom Canvas3D class, then in that class implement postRender(), and in there you can do all your 2D displaying.
    For example, this is what I did to display some information and graphics above the Canvas3D in my program:
    public class CustomCanvas3D extends Canvas3D
    public CustomCanvas3D(GraphicsConfiguration gcIn)
    super(gcIn);
    public void postRender()
    J3DGraphics2D g = getGraphics2D();
    Image crosshair = this.getToolkit().createImage("crosshair.png");
    MediaTracker mt = new MediaTracker(this);
    mt.addImage(crosshair, 0);
    try
    mt.waitForAll();
    catch (InterruptedException e)
    e.printStackTrace(System.out);
    g.drawImage(crosshair, 200, 200, this);
    g.setColor(Color.orange);
    g.drawString(player.getVitalInformation(), 100, 100);
    g.flush(true);
    Hope that helped,
    James Attenborough

  • Java3D viability questions...

    Greetings,
    I've been looking around for a Java library that would be useful for rendering and manipulating 3d scenegraph data and objects from within a larger application framework. LWJGL and JOGL both utilize low level access via OpenGL or DirectX mostly as a thin wrapper over the c code. I was hoping for something a little more high level and so... here I am.
    I am wondering though... how much life is left in the Java3D project? I'm digging around and I find most of the information and resources scattered about on the 4 winds with nothing that looks like a concrete development project going on. I see where it's mentioned that Java3D has become a community project, but is there any active participation going forward on the development side? Is Java3D a dead project with folks just scavenging up the pieces and utilizing them as best they can?
    I'm hoping that I can figure out how to usefully manipulate 3d artifacts from within a GUI built on Swing or SWT if I must, not from a single game window with limited GUI elements and I'm wondering if this package will get me there? So, would some kind forum members here take the trouble to enlighten me?
    Thanks,
    Mark

    Hi,
    the latest release is Java 3D 1.5.2 and it was published in 2008. It is most unlikely that the owner Oracle.Sun will restart its development or provide a maintenance release. Also, it is unlikely that someone else will continue the development of this concrete implementation.
    Java 3D is a matured API. It is very well specified and nearly perfect described in its javadocs. Helpful books are available even if they don't cover the latest release. Since 1.4 the implemented OpenGL shading language (GLSL) allows to run vertex and fragment shader on the current release GLSL 4.1 and beyond. Java 3D's lightweight and heavyweight 3D rendering capabilities make it 'easy' to integrate and interact with 3D content in applications based on the GUI frameworks JavaFX 1.3.x, Pivot, Java Swing, Scala Swing, and SWT.
    Compare Java 3D 1.5.2 to the currently available releases of following alternatives: Ardor3D, Aviatrix3D, jMonkeyEngine, and Xith3D.
    I'm not aware of any detailed and impartial comparison. You will find blog or forum entries where the authors defend their preferred API and attack all the other ones.
    Your requirements 'manipulate 3d artifacts from within a GUI' are a bit vague. So, it's up to you to compare capabilities and to find out which one you can trust more concerning long term development and maintenance. Also check their dependencies on third party/communitiy low level 3D APIs.
    Here are some helpful Java 3D 1.5.2 links:
    - home : https://java3d.dev.java.net/
    - downloads : https://java3d.dev.java.net/binary-builds.html
    - tutorial : http://java.sun.com/developer/onlineTraining/java3d/
    - books : http://wiki.java.net/bin/view/Javadesktop/Java3DBooks
    - J3DWorkbench : http://eclectic3d.net/
    - SweetHome3D : http://www.sweethome3d.com/index.jsp
    - GUI - Java 3D meets .. : http://www.interactivemesh.org/testspace.html
    Knowledge, experiences, concepts and 3D data do not really get lost when you switch to another high level 3D Java API at a later date.
    I decided to stay with Java 3D and to provide up-to-date GUI integration and importer (X3D; in work: 3DS, COLLADA, OBJ) APIs. At the same time I'm continuing my own Java 3D fork/successor JUniversal3D.
    August, InteractiveMesh

  • How to install Java3d into netbeans 6.5

    I recently downloaded the Java 3D file : j3d-1_5_2-xxxxxx but I don't really know how to "install" it. I looked and found a thing on how to insall it on netbeans but the place they are telling me to go to doesn't exist. I am using netbeans 6.5 and supposedly you are supposed to install the J3D.nbm or something into netbeans but i can't find that inside of my downloaded folder. Is there something I did wrong i.e. downloaded the wrong thing, are looking in the wrong place, are missing somthing please tell me.
    Thanks
    Thimbletack

    Just posting an update. I found that a place that says you need to go here to download the module for netbeans to install it:
    http://java3d.netbeans.org/
    but that doesn't reallys show how to install java 3d or anything, it doesn't even have a download button for the module. I got that information here:
    http://java3d.j3d.org/faq/editors.html
    but i really just don't know how to install this thing. Can anyone help?

  • Raytracing a Java3D scene's View

    Hi,
    I have a simple Java3D modelling app, which I am trying to hook up a basic Raytracer to.
    Scene Graph looks something like the following:
                     VirtualUniverse, etc
                              |
                           Locale
                              |
        ContentBranchGroup         ViewsBranchGroup
                |                          |
               ...                 TransformGroup [*]
                                           |
                                     ViewPlatform  -  ViewI have a simple mouse pan behaviour, a mouse zoom behaviour, and a mouse orbit behaviour that all modify the Transform Group marked with a [*] above, thereby changing the "camera" by which the user looks at the scene. The behaviours work very well.
    I am trying to hook the raytracer up to "look" through this camera. (I have all the other raytracer stuff working)
    The raytracer requires the following:
    - The camera eye position
    - The camera target (look at) position
    - The camera up vector
    I am trying to extract this information from the [*] marked TransformGroup's Transform3D object but it is very difficult. I can get the eye position using the transform3D.get(Vector3d) method.
    I have tried so many ways to get the target and up vectors. I know the principles to get them but the Transform3D get() methods are to say the least, a nightmare, for me to work with. CAN ANYBODY HELP ME?
    If it helps I have managed to get the Euler angles for the camera rotation (converting the rotation Quaternion)...
    What next? Please...!
    Thanks in advance

    Yes, I understand what you are trying to do. Essentially, what it requires is that you do some linear algebra from the position and orientation of the camera object. So, you can get the following:
    Camera position:
    the actual point location of the camera in the virtual world:
    viewTransform3D.get( Vector3f position );
    Camera "look at" position:
    I assume you don't actually need the point on the X-Y plane (or at least, you shouldn't), but a point along the path in which the camera points (we call the VPN, or view-plane normal). So, in essence, when you take the "look at point" and subtract the "camera position point", you get a vector in 3d space which tells you the direction the camera is pointing. Whichever one you need, you will have to calculate that. More on this in a moment.
    Camera "up vector":
    This is another one you will have to calculate based on the location of the camera and its current orientation. This one again is a vector based on the original "up" location (also called VUP). More on this one right now...
    A good way to resolve this issue is to calculate these vectors based on two points at the beginning of your application, and use them to calcuate the camera's focus point (via VPN) and the camera's up vector. Its pretty simple and easy to implement. Basically, when you set up your camera (view platform), you set the camera position to some default location. When you set this default location, create 2 points which represent the end of the up vector and the end of the VPN, respectively. Then, whenever the transform group which contains the camera's transform is manipulated, simply take that Transform3D and use its matrix to modify the locations of your two initial points, thus giving you the end of the up vector and the end of the vpn transformed by the same transform used to rotate the camera. Then simply subract the camera's location point from each of these and you have the up vector and the vpn, ready for your ray tracer.
    I've included some sample code to show you what I'm talking about. Check out the canvas' mouse listener to find the calculations for the VUP and VPN. It sounds like your implementation requires a look at Point3d, so what you could do is just take the camera's location and add some multiple of the VPN to get a look at point.
    Anyway, here's the code...
    import com.sun.j3d.utils.behaviors.vp.OrbitBehavior;
    import com.sun.j3d.utils.geometry.ColorCube;
    import com.sun.j3d.utils.universe.SimpleUniverse;
    import java.awt.Dimension;
    import java.awt.GraphicsConfiguration;
    import java.awt.GraphicsDevice;
    import java.awt.GraphicsEnvironment;
    import javax.media.j3d.AmbientLight;
    import javax.media.j3d.Appearance;
    import javax.media.j3d.BoundingSphere;
    import javax.media.j3d.BranchGroup;
    import javax.media.j3d.Canvas3D;
    import javax.media.j3d.DirectionalLight;
    import javax.media.j3d.Group;
    import javax.media.j3d.GraphicsConfigTemplate3D;
    import javax.media.j3d.Light;
    import javax.media.j3d.Material;
    import javax.media.j3d.PhysicalBody;
    import javax.media.j3d.PhysicalEnvironment;
    import javax.media.j3d.PointLight;
    import javax.media.j3d.PolygonAttributes;
    import javax.media.j3d.Shape3D;
    import javax.media.j3d.TransformGroup;
    import javax.media.j3d.Transform3D;
    import javax.media.j3d.View;
    import javax.media.j3d.ViewPlatform;
    import javax.media.j3d.TransformGroup;
    import javax.swing.BoxLayout;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import java.awt.event.MouseAdapter;
    import java.awt.event.MouseEvent;
    import javax.vecmath.Color3f;
    import javax.vecmath.Color4f;
    import javax.vecmath.Point3d;
    import javax.vecmath.Point3f;
    import javax.vecmath.Vector3d;
    import javax.vecmath.Vector3f;
    * The <code>SimpleViewCalculator</code> class calculates the up vector and the
    * view plane normal for a camera based on its current position and the
    * transformation of two default up vector and VPN reference points.
    * @version 1.0
    public class SimpleViewCalculator
      extends JFrame
      // CONSTRUCTOR
       * Creates a new <code>SimpleViewCalculator</code> instance.
      public SimpleViewCalculator()
        // Create the canvas and add it to the universe.
        canvas = initializeCanvas();
        universe = new SimpleUniverse( canvas );
        // Create the content for the virtual universe.
        worldRoot = createWorldObjects();
        worldRoot.addChild( createColorCube( 0.0f, 0.0f, 0.0f, 5.0f ) );
        universe.addBranchGraph( worldRoot );
        universe.getViewingPlatform().
          setViewPlatformBehavior( createOrbitBehavior() );
        // Set the clipping distances for the view.
        universe.getViewer().getView( ).setBackClipDistance( 1000.0 );
        universe.getViewer().getView( ).setFrontClipDistance( 0.1 );  
        setCameraPosition( 0.0f,  0.0f, 50.0f );
        upPoint = new Point3d( 0.0, 1.0, 0.0 );
        lookAtPoint = new Point3d( 0.0, 0.0, -1.0 );
           this.getContentPane().setLayout(
          new BoxLayout( this.getContentPane(), BoxLayout.Y_AXIS ) );
        this.getContentPane().add( canvas );
        canvas.addMouseListener(
          new MouseAdapter()
             * The mouseClicked on this mouse listener is where the work for
             * calculating the up vector and the view plane normal.
            public void mouseClicked( MouseEvent event )
              TransformGroup viewPlatformTG =
                universe.getViewingPlatform().getViewPlatformTransform();
              Transform3D cameraT3D = new Transform3D();
              Vector3d cameraPos = new Vector3d();
              viewPlatformTG.getTransform( cameraT3D );
              cameraT3D.get( cameraPos );
              // Calculate the "up" vector.
              Point3d newUpPoint = new Point3d();
              cameraT3D.transform( upPoint, newUpPoint );
              Vector3d upVector = new Vector3d();
              upVector.x = newUpPoint.x - cameraPos.x;
              upVector.y = newUpPoint.y - cameraPos.y;
              upVector.z = newUpPoint.z - cameraPos.z;
              upVector.normalize();
              System.err.println( "new up vector = " + upVector );
              // Calculate the "vpn" or direction the camera is pointing.
              Point3d newLookAtPoint = new Point3d();
              cameraT3D.transform( lookAtPoint, newLookAtPoint );
              Vector3d vpn = new Vector3d();
              vpn.x = newLookAtPoint.x - cameraPos.x;
              vpn.y = newLookAtPoint.y - cameraPos.y;
              vpn.z = newLookAtPoint.z - cameraPos.z;
              vpn.normalize();
              System.err.println( "new view plane normal = " + vpn );
        this.setVisible( true );
        this.setSize( new Dimension( 300, 375 ) );   
      // METHODS
       * Initialize a Canvas3D with default graphics configuration for user's
       * system.
       * @return a <code>Canvas3D</code> value
      private Canvas3D initializeCanvas()
        GraphicsConfigTemplate3D tmpl = new GraphicsConfigTemplate3D( );
        GraphicsEnvironment env =
          GraphicsEnvironment.getLocalGraphicsEnvironment( );
        GraphicsDevice device = env.getDefaultScreenDevice( );
        GraphicsConfiguration config = device.getBestConfiguration( tmpl );
        Canvas3D canvas3D = new Canvas3D( config );
        return canvas3D; 
       * Create a orbit behavior for the canvas and simple universe.
      private OrbitBehavior createOrbitBehavior()
        OrbitBehavior orbit =
          new OrbitBehavior( canvas, OrbitBehavior.REVERSE_ALL );
        BoundingSphere bounds =
          new BoundingSphere( new Point3d( 0.0, 0.0, 0.0 ), 1000000000 );
        orbit.setSchedulingBounds( bounds );
        orbit.setTranslateEnable( true );
        orbit.setZoomEnable( true );
        orbit.setProportionalZoom( true );
        orbit.setReverseZoom( true );
        return orbit;
       * Create the objects that will appear in the virutal world and add them to a
       * branch group which is returned to the calling method.
       * @return a <code>BranchGroup</code> value
      private BranchGroup createWorldObjects()
        BranchGroup root = new BranchGroup();
        root.setCapability( BranchGroup.ALLOW_DETACH );
        root.setCapability( Group.ALLOW_CHILDREN_EXTEND );
        root.setCapability( Group.ALLOW_CHILDREN_READ );
        root.setCapability( Group.ALLOW_CHILDREN_WRITE );
        return root;
       * Create a color cube of <code>scale</code> size, attached to a branch group.
       * This method returns a color cube attached to that branch group.
      private BranchGroup createColorCube( float x, float y, float z, double scale )
           BranchGroup colorCubeRoot = new BranchGroup();
           colorCubeRoot.setCapability( BranchGroup.ALLOW_DETACH );
           TransformGroup colorCubeTG = new TransformGroup();
           Transform3D colorCubeT3D = new Transform3D();
           colorCubeT3D.set( new Vector3f( x, y, z ) );
           colorCubeTG.setTransform( colorCubeT3D );
           colorCubeRoot.addChild( colorCubeTG );
           ColorCube cube = new ColorCube( scale );
           colorCubeTG.addChild( cube );
           return colorCubeRoot;
       * Set the position of the camera.
      private void setCameraPosition( float x, float y, float z )
        Transform3D vt = new Transform3D();
        Point3d eye = new Point3d( x, y , z );
        Point3d  center = new Point3d( 0, 0, 0 );
        Vector3d up = new Vector3d( 0.0, 1.0, 0.0 );   
        vt.lookAt( eye, center, up );
        vt.invert( );
        vt.setTranslation( new Vector3d( eye.x, eye.y, eye.z ) );
        universe.getViewer().getViewingPlatform( ).
          getViewPlatformTransform( ).setTransform( vt );
       * Main method for application.
      public static void main( String[] args )
        new SimpleViewCalculator();     
      // ATTRIBUTES
      /** A Simple 3D virtual world. */
      private SimpleUniverse universe;
      /** Component to paint contents of virtual world. */
      private Canvas3D canvas;
      /** Allows mouse rotations, etc. */
      private OrbitBehavior orbitBehavior;
      /** View object for simple universe. */
      private View view;
      /** Branch group for adding world objects. */
      private BranchGroup worldRoot;
      /** Branch group for attaching lights. */
      private BranchGroup lightRoot;
      /** Point light for illuminating scene. */
      private PointLight pointLight;
      /** A point used to calcuate the up vector. */
      private Point3d upPoint;
      /** A point used to calculate the VPN. */
      private Point3d lookAtPoint;
    }Hope that helps. You should check this on your own to make sure no mistakes were made, I didn't have too much time to test it.
    Cheers,
    Greg

  • Netbeans, java3d, menubar, toolbar, jpanel  HELP

    I'm attempting to make an application using netbeans which features a menu, a toolbar, and a jpanel beneath that which displays a Canvas3D. I got this to partially work, but the Canvas3D will not automatically resize. If I .add the canvas3D to the frame, then it resizes automatically but it writes over the toolbar (but not the jmenu since I made it inherit jpopupmenu).
    Does anyone know of some good information for how to get 3D to work with a Java application? I don't even care if its Java3D...JOGL...any of the 3D libraries out there would be fine, I just need it to cooperate nicely with a GUI toolkit!
    thanks for any info!!
    -Zom

    Hello, I am fighting with the netbeans platform + java3d as well and I am seeing the same problems as you have reported.
    Are you using the netbeans RCP framework ?, if this is the case, could you
    send me an email: [email protected]
    Thanks a lot in advance!

  • Looking for Java3D "Starter's guide" or something....

    Is it possible for me to learn Java3D from scratch without spending any money??? :)
    If you know how, please tell me where to find such information!
    Thanks...

    Well I want to do a Java3D related project for school, but is it enough\too much?
    I was thinking about a 3d java game or something like that.
    I will do anything if I find a good idea for a Java3D project...
    I need to know one last thing:
    I can (and will) read all this if ill do a Java3D project.
    Really, I gonna.
    I just don't know if I could complete that whole 240+ pages book in less than six months (+-), and then have enough time to actually create the project!
    Please... anyone!
    Give me a good java3d project and please say:
    "Yes! You could finish reading that book AND finish the actual project in one year!"
    Thank you.
    I am totaly serious.. I really want this project to be good!
    I am willing! :D

  • Trying to call a Java3D application from .jnlp file

    Hi everybody,
    I'm trying to execute a java3D simple program making use of a *.jnlp* file, but isn't working...
    Can anybody help? Thanks in advance.
    This is what I have:
    simple.jnlp
    <?xml version="1.0" encoding="UTF-8"?>
    <jnlp spec="1.0+"
    codebase="file:///the_path/jnlp/">
    <information>
      <title>Hello JNLP</title>
      <homepage href="http://whatever.com" />
      <vendor>My self </vendor>
      <offline/>
    </information>
    <resources>
      <j2se version="1.2+" />
      <jar href="bin/HelloJava3Da.jar" />
      <jar href="bin/j3dcore.jar" />
      <jar href="bin/j3dutils.jar" />
      <jar href="bin/vecmath.jar" />
    </resources>
    <application-desc main-class="HelloJava3Da" />
    </jnlp>First, I had to generate the HelloJava3Da.jar, which contains HelloJava3Da.class (my program compiled and working when using java command).
    Generation of HelloJava3Da.jar :
    $ jar cf HelloJava3Da.jar HelloJava3Da.class
    $ jarsigner -keystore myKeys HelloJava3Da.jar jdcFinally, when I try to run simple.jnlp, making use of Firefox:
    firefox simple.jnlpThe result is:
    Error: Unexpected exception: java.lang.reflect.InvocationTargetException
    java.lang.reflect.InvocationTargetException
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at com.sun.javaws.Launcher.executeApplication(Launcher.java:1272)
         at com.sun.javaws.Launcher.executeMainClass(Launcher.java:1218)
         at com.sun.javaws.Launcher.doLaunchApp(Launcher.java:1065)
         at com.sun.javaws.Launcher.run(Launcher.java:105)
         at java.lang.Thread.run(Thread.java:619)
    Caused by: java.lang.ExceptionInInitializerError
         at javax.media.j3d.VirtualUniverse.<clinit>(VirtualUniverse.java:227)
         at HelloJava3Da.<init>(HelloJava3Da.java:23)
         at HelloJava3Da.main(HelloJava3Da.java:53)
         ... 9 more
    Caused by: java.security.AccessControlException: access denied (java.lang.RuntimePermission modifyThreadGroup)
         at java.security.AccessControlContext.checkPermission(AccessControlContext.java:323)
         at java.security.AccessController.checkPermission(AccessController.java:546)
         at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
         at java.lang.SecurityManager.checkAccess(SecurityManager.java:712)
         at java.lang.ThreadGroup.checkAccess(ThreadGroup.java:288)
         at java.lang.ThreadGroup.getParent(ThreadGroup.java:139)
         at javax.media.j3d.MasterControl$16.run(MasterControl.java:3680)
         at java.security.AccessController.doPrivileged(Native Method)
         at javax.media.j3d.MasterControl.<clinit>(MasterControl.java:3673)
         ... 12 moreI have already made the same procedure with a none Java3D program (*TheTime.class*) and everything run well... With my java3D program is not...
    TheTime.java
    import java.awt.*;
    import javax.swing.*;
    import java.io.*;
    import java.net.*;
    public class TheTime {
      public static void main(String args[]) {
        JFrame frame =  new JFrame("Time Check");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        JLabel label = new JLabel();
        Container content = frame.getContentPane(); 
        content.add(label, BorderLayout.CENTER);
        String message = "missing";
        BufferedReader reader = null;
        try {
          Socket socket = new Socket("time.nist.gov", 13);
          InputStream is = socket.getInputStream();
          InputStreamReader isr = new InputStreamReader(is);
          reader = new BufferedReader(isr);
          reader.readLine(); // skip blank line
          message = reader.readLine();
        } catch (MalformedURLException e) {
          System.err.println("Malformed: " + e);
        } catch (IOException e) {
          System.err.println("I/O Exception: " + e);
        } finally {
          if (reader != null) {
            try {
              reader.close();
            } catch (IOException ignored) {
        label.setText(message);
        frame.pack();
        frame.show();
    HelloJava3Da.java
    import java.applet.Applet;
    import java.awt.BorderLayout;
    import java.awt.Frame;
    import java.awt.event.*;
    import com.sun.j3d.utils.applet.MainFrame;
    import com.sun.j3d.utils.universe.*;
    import com.sun.j3d.utils.geometry.ColorCube;
    import javax.media.j3d.BranchGroup;
    import javax.media.j3d.Canvas3D;
    import javax.media.j3d.*;
    import javax.vecmath.*;
    import java.awt.GraphicsConfiguration;
    //import com.sun.j3d.utils.universe.SimpleUniverse;
    //   HelloJava3Da renders a single, rotating cube.
    public class HelloJava3Da extends Applet {
      public HelloJava3Da() {
       setLayout(new BorderLayout());
       GraphicsConfiguration config = SimpleUniverse.getPreferredConfiguration();
       Canvas3D canvas3D = new Canvas3D(config);
       add("Center", canvas3D);
       BranchGroup scene = createSceneGraph();
       // SimpleUniverse is a Convenience Utility class
       SimpleUniverse simpleU = new SimpleUniverse(canvas3D);
       // This will move the ViewPlatform back a bit so the
       // objects in the scene can be viewed.
       simpleU.getViewingPlatform().setNominalViewingTransform();
       simpleU.addBranchGraph(scene);
    } // end of HelloJava3Da (constructor)
      public BranchGroup createSceneGraph() {
        // Create the root of the branch graph
        BranchGroup objRoot = new BranchGroup();
        objRoot.addChild(new ColorCube(0.4));
        return objRoot;
    } // end of CreateSceneGraph method of HelloJava3Da
    //  The following allows this to be run as an application
    //  as well as an applet
    public static void main(String[] args) {
       Frame frame = new MainFrame(new HelloJava3Da(), 256, 256);
    } // end of main (method of HelloJava3Da)
    } // end of class HelloJava3Da

    I have a collection of Java3d applets launched with Java3d:
    http://astral.mobile-visuals.com/3d_visuals.php
    You can compare your code for the page with mine, for instance this one:
    <applet code="org.jdesktop.applet.util.JNLPAppletLauncher"
    width=100%
    height=98%
    archive="astrals.jar,
    http://download.java.net/media/applet-launcher/applet-launcher.jar,
    http://download.java.net/media/java3d/webstart/release/j3d/latest/j3dcore.jar,
    http://download.java.net/media/java3d/webstart/release/j3d/latest/j3dutils.jar,
    http://download.java.net/media/jogl/builds/archive/jsr-231-webstart-current/jogl.jar,
    http://download.java.net/media/gluegen/webstart/gluegen-rt.jar,
    http://download.java.net/media/java3d/webstart/release/vecmath/latest/vecmath.jar">
    <param name="codebase_lookup" value="false">
    <param name="subapplet.classname" value="OrchideaOptM">
    <param name="subapplet.displayname" value="Orchideic Morph">
    <param name="jnlpNumExtensions" value="1">
    <param name="jnlpExtension1" value="http://download.java.net/media/java3d/webstart/release/java3d-latest.jnlp">
    <param name="progressbar" value="true">
    <param name="noddraw.check" value="true">
    </applet>
    -----------------

  • Java3D via Web Start

    Is there a way to specify in the jnlp the requirements of the java3D installation to be able to run this application?

    I got most of this information from a combination of searching these forums, the Web Start Developer's Guide, at http://java.sun.com/products/javawebstart/docs/developersguide.html, and the Unofficial JNLP/Web Start FAQ, which is at http://lopica.sourceforge.net/faq.html. Any mistakes or misconceptions in this explanation are my own, but if it leaves you confused or if I have failed to answer any questions, those are the documents that allowed me to get a Java3D application running via Web Start.
    First important point: you WILL NEED to sign all the .jars you distribute, so if you don't know how to do that, go read a tutorial on security and jarsigner/keystores FIRST. You can create your own cert to sign against, so long as your users trust you enough to click 'Yes' when Web Start asks them if they trust you. :)
    So, now you've gotten yourself set up with a signing cert, either your own or a $400 one from Verisign or similar. Now, you're going to need to sign copies of your application .jar, any other .jars you distribute (log4j.jar, the java3d jarfiles from the java3d distribution, in my case I have a data .jar that's separate from the application code .jar, etc.) Note that, to make Web Start transparently distribute the Java3D jars along with your application, you do in fact have to unpack them from the installer, sign them, and include them in the way I outline below. The approach I take is to copy all the files to some directory as unsigned.<original jar name>. Then, the jarsigner command line looks like this:
    jarsigner -keystore /path/to/keystore/file -storepass <password> -keypass <other password> -signedjar <original jar name> unsigned.<original jar name> keyAlias This applies equally for any other .jars you distribute (log4j is a popular example), including your own application .jar.
    If you use ant, the <signjar> task will do all the above for you! Have a look at the Ant manual.
    Put all these signed jarfiles in some directory where your web server can serve them up, e.g., /var/www/<yourapp>/lib on the Web Start server. Now all the pieces needed are in place and securely signed so that Web Start will trust your application to use them; you just have to tell Web Start to make them available to the runtime classpath. Below are my .jnlp file and main() method from my java3d application. Note especially the <security> stanza of the JNLP file, which is what both requires the signing of all the .jars, and allows Java3D to talk to the DirectX or OpenGL layer, access files stored on disk (the .jars in the Web Start cache, for example), and
    just generally behave as a native app might.
    First the JNLP file:
    <?xml version="1.0" encoding="utf-8"?>
    <!-- JNLP File for Your Application -->
    <jnlp
      spec="1.0+"
      codebase="http://your.webstart.server/yourapp"
      href="http://your.webstart.server/yourapp/yourapp.jnlp">
      <information>
        <title>Your Application</title>
        <vendor>Some Company</vendor>
        <!--<homepage href="docs/help.html"/> -->
        <description>This is your application</description>
        <description kind="short">A longer application description</description>
        <!-- <icon href="images/swingset2.jpg"/> -->
        <offline-allowed/>
      </information>
      <security>
          <all-permissions/>
      </security>
      <resources>
           <j2se version="1.4.2" href="http://java.sun.com/products/autodl/j2se" initial-heap-size="64m" />
           <jar href="http://your.webstart.server/yourapp/lib/yourApplication.jar"/>
           <jar href="http://your.webstart.server/yourapp/lib/some3rdPartyLibrary.jar"/>
      </resources>
      <resources os="Windows">
        <jar href="http://your.webstart.server/yourapp/lib/core/Java3D/jars/j3d/windows/j3daudio.jar"/>
        <jar href="http://your.webstart.server/yourapp/lib/core/Java3D/jars/j3d/windows/j3dcore.jar"/>
        <jar href="http://your.webstart.server/yourapp/lib/core/Java3D/jars/j3d/windows/j3dutils.jar"/>
        <jar href="http://your.webstart.server/yourapp/lib/core/Java3D/jars/j3d/windows/vecmath.jar"/>
        <nativelib href="http://your.webstart.server/yourapp/heartcad/lib/core/Java3D/jars/j3d/windows/j3dDLL.jar"/>
      </resources>
      <!-- Linux IBM J2RE 1.3.0 -->
      <resources os="Linux" arch="x86">
        <jar href="http://your.webstart.server/yourapp/lib/core/Java3D/jars/j3d/linux/i386/j3daudio.jar"/>
        <jar href="http://your.webstart.server/yourapp/lib/core/Java3D/jars/j3d/linux/i386/j3dcore.jar"/>
        <jar href="http://your.webstart.server/yourapp/lib/core/Java3D/jars/j3d/linux/i386/j3dutils.jar"/>
        <jar href="http://your.webstart.server/yourapp/lib/core/Java3D/jars/j3d/linux/i386/vecmath.jar"/>
        <nativelib href="http://your.webstart.server/yourapp/lib/core/Java3D/jars/j3d/linux/i386/j3d.so.jar"/>
      </resources>
      <!-- Linux SUN JRE1.3.1 -->
      <resources os="Linux" arch="i386">
        <jar href="http://your.webstart.server/yourapp/lib/core/Java3D/jars/j3d/linux/i386/j3daudio.jar"/>
        <jar href="http://your.webstart.server/yourapp/lib/core/Java3D/jars/j3d/linux/i386/j3dcore.jar"/>
        <jar href="http://your.webstart.server/yourapp/lib/core/Java3D/jars/j3d/linux/i386/j3dutils.jar"/>
        <jar href="http://your.webstart.server/yourapp/lib/core/Java3D/jars/j3d/linux/i386/vecmath.jar"/>
        <nativelib href="http://your.webstart.server/yourapp/lib/core/Java3D/jars/j3d/linux/i386/j3d.so.jar"/>
      </resources>
      <application-desc main-class="com.some.company.yourapp.YourApp"/>
    </jnlp> And then the main() method:
         public static void main(String[] args) throws Exception {
              if(System.getProperty("javawebstart.version") != null) {
                   // for Web Start it is necessary to "manually" load in native libs
                   String os = System.getProperty("os.name");
                   log.debug("loading " + os + " native libraries ..");
                   if (os.startsWith("Windows")){
                        // order matters here!
                        // load those libs that are required by other libs first!
                        log.debug("j3daudio.dll .. ");
                        // drop ".dll" suffix here
                        System.loadLibrary("j3daudio");
                        log.debug("OK");
                        log.debug("J3D.dll .. ");
                        System.loadLibrary("J3D");
                        log.debug("OK");
                   } else if (os.equals("Linux")){
                        log.debug("libj3daudio.so .. ");
                        // drop "lib" prefix and ".so" suffix
                        System.loadLibrary("j3daudio");
                        log.debug("OK");
                        log.debug("libJ3D.so .. ");
                        System.loadLibrary("J3D");
                        log.debug("OK");
                   } else {
                        throw new Exception("OS '" + os + "' not yet supported.");
              // and then launch the app
              new MainFrame(new yourApp(), width, height);
         }

  • Download JAVA3D API necessary to run java3d?

    I have a problem because i made a game in java3d
    for new users that connect for the first time they have to download java1.3.1_06 plug in and then they have to download java3d API and installe manually.
    is there a way to download only one thing to make the two functions...?
    I would like the user to just download a plug in conataining everything necessary to the execution of my game.
    thank you seriously,i am blocked.

    The short answer to your question is "No".
    As you know, installing the JPI is simple. In principle, it would be possible, to autoinstall Java3D as an own JAR-file too. See this article:
    http://www.j3d.org/tutorials/quick_fix/auto_install.html
    But there are some problems with this solution:
    - The Java3D-files in the auto installer are fixed on a specific platform like "J3D 1.2 for Windows & DirectX" etc.
    - The JAR-file has to be signed, an that is a process
    - You can use a self made (test-) certificate to sign the JAR-file, but (on Windows), double clicking a certificate will install it in the Windows internal database - and that database is ignored by Java since version 1.3. Therefore, the certificate has to be installed in the Java internal certificate database via command line.
    I think it's the better way to let download the User the 3D API for his specific platform. As you know, there are some other obstacles:
    Each combination of OS, Graphics Acceleration and JVM Version requires different versions of J3D. (For example: The JVM 1.4, requires J3D 1.3. Otherwise, J3D 1.3 requires DirectX 8. But what's with platforms with JVM 1.4 and DirectX 7? For those, there is the J3D 1.3_4 etc...)
    Not necessary to say, that this is too much to almost all visitors of a normal website.
    Therefore, we have created a "Java 3D Download Guide". It is available on http://www.AniFun3.de/java3d/index.php. It has a neutral Design and can be integrated into other websites. The Download Guide will ask some questions and than redirect to the download page of a specific J3D version.
    You have to grant that the User will restart the JVM after installing the 3D API. That means, all browser windows has to be closed after the 3D API installation.
    Additional hint: Your game can check the local system for a proper installation of J3D at startup, and, if not installed, redirect to the download guide. The game can feed the download guide with information about the local system like OS name and JVM version. This infomation let the download guide jump over the first page.
    Note: To make this "auto check" propper work, your start class must not have any reference to a class of the 3D API!
    Here is a code example:
    // Member variable: Data structure, containing Java version information
    private static int[]          ivJavaVersion    = null;
    // Member variable: Flag, that indicates, if the program is started in applet mode or not.
    //                  Set this flag to 'false' in main()
    private static boolean        ivIsApplet       = true;
    * This method returns true, if Java 3D (TM) has been found in the
    * environment. If there is a problem using Java 3D, this method will
    * (if started in applet mode) try to open the Java 3D Download Guide
    * in a new browser.
    * @return boolean
    private boolean check3DAPI()
         boolean error        = false;
         boolean exit         = false;
         boolean exception    = false;
         String  errorMessage = "";
         boolean isApplet     = (this instanceof Applet);
         String  downloadURL  = "http://www.AniFun3.de/java3d/index.php";
         // Try to access a class of the 3D API
         try
              Class.forName( "javax.media.j3d.VirtualUniverse" ).newInstance();
         catch( Exception e)
              exception = true;
         catch( Error err )
              error = true;
              errorMessage = err.getMessage();
         // 3D API not available
         if( exception )
              // Bring up an error message
              errorMessage = "Java 3D extension not installed. \nPress OK to get redirected to the Java 3D download page\n" + downloadURL;
              System.err.println(errorMessage);
              JOptionPane.showMessageDialog( this, errorMessage, "AniFun3", JOptionPane.ERROR_MESSAGE );
              exit = true;
              // If started in applet mode, try to open the Download Guide
              if( isApplet )
                   // OK. Now find some information about the local System
                   // and submit it via the query string to the Download Guide.
                   // Doing so, will avoid one HTML-Form.
                   StringBuffer query = new StringBuffer();
                   query.append("?");
                   for( int i=0; i<getJavaVersion().length; i++)
                        query.append("jv");
                        query.append(i);
                        query.append("=");
                        query.append(getJavaVersion());
                        query.append("&");
                   query.append("os=");
                   query.append(System.getProperty("os.name"));     
                   // Open the browser     
                   try
                        ((Applet)this).getAppletContext().showDocument( new URL(downloadURL + query.toString()), "_blank" );
                   catch( Exception ex )
                        ex.printStackTrace();
         // There has occured another error. Java 3D seems to be installed, but maybe not correctly:
         else if( error )
              // Bring up an error message
              errorMessage = "Java 3D reports an error. Maybe the extension is not propper installed.\n" + errorMessage;
              System.err.println(errorMessage);
              JOptionPane.showMessageDialog( this, errorMessage, "AniFun3", JOptionPane.ERROR_MESSAGE );
              exit = true;
         if( exit )
              // Try to shutdown the programm, this will fail in applet mode
              try
                   System.exit(1);
              catch( Exception ex )
                   // can't shutdown the program
              return false;
         return true;
    * This method parses the Java VM version into an integer array.
    * @return int[]
    private int[] getJavaVersion()
         if( ivJavaVersion == null )
              ivJavaVersion = new int[]{0,0,0,0};
              try
                   StringTokenizer tokenizer = new StringTokenizer (System.getProperty("java.version"), ".");
                   String actToken = null;
                   int i=0;
                   while( tokenizer.hasMoreTokens() )
                        actToken = tokenizer.nextToken();
                        try
                             ivJavaVersion[i] = Integer.parseInt(actToken);
                             i++;
                        catch( NumberFormatException e )
                             // Some versions are seperated by a '_'
                             StringTokenizer newTokenizer = new StringTokenizer( actToken, "_" );
                             while( newTokenizer.hasMoreTokens() )
                                  ivJavaVersion[i++] = Integer.parseInt(newTokenizer.nextToken());
              catch( Exception e )
                   System.out.println("[KFBuddy]::getJavaVersion(): couldn't parse Java version: " + e);
         return ivJavaVersion;
    Regards,
    OFH

  • Rendering in Java3D

    I am trying to develop an augmented reality application using Java3d. I want to place certain virtual objects in an industrial environment. The end user would use transparent VR-glasses to view the 'augmented world'. To position the virtual objects i have created a simple VRML-model of the industrial environment. I do not want to display this VRML- world to the end user, i only want to display the virtual objects on the VR-glasses (and only the parts of these objects not hidden by real world objects). I figure it is necessary to use immediate-mode rendering, but i cannot find sufficient documentation on how to write a new renderer. Does anybody have any suggestions or experiences? I have read the Java3D API spec, but did not understand how to proceed.

    I've also had trouble finding new information on immediate rendering. However, a decent place to get bare bones example would be the in the demo directory of the Java3D SDK.
    It should have been placed in the same directory as your JDK, open that directory, select 'demo', then 'java3d', then 'PureImmediate'. You'll find a compiled class, source code, and applet for the program. It demonstrates immediate mode rendering with rotation animation. Tis a good palce to start. As for the API, essentially focus on creating and using the GraphicsContext3D class, as that will be your 'interface' for drawing/swapping/setting appearances/etc. Good luck.
    Cheers,
    Nicholas Toole

Maybe you are looking for

  • ALV Download to Excel

    Hi Experts, Currently in my custom program I have an issue regarding downloading ALV to excel file where one of the fields in the report will output more than 400 characters which is in Chinese characters and this field already type to string. The pr

  • How do I merge albums in Photos 1.0?

    My iMac has OS X Yosemite (10.10.3).  How do I merge albums in new Photos 1.0?  I've tried highlighting and dragging one on top of the other, but it doesn't work.

  • Using assert or exception?

    I have been struggling with the methodology of using assertions for some time now and would like to have an objective viewpoint. It primarily has to do with the use of assertions for pre-conditions. Let's say we have some class, for demonstration pur

  • Installing Soundtrack Pro (v 1.0) on MacBook Pro

    Hello all, I'd like to use Installing Soundtrack Pro (v 1.0) on my MacBook Pro with OS 10.6.8. I've used the install disc to install it and got a "Successfully installed" message, and I've used Software Update to find and install updates. But Soundtr

  • Why wont songs purchased from itunes transfer to my media files on pc?

    why wont songs purchased on itunes transfer to music library on pc?