3d Graphics (no Java3D)

I was just wondering how many are there that are doing "un-javalike" programming? What I mean is 3d graphics, gaming, generally anything that is more suitable for something like C++. I'm especially interested in java 3d engines and demo effects. I don't want any code or help, I just wish to know what you have done and if it there has been difficulties with some issues.

hi jsalonen
Cool thing. I noticed you set the statusbar text every nanosecond. just comment out that line, and see if it gets any smoother.
My little flight simulator is something I did a few years ago (my way of studying math). Ist just an applet with some calls to g.setColor() and g.fillPolygon() in the paint method. Did it all from scratch using pure awt and mathemathics.
My tequnique is to use matrix transformations between the different coordinate systems, (model, world, view and screen coordinates) sort all the polyhedrons (insertion sort is the fastest sort algorithm) and paint all polygons that is "facing towards the camra". I also did some vector angel calculations to set the light on every polygon acording to the angel between the surface of the polygon and the direction of the light.
Tryed to make a new version, but I have a problem with the transformation from view cordinates to screen coordinates. (I am just deviding on the z value) but that only works if the z value of all the verices of the polyhedron are positive (i.e. the entire polyhedron is in front of you) if half of the polyheron is behind you I have a problem...
Regards
"3d
Ragnvald

Similar Messages

  • 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?

  • Java3D startup time

    On my venerable Athlon/900 with a 3dfx Voodoo3 graphics card Java3D openGL takes about 2 seconds to create a new Canvas3D; with DirectX it takes more than twice (5 seconds) that long.
    Similar but somewhat slower timings I get on a PIII/933 with a more recent nVidia Quattro card.
    On a P4/1.8, also with an nvidia quattro card, DirectX won't even start; I get a D3DERROR_OUTOFVIDEOMEMORY.
    Pretty pathetic, I would say.
    Are there any tricks about how to tweak those startup times?
    Hans
    p.s. forget to mention that I'm running JDK v1.41_01 with Java3D v1.3

    Was profiling the startup (OptimizeIt) and found out that the culprit seems to be the call to SimpleUniverse.getPreferredConfiguration().
    The config this call returns is passed to the Canvas3D ctor.
    I searched the thru the Java3D demos to find out that all demos do this.
    Is there a better/faster way to initialize a Canvas3D?

  • Custom GUI's and displays

    Hi i am currently designing a game and just thinking from like when you go play games like doom 3 etc they all have their custom displays etc and its really effective, at the moment i am really stummped i have no clue where to start about that in java i have some ideas at the moment and was wondering how do the professionals do it...
    I have been researching into look and feel and the demos which come wit hthe jdk but they are very simple and i dont really see the use in them that much, i had the idea of also desing my displays in flash and starting a flash animations for the menus but i just dont think that is good practice and it would mean starting a flash app then closing that to then open my game but i may be able to embed the flash in a java swing frame or somthing but yeah..
    my question is how do the professionals go about creating their displays i am a good programming top in my year i dont mean to sound like one of those noobs that come on and basicaly ask you to create some class's for them with a few stupid methods..
    anyways thanks :) any responses would be great

    dont mean to sound like one of those noobs that come on and basicaly ask you to create some class's for them with a few stupid methods..Unfortunately you do, lol. Just kidding.
    Anyways, I'd suggest you probably take your questions to the Java2D and Java3D forums, cos that is where the real game grinder action will probably take place. A good percentage of your game will have to be coded using Java2D APIs and if you are looking for Doom like graphics, then Java3D is the best place to start.
    Also, about embedding flash, there are about two API I have come across lately, JFlashPlayer and another (I forget the name), but unfortunately they are all commercial. You can experiment with them though, it should be useful for something.
    ICE

  • Graphic card support Java3D?

    Here you the detail for my graphic card:
    http://www.via.com.tw/en/products/chipsets/k8-series/k8m890/
    and here the detail of the mobo:
    http://www.asus.it/products.aspx?l1=3&l2=101&l3=324&l4=0&model=1282&modelmenu=2
    I've installed DirextX 9c on my pc.
    I'm training on the Java3d libraries, but I got a problem, with my first example:
    DefaultRenderingErrorListener.errorOccurred:
    CONTEXT_CREATION_ERROR: Renderer: Error creating Canvas3D graphics context
    graphicsDevice = Win32GraphicsDevice[screen=0]
    canvas = javax.media.j3d.Canvas3D[canvas0,0,0,248x229]
    Java 3D ERROR : OpenGL 1.2 or better is required (GL_VERSION=1.1)
    Now, the question: can my graphic card support Java3D libraries?
    I've tried to use theese (https://j3d-webstart.dev.java.net/test/) example, but they don't work too!
    I hope in some suggest. Thanx in advice

    Have you tried updating your OpenGL version? Java 3D may need that for somethings that DirectX can't give...?
    Tustin2121

  • Java3D with Multiple Graphics Cards

    I am currently developing an application that has a 3D component. The application is targeted to be spanned across 3 monitors using 2 graphics cards.
    Most of the time when the application is over 2 of the monitors driven by different graphics cards, the exception below will be thrown
    Caused by: javax.media.opengl.GLException: Error making context current: 0
            at com.sun.opengl.impl.windows.WindowsGLContext.makeCurrentImpl(WindowsGLContext.java:169)
            at com.sun.opengl.impl.windows.WindowsPbufferGLContext.makeCurrentImpl(WindowsPbufferGLContext.java:102)
            at com.sun.opengl.impl.GLContextImpl.makeCurrent(GLContextImpl.java:134)
            at com.sun.opengl.impl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:182)
            at com.sun.opengl.impl.GLPbufferImpl.maybeDoSingleThreadedWorkaround(GLPbufferImpl.java:208)For the graphics cards, they are of the same model (ATI Radeon HD 5900 Series) and updated with the lastest drivers
    For the OS, I am using Win 7 64bit platform.
    Any help/advice will be greatly appreciated.
    Thanks
    Eng Chew

    No, Keynote takes over all the screens when presenting, and I'd think if you tried to edit in FCP when you were also running a show (if you could) it would likely bog BOTH programs down badly.
    You could export your presentations into QT and have the QT player running on one screen, but still, if you fire up FCP, everything's a different ball game then.
    I suggest leaving the FCP system on its own, don't try to do multiple things with it at the same time.

  • Just installed java3d but the demo programs will not show any graphics

    Hi,
    I just installed java 3D and when I run a demo program
    like "HelloUniverse" a window pops up but it is blank. Nothing is
    happening.I cant figure out what is going wrong.
    Any help is appreciated,
    Thanks.

    you might want to seek help in the 3D forum....

  • 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.

  • Problem with java3D and Matrox g550

    We're having an issue running a java3D program on some of our machines.
    The video card config:
    Matrox Millennium G550 AGP video card
    -Graphics Memory: 32 MB DDR
    -Maximum RAMDAC speed: 360 MHz
    -Matrox driver package: 5.70.010 or 5.72.21.0
    The bug that is thrown:
    java.lang.NullPointerException: Canvas3D: null GraphicsConfiguration
         at javax.media.j3d.Canvas3D.<init>(Canvas3D.java:1093)
         at javax.media.j3d.Canvas3D.<init>(Canvas3D.java:1058)
    The app runs fine on tnt2 and geforce2 cards. Anyone know of any issues?
    Thanks

    We're having an issue running a java3D program on some
    of our machines.Shuffle the problem to Sun. Do they bother? Never! Contact IBM that's my best advice. They will take your problem seriously for sure.

  • How do I measure the CPU/GPU split of load/usage in Java3D?

    Hello,
    Is it possible to measure the split between graphics and CPU usage to find out how much work each is doing, what work is done, and which is doing the most work, for example? If so, how can this be implemented in the Java3D code?
    For example, on a particular system, measure whether the GPU is doing the most work, or the CPU.
    Thanks for your help :)

    In Linux, you can read /proc/uptime. It does NOT give you the load averages that the command uptime gives. It gives you numerically the amount of time the CPU was idle vs how much time it was spent doing something. You need to read these two floating point numbers one every second, or once every 5 or 10 seconds then do the delta on the change: The maths are as follows:
    Read the file in twice in 5 seconds, parse into two floats/doubles:
    double[] last;  // the first read of the file
    double[] rect;  // the latest read of the file
    double ld = last[1] - last[0];
    double rd = rect[1] - rect[0];
    double cpu = (1.0d-(rd/ld)) * 100.0d;This should print the CPU percentage in Linux for that given time frame (5 second updates).

  • A short and fundamental question: Java3D in headless mode

    To begin I would like to introduce myself as a complete Java3D newbie.
    What I would like to accomplish is to produce an application which, in headless mode, will read in data and generate 3d images as files, without ever making any GUI components to appear on the screen.
    Is this possible?
    Thanks!

    When you say "unix doesn't have Arial" you obviously aren't using Solaris where Arial most certainly
    ships and is in fact the main font used to support dialog & sanserif.
    There are numerous APIs to calculate the width of a string in pixels, depending on whether
    you want the integer metrics, fp metrics , logical bounds, pixel bounds (which guarantees to enclose
    every pixel if you correctly specify the graphics/FRC)
    Every single one of these works in headless mode.
    Even the most simple-minded FontMetrics.stringWidth(String) call should be good enough
    for your requirements.
    The error you show looks like you have a misconfigured environment.. It can't find
    the correct implementation class of GraphicsEnvironment which is nothing to do with
    fonts. Moreover this DOES work for me :
    import java.awt.*;
    public class Arial {
    public static void main(String args[]) {
    Font arial = new Font("Arial", Font.PLAIN, 10);
    System.out.println(arial);
    % java -version
    java version "1.4.2_01"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_01-b06)
    Java HotSpot(TM) Client VM (build 1.4.2_01-b06, mixed mode)
    % java -Djava.awt.headless=true Arial
    java.awt.Font[family=Arial,name=Arial,style=plain,size=10]
    QED.
    -Phil.

  • X crashes when terminating java3d application....

    I have an application which uses java3d. So we've tried to bundle java3d with the application. Everything runs fine till the application is terminated, when X crashes.
    * Added j3audio.jar, j3utils.jar, j3core.jar and vecmath.jar to JAVA_HOME/jre/lib/ext
    * Added libJ3D.so, libJ3DUtils.so and libj3daudio.so to JAVA_HOME/lib/i386
    What might be the problem?
    Rana

    Wow. I thought I was the only person in the world with that problem.
    I had not played with Java3D for many months (mostly because of stated problem). Last week, I
    loaded up the latest Java3D (I think I got it from Blackdown). I verified that problem still exists. I then
    proceeded to play with the old NCSA Portfolio object file loader. When I exited the sample program,
    my X DID NOT DIE!
    After that, I ran my other 3D programs and they no longer crashed either.
    Doesn't make much sense. I checked the exit code for the Portfolio sample program, and it just does
    a System.exit(). I don't see how it could be that program, but nothing else changed. Maybe something
    was cached in some 3D RAM somewhere, or maybe the new Java3D fixed it and there's some other
    reason why the fix didn't happen right away. Definitely needs more testing (most importantly, to see
    whether the problem is permanently fixed or was just fixed for that X session). Since my desktops are
    filled with work, I can't hazard running a 3D app to test it now.
    SYSTEM SETUP DETAILS FROM LAST YEAR
    Same problem happened consistently on 4 Linux workstations that were running RedHat 6.2, then
    7.0, then 7.1 (the problem did not change over OS upgrades). I used generic RH kernels and
    kernels built specifically for the corresponding graphic chipsets and DRI support-- didn't matter at
    all.
    If you find out anything, pls update this thread. I will update it this eve if I have time to do more testing.

  • 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!

  • 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

  • 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.

Maybe you are looking for

  • SYSFAIL

    in file to IDOC scenario. file coming to MONI  But it just stuck in the queue and won't send out to SAP system and I checked the SMQ2, it tells me the status is "SYSFAIL'. I have checked my RFC, port, logical systems, profile etc. Can you please how

  • Prerender selection in Motion 5?

    Motion 4 had s thing like "export selection" and a choice of putting the result back to the project. Is there any such a feature in Mo-5? I dont see... please?

  • How to migrate iTunes to new Windows install

    Hello friends!  I am pretty good with computers but terrible at iTunes!  So my SSD crashed & took down my C drive.  Luckily, everything is backed up.  My iTunes was installed on my C drive and the library is on my Z drive.  I would like to keep my li

  • Why can't I add an image to my new project in adobe premiere elements 11?

    It keeps coming up with the same error no matter what image I try to add to my project. Error Message:"The importer reported a generic error."

  • Solution Manager and JDI

    Hi, I'm not very familiar with solution manager but other than monitoring the WAS Java Runtime systems , upgrading them (support packs) and using the SLD are there any other connections with between the JDI and SLD ? Thanks