No rendering in Java3D

I can�t view applets or apps in Java3D. I performed the follow code:
import com.sun.j3d.utils.universe.SimpleUniverse;
import com.sun.j3d.utils.geometry.ColorCube;
import javax.media.j3d.BranchGroup;
public class Hello3d {
public Hello3d()
SimpleUniverse universe = new SimpleUniverse();
BranchGroup group = new BranchGroup();
group.addChild(new ColorCube(0.3));
universe.getViewingPlatform().setNominalViewingTransform();
universe.addBranchGraph(group);
public static void main( String[] args ) {
new Hello3d();
} // end of class Hello3d
The BlueJ program show me this:
An error ocurred in a file for which the source cannot be found.
class:source line number:
java.awt.EventDispatchThread:145
NoClassDefFoundError:
sun/awt/DrawingSurface(in java.awt.EventDispatchThread)
I had the follow events:
Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: sun/awt/DrawingSurface
     at javax.media.j3d.DrawingSurfaceObjectDSI.getDrawingSurfaceObjectInfo(DrawingSurfaceObjectDSI.java:72)
     at javax.media.j3d.Canvas3D.paint(Canvas3D.java:1242)
     at sun.awt.RepaintArea.paintComponent(RepaintArea.java:248)
     at sun.awt.RepaintArea.paint(RepaintArea.java:224)
     at sun.awt.windows.WComponentPeer.handleEvent(WComponentPeer.java:254)
     at java.awt.Component.dispatchEventImpl(Component.java:4031)
     at java.awt.Component.dispatchEvent(Component.java:3803)
     at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
     at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
     at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
     at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
     at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
     at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: sun/awt/DrawingSurface
     at javax.media.j3d.DrawingSurfaceObjectDSI.getDrawingSurfaceObjectInfo(DrawingSurfaceObjectDSI.java:72)
     at javax.media.j3d.Canvas3D.paint(Canvas3D.java:1242)
     at sun.awt.RepaintArea.paintComponent(RepaintArea.java:248)
     at sun.awt.RepaintArea.paint(RepaintArea.java:224)
     at sun.awt.windows.WComponentPeer.handleEvent(WComponentPeer.java:254)
     at java.awt.Component.dispatchEventImpl(Component.java:4031)
     at java.awt.Component.dispatchEvent(Component.java:3803)
     at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
     at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
     at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
     at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
     at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
     at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: sun/awt/DrawingSurface
     at javax.media.j3d.DrawingSurfaceObjectDSI.getDrawingSurfaceObjectInfo(DrawingSurfaceObjectDSI.java:72)
     at javax.media.j3d.Canvas3D.paint(Canvas3D.java:1242)
     at sun.awt.RepaintArea.paintComponent(RepaintArea.java:248)
     at sun.awt.RepaintArea.paint(RepaintArea.java:224)
     at sun.awt.windows.WComponentPeer.handleEvent(WComponentPeer.java:254)
     at java.awt.Component.dispatchEventImpl(Component.java:4031)
     at java.awt.Component.dispatchEvent(Component.java:3803)
     at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
     at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
     at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
     at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
     at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
     at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
Could anyone help me?

Dont take this the wrong way and its maybe offtopic but:
In my oppion you should use bluejay to develop java applications. It's good to get to know the basics in. I'd like to advice eclipse. Its a crosslanguage IDE build in java itself.
www.eclipse.org
(no advertising, just trying to help)

Similar Messages

  • 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

  • Frag Island, Fred, any others?

    I remember that a long time ago there was quite a nice 3d raycaster engine made called Fred, I've not been able to locate it anywhere. I also have the webpage for Frag Island, which is a very good 3d polygon engine. I haven't been able to load it becuase it's missing the map file. Are there any other 3d java game engines in the entire world? Or any mirrors for Frag Island?
    -Jason Thomas.

    I'm talking about video game raycasting/3d graphics engines. Idx3d is some what different. It loads 3d models and then displays them with lighting effects. While this may be applicable to objects (sprites) within my game, it would be some what wasteful to display my entire 3d environment using it. I have been VERY impressed with it's speed in the past. Which brings me to another question. Why is Java3d API SO slow on my 233mhz pentium, when it uses OpenGL and alot of hardware acceleration. While idx3d runs PERFECTLY and also extremely fast doing far more impressive 3d rendered then Java3d on my 233 with no problem whatsoever, and it uses no such acceleration.
    -Jason Thomas.

  • Java3d rendering

    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.

    1) Post in the Java3D forum
    2) http://j3d.org/
    Their mailing list is very active - there are a lot of resources there.

  • What does Java3d have to help with 3d model rendering?

    Well, basically i spent a few hours the other day writing a basic model rendering application, it uses the java.awt.Graphics class for the drawing and the java.awt.Canvas class for the main applet.
    Now, it was a pretty hard project for me in my opinion as i have never attempted anything like it before, now, in using the awt Graphics class you have to work everything out yourself.
    For example;
    You have your model, this has x, y and z vertices, then you have your faces, which are triangles which link up 3 of the vertices to make a face or skin for the model. After this you have your "camera" or "view point", this relates to the x, y and z rotations, offset (for zooming) and transitions of all of the above data, then after all this you can finally create the triangle or face by using the Polygon class and inputing the x, y and z point values.
    Now, i want to know if Java 3d has any of the above stuff already there for you to take advantage of, for example also lighting effects, such as the ability to add shadows.
    Ive already looked through the Java 3d tutorial pdf but i couldn't see anything that relates to creating your own model's, the only thing i saw were pre-programmed shapes such as cubes and other polygons.
    Thanks for any help.

    Hi ,
    Java 3d has many effects ready , like shadows , raytrace and... .
    I think you may have 5 issues ,
    1. Geometry and object models
    2. Lighting
    3. camera and rendering
    4. Sound
    5. Animation
    for geometry , best solution is using modeling tools like 3D Studio Max , export model and import in your program.
    for Lighting it has many light types , but 'm not good at using them ,
    for camera it has lots of usefull stuff . even special rendering for 3dGlasses !
    for Sound , as i know it supports 3d sound engine that renders your sound. ( I mean if your avator is close to sound source , sound is stronger , if source is left hand of avator , sound will apear in left speaker)

  • Java3D redrawing and re-rendering.

    #10 In order to have my collection of IndexedGeometryArray points (and designated special normals) drawn and filled in, my program will make a call to the NormalGenerator Class.
    If the object itself is to change by the stretching and moving of a defining point during runtime, and to experience a line, but mainly a surface change, does one just call the NormalGenerator multiple times? However won't this slow down the program to the point of thrashing?
    Is this the ideal way to handle run time redrawing (re-rendering) ?

    What happens if I start iteratively calling NormalGenerator
    on a particular subset of my overall 3D world,
    on a particular IndexedGeometryArray?
    I would have an independent thread for this.
    Will things essentially happen instantly?
    How fast will this go, and will there be any perceivable delay?
    What needs to be held in mind when doing things?

  • Java3d speed collapse caused by other java apps running at the same time

    Hi
    I am programming a flightsimulator for some months.
    The current state is online available (all free, no copyrights)
    at http://www.snowraver.org/efcn/efcnsim/index.htm
    especially the sample (source) which shows the
    behaviour which is the reason for my post is here
    http://www.snowraver.org/efcn/efcnsim/page2.htm
    My Problem:
    When I start the sim while two other java programs
    ( one is a server running localhost, one is a client )
    are running, the speed of the flightsim is very slow,
    one frame update takes 3 to 5 seconds.
    ( 3 java.exe's in task list plus 1 which is the IDE )
    When I start the flightsim ALONE, I have 30 to 40 frames per second.
    ( 2 java.exe's in the task list = the flightsim and the IDE -> no prob here )
    That means, the flightsim is about 100 times slower, when
    started while the other two apps are running.
    BUT the other two applications do almost ***NOTHING***, the
    CPU load is 1 or 2 percent.
    Of course they have threads running, but all are waiting
    for a signal - no thread really consumes CPU power.
    Interestingly, when I FIRST start the flightsim and AFTER THIS
    start the two other applications, the flightsim
    holds 30 frames per seconds without problems, even
    though the other applications consume some CPU power
    until they have completely started up.
    Configurations:
    JSDK 1.4.2_1 , 0_2..
    Java3D 1.3.1 OPENGL (The DirectX version crashes with D3D device lost)
    Win2000,XP CPU 800MHz upto 3 GHz
    In my point of view, the java3d thread scheduler makes
    some funny decisions when it starts up, which lead
    to the order dependent behaviour described above.
    My question is, if anyone has some ideas, how I could
    get away from this speed collapse.
    The problem is caused in native code I guess.
    I also could imagine, that it has to do something with
    the order in which one creates, attaches and starts
    the Canvas3D. (? could produce race conditions)
    The flightsim runs in full retained mode. Of course
    the CPU work in the behaviours is rather big, because
    the ROAM triangulation update (..) is done there
    and the triangles are recalculated and passed
    ( all BY_REFERENCE ).
    Or could it have to do something with the memory
    consumption ( when all runs, almost all of
    the 512MB RAM is taken by the three java.exe's ) ?
    Any hints or ideas ?

    :) No, Sun does handle it [lol]
    I just have tested it on my computer at work
    ( 3GHz HP compaq, 1GB Ram and a Intel 82865G Graphics
    Card with 64MB memory, Windows XP )
    and it has worked without problems any way I tried.
    ( Except for xclusive fullscreen mode, but I guess, the administrators
    have deactivated it somehow, so we don't play games at work :)
    I couldn't test it under Linux so far, but I think, this will be less
    problematic than Windows [usually].
    However my current assumption is:
    I totally have forgot the [limited] videocard memory.
    I suppose, Java3D tries to put all triangle data and all
    textures to the videocards memory, so most data processing
    then can be passed to it's graphiccard CPU using
    OpenGL commands.
    Now the flightsim produces a varying amount of (by_reference) triangle data ( a few thousands )
    and has some texture maps for the terrain, the sea and other things,
    plus indexed triangle data for the planes and ships.
    The notebook system, which slows down has an ATI Mobile Radeon card
    with only 32MB RAM onboard, whereas the others have 64MB Ram.
    An additional pointer to that theory is that I can trigger the slowdown by resizing
    the flightsim window, while it is running.
    On the notebook, it holds 30fps, until the window exceeds a size of 962*862 pixels.
    At this size the speed collapses and goes down to 1 frame update every 4 seconds.
    If I make the window a few pixels smaller, the speed of 30fps immediately
    is there again.
    Therefore I guess, some data passed to the graphic cards memory depends
    linearly from the canvas3d's window dimension, and at some limit,
    the graphiccard's memory is too small and Java3D changes it's strategy
    and performs most calculations on the computer's mainmemory,
    which of course is a lot slower.
    I'm not very sure about that, I'm just speculating.
    Next thing I will try is to disable directdraw for the other two applications,
    possibly swing also uses graphicscard memory, when directdraw is enabled.
    The solution seems to be clear anyway: The flightsim must examine the system
    and set some parameters depending on the machine's capabilities.
    Onboard videagraphic ram is one of them. If it's too slow, I start to decrease
    the window size and expect to see a sudden increase of speed, as soon as
    the rendering can be done by the graphicscard CPU. If this never happens,
    I assume no OpenGL accelerator is present on that system. This can be seen as a method
    for finding out the amount of videocard memory on a system by trial and error ..?:)
    Thanks for your tips, Alain.
    I especially have to check out the data sharing class in 1.5.

  • Rendering fails, but no error message is provided.

    Hello, I'm encountering a very strange behavior of Swing. I have an application (all used components are Swing) using Java3D (but I don't think that would cause my problems).
    The GUI renders fine most of time, but sometimes (almost randomly) some JPanels are not rendered properly - it looks like just eg. their top and left 10% are rendered and then this small piece is repeated over the whole JPanel. I don't even know if it is only the problem of JPanels. This description wouldn't say you much, so I rather provide some screenshots.
    A normal look on the GUI - http://www.ms.mff.cuni.cz/~peckam/share/swing_rendering_error_good.png
    The GUI with the error - http://www.ms.mff.cuni.cz/~peckam/share/swing_rendering_error_bad.png
    I am able to raise this behavior explicitly by throwing an uncaught exception in my swing-handling code.
    What is worse, sometimes it happens without an uncaught exception (but always it is in response to some user action - selecting a value in combobox, pressing a button or so). I've searched all my code for some blocks that could catch an exception and not write it out to the console, but no such place is in my code. So I know my code doesn't throw any uncaught exceptions.
    Maybe the problem could be in a library I use, I don't know.
    I've even tried to add a uncaught exception listener to both Thread and the EDT, but no exception was written out.
    I'm lost in debugging this, so please help me finding some good start points to find the cause of this problem. Thank you all very much.

    Hello,
    Thanks for the info about Java 3D.
    Andrew Thompson wrote:
    Ensure (...) The GUI is updated on the EDT. Thank you for forcing myself into the unpopular work. That was it.Great. Remember it (that's a classic).
    I now execute as much code on EDT as reasonable and I haven't encountered this error since then. But due to its randomness (...)To make things clear, only code that accesses Swing widgets and their models should run on the EDT, but I think that's what you were implying.
    I'm more concerned by your as much as reasonable . If you meant in terms of, the cost it takes to fix all the code, you should estimate it and plan to do it anyway. As you noticed, the effects of incorrect thread management in Swing are unpredictable, and may, and certainly will, appear sooner or later, in a situation that just escaped your testing, or that stems from a specific race condition.
    Since you haven't frowned at Andrew's warning, you're probably aware of that, but if you aren't, you should really take a look at the tutorial about concurrency in Swing (http://download.oracle.com/javase/tutorial/uiswing/concurrency/), to know the reasons, and the recommendations, as to how to write correctly threaded Swing programs.
    I reserve the option to reopen this thread if it shows again some time later. But I hope it is fixed ;)Fix your non-EDT-aware code first :o)
    And just a note about the form, if you come back with a different problem (even though it is likely due to improper threading), open a new topic instead, and reference this one.
    Much luck.
    J.

  • Multiple Views of same Universe with DIFFERENT rendering style, possible?

    I am trying to create a CAD-style application that uses several views to display the objects directly from the front, the side and the top using parallel projection and another view that shows the same objects from a freely moveable camera using perspective projection. Everything is working so far, but I would like to display the objects as wire frame in the parallel projection views and fully textured in the perspective view. I have found options to change the rendering of a shape, but that would change it for all views. Is there a way to set different rendering "styles" (i.e. vertex only, wireframe, flat, shaded, textures) for different views of the same universe?

    hi
    i've tried to do that some time ago and i had to give up... unfortunately i think java3D can't use various rendering modes for the same universe
    regards
    GnG

  • Convenient way to install Java3d API&Java1.4 jre at the same time?

    My Java3D program is embedded on Applet and I hope that anyone can run my program with only 1 installation(such that install Java1.4 jre and Java3D api at the same time...of course auto install all is best).Also,I have 2 link on my page..one is Java1.4 jre and other is Java3D 1.3 jdk,I hope my page have only 1 link and anyone can press once to install all..how can I do~~thank you~

    As stated in the Creative Suite CS5.5 EULA you are permitted to install ONE copy of Creative Suite  on your primary computer, and one additional copy on "a portable computer or a computer located at your home", provided this copy is not used at the same time as the primary installation. This is different from the idea that you can install it "on two computers" - you have to think of it as one copy being used in either of two locations, but never both. Installing two copies on desktop machines is not permitted unless one or both of them is in your own home.
    Creative Suite is sold and licensed as a single product (it has a unified serial number and the member applications cannot be transferred out of the Suite) so the rule on simultaneous use applies to any combination of the member applications. If your primary computer is running Photoshop, your home computer or laptop cannot run anything. This applies whether or not you're sitting at either machine (so leaving an office computer rendering out a video sequence overnight counts as 'in use').

  • Java3D SDN's HelloUniverse1 Help

    Hello, Im trying to learn Java3D, Im very new to Java as it is... im using SDN's HelloUniverse1 Example but am having real difficulties when trying to run it.
    Im getting this error:
    renderer.doWork(long) Line:776
    renderer(J3dThread).run() Line: 250
    Any ideas? (im using the eclipse IDE 3.2.0 with JRE System Library [J2SE1.5]j3dcore, j3dutils and vecmath)
    thanks in advance
    here is the code from HelloUniverse1
    * @(#)HelloUniverse1.java 1.55 02/10/21 13:43:36
    * Copyright (c) 1996-2002 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.
    import java.applet.Applet;
    import java.awt.BorderLayout;
    import java.awt.GraphicsConfiguration;
    import javax.media.j3d.Alpha;
    import javax.media.j3d.BoundingSphere;
    import javax.media.j3d.BranchGroup;
    import javax.media.j3d.Canvas3D;
    import javax.media.j3d.RotationInterpolator;
    import javax.media.j3d.Transform3D;
    import javax.media.j3d.TransformGroup;
    import javax.vecmath.Point3d;
    import com.sun.j3d.utils.applet.MainFrame;
    import com.sun.j3d.utils.geometry.ColorCube;
    import com.sun.j3d.utils.universe.SimpleUniverse;
    public class HelloUniverse1 extends Applet {
      private SimpleUniverse u = null;
      public BranchGroup createSceneGraph() {
        // Create the root of the branch graph
        BranchGroup objRoot = new BranchGroup();
        // Create the TransformGroup node and initialize it to the
        // identity. Enable the TRANSFORM_WRITE capability so that
        // our behavior code can modify it at run time. Add it to
        // the root of the subgraph.
        TransformGroup objTrans = new TransformGroup();
        objTrans.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
        objRoot.addChild(objTrans);
        // Create a simple Shape3D node; add it to the scene graph.
        objTrans.addChild(new ColorCube(0.4));
        // Create a new Behavior object that will perform the
        // desired operation on the specified transform and add
        // it into the scene graph.
        Transform3D yAxis = new Transform3D();
        Alpha rotationAlpha = new Alpha(-1, 4000);
        RotationInterpolator rotator = new RotationInterpolator(rotationAlpha,
            objTrans, yAxis, 0.0f, (float) Math.PI * 2.0f);
        BoundingSphere bounds = new BoundingSphere(new Point3d(0.0, 0.0, 0.0),
            100.0);
        rotator.setSchedulingBounds(bounds);
        objRoot.addChild(rotator);
        // Have Java 3D perform optimizations on this scene graph.
        objRoot.compile();
        return objRoot;
      public HelloUniverse1() {
      public void init() {
        setLayout(new BorderLayout());
        GraphicsConfiguration config = SimpleUniverse
            .getPreferredConfiguration();
        Canvas3D c = new Canvas3D(config);
        add("Center", c);
        // Create a simple scene and attach it to the virtual universe
        BranchGroup scene = createSceneGraph();
        u = new SimpleUniverse(c);
        // This will move the ViewPlatform back a bit so the
        // objects in the scene can be viewed.
        u.getViewingPlatform().setNominalViewingTransform();
        u.addBranchGraph(scene);
      public void destroy() {
        u.cleanup();
      // The following allows HelloUniverse to be run as an application
      // as well as an applet
      public static void main(String[] args) {
        new MainFrame(new HelloUniverse1(), 256, 256);
    }

    Ok, point taken...
    where's a good place to learn "whats under the hood", most tutorials just say, "type into your command line: bla bla bla" without explaining why or what this includes when doing so or anything remotly interesting apart from what to type (not helpful when wanting to learn whats under the hood)
    TIA

  • Issues implementing a simple waterfall in Java3D

    I am currently implementing a waterfall display using Java3D. I have some questions about design, and also one about performance difficulties.
    The overall design structure is as follows:
    * The display is made up of a 2 dimensional grid, with each cell representing a data point viewed as a different color. Specifically I am testing with 360 points per line, with 60 lines. That's a lot of snow. ;)
    * At each iteration the display must add a newline to the top, shift everything down by one line, and end by dropping the bottom line (in no particular order). This gives a nice animation affect.
    * I am representing each line by a BranchGroup containing a Shape3D constructed with a QuadArray. Each quad within the array represents a cell. So each line contains 4*360=1440 points.
    * At each iteration I generate a new object containing the above. The coordinates of each point are set to sit one line above the previous line. This BranchGroup (which contains the Shape3D of quads) is added to the scene. The last line in the display is told to detach itself from the scene.
    * I am then moving the viewer up by the distance of one line. I am doing this by setting the viewingplatform's viewplatformtransform.
    So, some questions:
    * Is this design hopelessly convoluted for Java3D?
    * Does the fact that I'm dealing with 4 * 360 * 60 = 86,400 points mean that my performance is going to be awful no matter what?
    * Does it make sense to use more individual Shape3D objects, or use other primatives (or even utility shapes like cubes)?
    * Should I move the points instead of the viewer?
    * Can anyone offer an alternative to drawing tens of thousands of little points into a 3D environment?
    As far as my performance question, I have the above working, but I'm experiencing bad screen flicker. Remember that I am adding a new Shape3D to the top, dropping one from the bottom, and moving the viewer. Is there a better way of doing this, something I should add, particular flags I should set, anything? Performance isn't completely awful, but it isn't really acceptable --the flickering is very hard on the eyes.
    Thanks for any help you can send my way!

    I am currently implementing a waterfall display using
    Java3D. I have some questions about design, and also
    one about performance difficulties.Hey there, I'm new to the Java 3D scene, but I'll see what I can do with my limited knowledge and good old plane sense. ;o)
    The overall design structure is as follows:
    * The display is made up of a 2 dimensional grid, with
    each cell representing a data point viewed as a
    different color. Specifically I am testing with 360
    points per line, with 60 lines. That's a lot of snow.
    * At each iteration the display must add a newline to
    the top, shift everything down by one line, and end by
    dropping the bottom line (in no particular order).
    This gives a nice animation affect.
    * I am representing each line by a BranchGroup
    containing a Shape3D constructed with a QuadArray.
    Each quad within the array represents a cell. So each
    line contains 4*360=1440 points.
    * At each iteration I generate a new object containing
    the above. The coordinates of each point are set to
    sit one line above the previous line. This BranchGroup
    (which contains the Shape3D of quads) is added to the
    scene. The last line in the display is told to detach
    itself from the scene.
    * I am then moving the viewer up by the distance of
    one line. I am doing this by setting the
    viewingplatform's viewplatformtransform.
    So, some questions:
    * Is this design hopelessly convoluted for Java3D?
    * Does the fact that I'm dealing with 4 * 360 * 60 =
    86,400 points mean that my performance is going to be
    awful no matter what?Well, graphically, it may not be that bad (where it in another language). But I think the real lagging is caused by the way Java 3D represents the scene, in a scene graph. So, you're asking the renderer to travel through a an object tree (branchgroup) containing 86 400 idiviudal objects to be treated seperatly... We all know that Java is a RAM and CPU monster and I think doing this may be the drop that overflows the glass (your system anyway)...
    * Does it make sense to use more individual Shape3D
    objects, or use other primatives (or even utility
    shapes like cubes)?
    * Should I move the points instead of the viewer?You're already moving the points down each time (as mentionned before). So, I dunno, maybe just moving the viewer and deleting the last line and adding the top line (the rest staying put) would be faster... I still find there's lots of objects to treat there...
    * Can anyone offer an alternative to drawing tens of
    thousands of little points into a 3D environment? Sounds like you want a 2D looking foutain. Why not just create a big board and add an animated texture to it? I can see the performance increasing by 50 gazillion just by doing this. ;o)
    As far as my performance question, I have the above
    working, but I'm experiencing bad screen flicker.
    Remember that I am adding a new Shape3D to the top,
    dropping one from the bottom, and moving the viewer.
    Is there a better way of doing this, something I
    should add, particular flags I should set, anything?
    Performance isn't completely awful, but it isn't
    really acceptable --the flickering is very hard on the
    eyes.
    Thanks for any help you can send my way!I hope this helps! Happy coding!

  • SIGSEGV (11)  during offscreen only rendering

    Hello!
    I've got some troubles during offscreen only rendering, I've used OffScreenCanvas3D.java from PrintCanvas3D example and added some code to use it:
    public void test()
            GraphicsConfiguration config = SimpleUniverse.getPreferredConfiguration();
            OffScreenCanvas3D canvas = new OffScreenCanvas3D(config, true);
            canvas.setSize(320, 200);
            canvas.setOffScreenLocation(2, 2);
            Screen3D screen = canvas.getScreen3D();
            screen.setPhysicalScreenWidth(320.0);
            screen.setPhysicalScreenHeight(200.0);
            screen.setSize(320, 200);
            SimpleUniverse univ = new SimpleUniverse(canvas);
            univ.getViewingPlatform().setNominalViewingTransform();
            BranchGroup scene = new BranchGroup();
            scene.addChild(new ColorCube(0.5));
            Color3f bgColor = new Color3f(0.05f, 0.05f, 0.5f);
            Background bgNode = new Background(bgColor);
            scene.addChild(bgNode);
            univ.addBranchGraph(scene);
            BufferedImage image = canvas.doRender(800, 600);
            try
                if (!ImageIO.write(image, "jpg", new File("/tmp/image.jpg")))
                    System.err.println("arghhhhhhhhhh!");
            catch (IOException e)
                e.printStackTrace();
    public static void main(String[] args)
            Test3d test = new Test3d();
            test.test();
        }then during invocation of doRender() method I've got this dump:
    An unexpected exception has been detected in native code outside the VM.
    Unexpected Signal : 11 occurred at PC=0x4D41D0DE
    Function=Java_javax_media_j3d_Canvas3D_createOffScreenBuffer+0xFA
    Library=/usr/lib/j2sdk1.4.2_04/jre/lib/i386/libJ3D.so
    Current Java thread:
         at javax.media.j3d.Canvas3D.createOffScreenBuffer(Native Method)
         at javax.media.j3d.Canvas3D.setOffScreenBuffer(Canvas3D.java:1776)
         at net.homeunix.andrzejros.test3d.OffScreenCanvas3D.doRender(OffScreenCanvas3D.java:25)
         at net.homeunix.andrzejros.test3d.Test3d.test(Test3d.java:57)
         at net.homeunix.andrzejros.test3d.Test3d.main(Test3d.java:80)
    Dynamic libraries:
    08048000-0804e000 r-xp 00000000 03:46 184857065 /usr/lib/j2sdk1.4.2_04/bin/java
    0804e000-0804f000 rw-p 00005000 03:46 184857065 /usr/lib/j2sdk1.4.2_04/bin/java
    40000000-40014000 r-xp 00000000 03:42 33643020 /lib/ld-2.3.2.so
    40014000-40015000 rw-p 00013000 03:42 33643020 /lib/ld-2.3.2.so
    4002c000-4003a000 r-xp 00000000 03:42 33642993 /lib/libpthread-0.10.so
    4003a000-4003b000 rw-p 0000e000 03:42 33642993 /lib/libpthread-0.10.so
    4007d000-4007f000 r-xp 00000000 03:42 33642987 /lib/libdl-2.3.2.so
    4007f000-40080000 rw-p 00001000 03:42 33642987 /lib/libdl-2.3.2.so
    40080000-401a8000 r-xp 00000000 03:42 33642985 /lib/libc-2.3.2.so
    401a8000-401ad000 rw-p 00127000 03:42 33642985 /lib/libc-2.3.2.so
    401b0000-405ab000 r-xp 00000000 03:46 33640828 /usr/lib/j2sdk1.4.2_04/jre/lib/i386/client/libjvm.so
    405ab000-405c6000 rw-p 003fa000 03:46 33640828 /usr/lib/j2sdk1.4.2_04/jre/lib/i386/client/libjvm.so
    405d9000-405e1000 r-xp 00000000 03:46 16858474 /usr/lib/j2sdk1.4.2_04/jre/lib/i386/native_threads/libhpi.so
    405e1000-405e2000 rw-p 00007000 03:46 16858474 /usr/lib/j2sdk1.4.2_04/jre/lib/i386/native_threads/libhpi.so
    405ef000-40601000 r-xp 00000000 03:42 33642989 /lib/libnsl-2.3.2.so
    40601000-40602000 rw-p 00011000 03:42 33642989 /lib/libnsl-2.3.2.so
    40604000-40625000 r-xp 00000000 03:42 33642988 /lib/libm-2.3.2.so
    40625000-40626000 rw-p 00020000 03:42 33642988 /lib/libm-2.3.2.so
    40626000-4062a000 rw-s 00000000 03:42 11011654 /tmp/hsperfdata_thomas/7576
    4062a000-4063a000 r-xp 00000000 03:46 170154 /usr/lib/j2sdk1.4.2_04/jre/lib/i386/libverify.so
    4063a000-4063c000 rw-p 0000f000 03:46 170154 /usr/lib/j2sdk1.4.2_04/jre/lib/i386/libverify.so
    4063c000-40646000 r-xp 00000000 03:42 33642990 /lib/libnss_compat-2.3.2.so
    40646000-40647000 rw-p 0000a000 03:42 33642990 /lib/libnss_compat-2.3.2.so
    40647000-40667000 r-xp 00000000 03:46 170164 /usr/lib/j2sdk1.4.2_04/jre/lib/i386/libjava.so
    40667000-40669000 rw-p 0001f000 03:46 170164 /usr/lib/j2sdk1.4.2_04/jre/lib/i386/libjava.so
    40669000-4067d000 r-xp 00000000 03:46 170159 /usr/lib/j2sdk1.4.2_04/jre/lib/i386/libzip.so
    4067d000-40680000 rw-p 00013000 03:46 170159 /usr/lib/j2sdk1.4.2_04/jre/lib/i386/libzip.so
    40680000-42020000 r--s 00000000 03:46 235058853 /usr/lib/j2sdk1.4.2_04/jre/lib/rt.jar
    4206a000-42080000 r--s 00000000 03:46 235058845 /usr/lib/j2sdk1.4.2_04/jre/lib/sunrsasign.jar
    42080000-4215b000 r--s 00000000 03:46 235058839 /usr/lib/j2sdk1.4.2_04/jre/lib/jsse.jar
    4215b000-4216c000 r--s 00000000 03:46 235058859 /usr/lib/j2sdk1.4.2_04/jre/lib/jce.jar
    4216c000-426c5000 r--s 00000000 03:46 235058851 /usr/lib/j2sdk1.4.2_04/jre/lib/charsets.jar
    4476d000-4476f000 r-xp 00000000 03:46 67339139 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2
    4476f000-44770000 rw-p 00001000 03:46 67339139 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2
    4c7f0000-4c81c000 r--p 00000000 03:46 134300902 /usr/lib/locale/en_US/LC_CTYPE
    4c81c000-4c81f000 r--s 00000000 03:46 254720552 /usr/lib/j2sdk1.4.2_04/jre/lib/ext/dnsns.jar
    4c81f000-4c83b000 r--s 00000000 03:46 254720553 /usr/lib/j2sdk1.4.2_04/jre/lib/ext/sunjce_provider.jar
    4c83b000-4c848000 r--s 00000000 03:46 254720554 /usr/lib/j2sdk1.4.2_04/jre/lib/ext/ldapsec.jar
    4c848000-4c904000 r--s 00000000 03:46 254720555 /usr/lib/j2sdk1.4.2_04/jre/lib/ext/localedata.jar
    4c904000-4c94b000 r--s 00000000 03:46 254721351 /usr/lib/j2sdk1.4.2_04/jre/lib/ext/vecmath.jar
    4c94b000-4cbaf000 r--s 00000000 03:46 254721352 /usr/lib/j2sdk1.4.2_04/jre/lib/ext/j3dcore.jar
    4cbaf000-4ccf4000 r--s 00000000 03:46 254721353 /usr/lib/j2sdk1.4.2_04/jre/lib/ext/j3dutils.jar
    4ccf4000-4ce46000 r--s 00000000 03:46 254721354 /usr/lib/j2sdk1.4.2_04/jre/lib/ext/j3daudio.jar
    4ce46000-4d111000 r-xp 00000000 03:46 170175 /usr/lib/j2sdk1.4.2_04/jre/lib/i386/libawt.so
    4d111000-4d127000 rw-p 002ca000 03:46 170175 /usr/lib/j2sdk1.4.2_04/jre/lib/i386/libawt.so
    4d14c000-4d19f000 r-xp 00000000 03:46 170162 /usr/lib/j2sdk1.4.2_04/jre/lib/i386/libmlib_image.so
    4d19f000-4d1a0000 rw-p 00052000 03:46 170162 /usr/lib/j2sdk1.4.2_04/jre/lib/i386/libmlib_image.so
    4d1b6000-4d1bd000 r-xp 00000000 03:46 84116040 /usr/X11R6/lib/libXp.so.6.2
    4d1bd000-4d1be000 rw-p 00006000 03:46 84116040 /usr/X11R6/lib/libXp.so.6.2
    4d1be000-4d20b000 r-xp 00000000 03:46 84116011 /usr/X11R6/lib/libXt.so.6.0
    4d20b000-4d20e000 rw-p 0004d000 03:46 84116011 /usr/X11R6/lib/libXt.so.6.0
    4d20f000-4d21c000 r-xp 00000000 03:46 84116010 /usr/X11R6/lib/libXext.so.6.4
    4d21c000-4d21d000 rw-p 0000c000 03:46 84116010 /usr/X11R6/lib/libXext.so.6.4
    4d21d000-4d221000 r-xp 00000000 03:46 84116007 /usr/X11R6/lib/libXtst.so.6.1
    4d221000-4d222000 rw-p 00004000 03:46 84116007 /usr/X11R6/lib/libXtst.so.6.1
    4d222000-4d2e7000 r-xp 00000000 03:46 84116033 /usr/X11R6/lib/libX11.so.6.2
    4d2e7000-4d2ea000 rw-p 000c5000 03:46 84116033 /usr/X11R6/lib/libX11.so.6.2
    4d2ea000-4d2f2000 r-xp 00000000 03:46 84116037 /usr/X11R6/lib/libSM.so.6.0
    4d2f2000-4d2f3000 rw-p 00007000 03:46 84116037 /usr/X11R6/lib/libSM.so.6.0
    4d2f3000-4d308000 r-xp 00000000 03:46 84116009 /usr/X11R6/lib/libICE.so.6.3
    4d308000-4d309000 rw-p 00014000 03:46 84116009 /usr/X11R6/lib/libICE.so.6.3
    4d30b000-4d3c5000 r-xp 00000000 03:46 170157 /usr/lib/j2sdk1.4.2_04/jre/lib/i386/libfontmanager.so
    4d3c5000-4d3df000 rw-p 000b9000 03:46 170157 /usr/lib/j2sdk1.4.2_04/jre/lib/i386/libfontmanager.so
    4d3e0000-4d3e8000 r-xp 00000000 03:46 84116015 /usr/X11R6/lib/libXcursor.so.1.0.2
    4d3e8000-4d3e9000 rw-p 00007000 03:46 84116015 /usr/X11R6/lib/libXcursor.so.1.0.2
    4d3e9000-4d3f0000 r-xp 00000000 03:46 84116019 /usr/X11R6/lib/libXrender.so.1.2.2
    4d3f0000-4d3f1000 rw-p 00006000 03:46 84116019 /usr/X11R6/lib/libXrender.so.1.2.2
    4d3f1000-4d40d000 r-xp 00000000 03:46 67339137 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2
    4d40d000-4d40f000 rw-p 0001b000 03:46 67339137 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2
    4d410000-4d412000 r-xp 00000000 03:46 67222280 /usr/lib/gconv/ISO8859-1.so
    4d412000-4d413000 rw-p 00001000 03:46 67222280 /usr/lib/gconv/ISO8859-1.so
    4d413000-4d434000 r-xp 00000000 03:46 112939 /usr/lib/j2sdk1.4.2_04/jre/lib/i386/libJ3D.so
    4d434000-4d435000 rw-p 00020000 03:46 112939 /usr/lib/j2sdk1.4.2_04/jre/lib/i386/libJ3D.so
    4d44b000-4d4c1000 r-xp 00000000 03:46 84116014 /usr/X11R6/lib/libGL.so.1.2
    4d4c1000-4d4c6000 rw-p 00076000 03:46 84116014 /usr/X11R6/lib/libGL.so.1.2
    4d4c7000-4d4c8000 r-xp 00000000 03:46 170165 /usr/lib/j2sdk1.4.2_04/jre/lib/i386/libjawt.so
    4d4c8000-4d4c9000 rw-p 00000000 03:46 170165 /usr/lib/j2sdk1.4.2_04/jre/lib/i386/libjawt.so
    4d4c9000-4d4cd000 r-xp 00000000 03:46 84116041 /usr/X11R6/lib/libXxf86vm.so.1.0
    4d4cd000-4d4ce000 rw-p 00003000 03:46 84116041 /usr/X11R6/lib/libXxf86vm.so.1.0
    Heap at VM Abort:
    Heap
    def new generation total 576K, used 0K [0x44770000, 0x44810000, 0x44c50000)
    eden space 512K, 0% used [0x44770000, 0x44770210, 0x447f0000)
    from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000)
    to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000)
    tenured generation total 5620K, used 4120K [0x44c50000, 0x451cd000, 0x48770000)
    the space 5620K, 73% used [0x44c50000, 0x450563a8, 0x45056400, 0x451cd000)
    compacting perm gen total 4608K, used 4404K [0x48770000, 0x48bf0000, 0x4c770000)
    the space 4608K, 95% used [0x48770000, 0x48bbd100, 0x48bbd200, 0x48bf0000)
    Local Time = Wed Sep 8 02:28:27 2004
    Elapsed Time = 1
    # The exception above was detected in native code outside the VM
    # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode)
    even if i add scene.compile(); etc invocations same error is generated (repeatable), any ideas? maybe i forgot something or have to invoke before doRender call
    I need only offscreen rendering capability - it have to be server side app that returns images - but - have no idea what is wrong
    thank You for help

    I had a similar HotSpot problem/crash using
    Java3D 1.3x from blackdown : java3d-sdk-1.3-fcs-linux-i386.bin and java-sdk 1.4.05 (also blackdown)
    Java3D was running OK on the Swing side but was crashing with OffScreen operations.
    by the way : Linux-Ditribution was Suse
    In my case the problem was solved by downloading and installing
    the linux graphic driver related to the graphic card (an NVIDIA in my case - driver was found under www.nvidia.com - search with keyword linux...).
    Since then, everything back to normal and I am not experiencing any problems anymore.

  • 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

  • Immediate-Mode Rendering

    Hi, i wrote a normal rendering methode but i want to change it to Immediate-Mode Rendering which is in Java3D
    can anyone help me and tell me how to do that?
    here is my current rendering function that i want to change:
         public void render( Scene scene )
              Viewport eye = new Viewport( scene.viewpoint, 0, 0, width, height );
              double daa = 1.0 /antialias;
              for (int y=0; y < height; y++)
                   for (int x=0; x < width; x++)
                        DColor color = new DColor( 0.0, 0.0, 0.0, daa*daa );
                        for (int sy=0; sy < antialias; sy++)
                             for (int sx=0; sx < antialias; sx++)
                                  scene.trace( eye.ray( x + sx*daa, y + sy*daa ),
                                                 color, 0 );
                        putPixel( x, y, color.getRGB() );
              flush();
         }

    GLuint vboid;
    glGenBuffers(1, &vboid);
    glBindBuffer(GL_ARRAY_BUFFER, vboid);
    Your vboid is currently pointer, is it allocated? If it isn't your code makes no sense at all and it's miracle it doesn't crash on gen call.
    Also, gdb will tell you more if you read the documentation
    Last edited by Cloudef (2012-07-04 15:14:02)

Maybe you are looking for

  • SWF not loading into iweb08

    I have worked with flash, loading swf files into iweb without issue until now. I have two sites, www.thepulsedesigngroup.com and www.crplgroup.com and both are created in iweb08. Now for my first site I am trying to update my swf file and create a ne

  • Theme Refuses to Uninstall Even With Nokia PC Suit...

    I downloaded a theme from Nokia Suite a few months ago but I can't seem to be able to uninstall it, not even using Nokia PC Suite. While on Nokia PC Suite, I go to the Application Installer, find the "stubborn theme" and click to erase it. However, d

  • Question I just got my ipod and I am currently converting my top five movie

    to ipod format to be able to view them on my Ipod now I have two questions the first one is I have my fav movies saved in h.264 format each movie 1.5 gigs now when I converted my first one it created a duplicate of that specific movie my guess is one

  • Rosettanet--document protocol identification error

    Hi guys, i am trying inbound operation using oracle Rosettanet standard(3a4) i have taken PO request XSD and Input XML from Oracle sample Rosettanet-004 i am getting document protocol identification error i have changed the GlobalBusinessIdentifier v

  • How can I find exact username if I connected with sysdba privilege?

    I granted sysdba privilge to a database user. I can connect that user as sysdba. From that users session, 'show user' command showing "SYS" and also username from v$session is also showing "SYS". How can I find actual username used for connecting the