Flocking3D (Java3d) Question

Hi Guys,
I am trying to get a program running from the "Killer Game Programming" O'reilly book.
The code I am try to run is the Chapter 22 code "Flocking3d"
When I perform a javac *.java on the folder containing the files from the book I get 100 errors.
I have everything installed including Java3D.
I can post some of the errors if it helps.
Many thanks.
                   ^
CheckerFloor.java:11: package javax.media.j3d does not exist
import javax.media.j3d.*;
^
CheckerFloor.java:12: package com.sun.j3d.utils.geometry does not exist
import com.sun.j3d.utils.geometry.Text2D;
                                 ^
CheckerFloor.java:13: package javax.vecmath does not exist
import javax.vecmath.*;
^
CheckerFloor.java:22: cannot find symbol
symbol  : class Color3f
location: class CheckerFloor
  private final static Color3f blue = new Color3f(0.0f, 0.1f, 0.4f);
                       ^
                       ^
PreyBoid.java:16: package javax.media.j3d does not exist
import javax.media.j3d.*;
^
PreyBoid.java:17: package javax.vecmath does not exist
import javax.vecmath.*;
^
PreyBoid.java:22: cannot find symbol
symbol  : class Color3f
location: class PreyBoid
  private final static Color3f orange = new Color3f(1.0f,0.75f,0.0f);
                       ^
WrapFlocking3D.java:17: package com.sun.j3d.utils.universe does not exist
import com.sun.j3d.utils.universe.*;
^
WrapFlocking3D.java:18: package com.sun.j3d.utils.geometry does not exist
import com.sun.j3d.utils.geometry.*;
^
WrapFlocking3D.java:19: package javax.media.j3d does not exist
import javax.media.j3d.*;
^
WrapFlocking3D.java:20: package javax.vecmath does not exist
import javax.vecmath.*;
^
WrapFlocking3D.java:21: package com.sun.j3d.utils.behaviors.vp does not exist
import com.sun.j3d.utils.behaviors.vp.*;
^
WrapFlocking3D.java:31: cannot find symbol
symbol  : class Point3d
location: class WrapFlocking3D
  private static final Point3d USERPOSN = new Point3d(0,5,20);
                       ^
WrapFlocking3D.java:36: cannot find symbol
symbol  : class SimpleUniverse
location: class WrapFlocking3D
  private SimpleUniverse su;
          ^
WrapFlocking3D.java:37: cannot find symbol
symbol  : class BranchGroup
location: class WrapFlocking3D
  private BranchGroup sceneBG;
          ^
WrapFlocking3D.java:38: cannot find symbol
symbol  : class BoundingSphere
location: class WrapFlocking3D
  private BoundingSphere bounds;   // for environment nodes
          ^
WrapFlocking3D.java:116: cannot find symbol
symbol  : class Canvas3D
location: class WrapFlocking3D
  private void orbitControls(Canvas3D c)
                             ^
Boid.java:51: cannot find symbol
symbol  : class Point3f
location: class Boid
      new Point3f( -(float)FLOOR_LEN/2.0f, 0.05f, -(float)FLOOR_LEN/2.0f);
          ^
Boid.java:53: cannot find symbol
symbol  : class Point3f
location: class Boid
      new Point3f( (float)FLOOR_LEN/2.0f, 8.0f, (float)FLOOR_LEN/2.0f);
          ^
Boid.java:69: cannot find symbol
symbol  : class Vector3f
location: class Boid
  protected Vector3f boidPos = new Vector3f();
                                   ^
Boid.java:70: cannot find symbol
symbol  : class Vector3f
location: class Boid
  protected Vector3f boidVel = new Vector3f();
                                   ^
Boid.java:72: cannot find symbol
symbol  : class TransformGroup
location: class Boid
  private TransformGroup boidTG = new TransformGroup();
                                      ^
100 errors

My folder where my .java files for the flocking3d program is:
C:\Flocking3D
And my Java3D folder is:
C:\Program Files\Java\Java3D\1.5.2
this folder has the following sub folders:
bin
lib
What would I need to type to tell my compiler where to find the java3D classes?
Regards

Similar Messages

  • Java3d for distribution

    If we are looking to put together a CD featuring a Java3D game for the educational market. Ideally we want to be able to run the whole thing off the CD in case users do not have J3D installed already. Obviously, that is not a Java3D question, but is there a way to judge on the fly whether the user will require the OpenGL or D3D version?

    ask the user to select which he wants :-P
    I hate programs that try and do things automatically, cos they always get it wrong!
    There are so many different configurations out there, the user usually knows best whether to install dx or gl.

  • Mouse Event Problem

    I need to implement the pseudocode below into a method called cursorNearVertex (xMouse, yMouse). This method should return either a true or false value depending on what part of the canvas the user clicks on. If the user clicks near a graphical vertex (defined in another part of the application not listed) it will return a true value, if they don't click near the vertex it should return a false value. However I don't know what part of the code the method should go in. Any ideas?
    /* Simple polygon selection test
         xMouse, yMouse: coordinates of cursor when mouse was clicked
         xArray, yArray: arrays containing the x and y coordinates of a polygon's vertices
         distance: distance between a vertex and the mouse position
         presetMaxDistance: preset distance below which the cursor is considered to be near enough to a vertex
    cursorNearVertex(xMouse, yMouse) {
         for each vertex {
              distance = (xMouse - xArray[vertex]) * (xMouse - xArray[vertex]) +
                   (yMouse - yArray[vertex]) * (yMouse - yArray[vertex]);
              if (distance < presetMaxDistance)
                   return true;
         return false;
    // Code for mouse click event
    public void serviceMouseEvent(int eventID, int xMousePosition, int yMousePosition)
    switch(eventID)
    case MouseEvent.MOUSE_CLICKED:
    // TO DO: service MOUSE_CLICKED as approriate
    break;
    case MouseEvent.MOUSE_DRAGGED:
    // TO DO: service MOUSE_DRAGGED as approriate
    break;
    case MouseEvent.MOUSE_PRESSED:
    // TO DO: service MOUSE_PRESSED as approriate
    break;
    case MouseEvent.MOUSE_RELEASED:
    // TO DO: service MOUSE_RELEASED as approriate
    break;
    case MouseEvent.MOUSE_MOVED:
    // TO DO: service MOUSE_MOVED as approriate
    break;
    default:
    // TO DO: service "all-other-mouse-states" as approriate
    break;
    Skeleton app: http://student.soc.staffs.ac.uk/~cmtccc/2dg/SkelApp2DGrel1.zip

    This looks like a Java3D question. In which case you might getting better answers to your question if you post it in the Java3d forum.
    http://forum.java.sun.com/forum.jsp?forum=21
    On my limited Java3d knowledge it looks as though you need to call cursorNearVertex(xMouse, yMouse) method everytime there is a MOUSE_CLICKED event.

  • Short question in Java3D!

    Hello,
    I learn completely newly Java and Java3D programming, because of this I have questions on it.
    My current question is an automatic scaling.
    I have partly solved it but it has not quite worked!
    At first I explain the whole task to you briefly so that you can understand this small question.
    The task is around calls of an editor side (.txt) in Java3D.
    This list contains numbers of 3 components points (x, y, z).
    e.g.: (1, 2, 3)
    (2, 4, 6)     
    (3, 5, 7)     
    etc.
    After calling the editor side these points shall be recorded as little balls (with minute radii).
    I have completely taken care of it!
    But the remained problem is:
    Some Editor pages contain 3 components numbers, these sew from each other so are.
    e.g.: (0.01, 0.02, 0.03)
    (0.011, 0.021, 0.031)
    (0.0111, 0.0211, 0.0311)
    etc.
    Only one roll because of this see the balls in the graphic on each other as. i.e:
    We see only one ball.
    I need an automatic scaling for it so that the programme supplies us with the correct drawing to every list
    I must calculate min and Max at this automatic scaling first.
    I have found that the right solution starts me with the following orders:
    Code:
    float minDistance = Float.MAX_VALUE;
    for (int i=0; i<positionen.size(); i++)
    for (int j=i+1; j<positionen.size(); j++)
    Point3f p0 = positionen.get(i);
    Point3f p1 = positionen.get(j);
    minDistance = Math.min(minDistance, p0.distance(p1));
    float faktor = minDistance / (2 * r);
    But I still lack it the correct drawing a small step further, with that me
    get can. Perhaps you have idea as I can make it further?
    The whole program is in the appendix (Hello.zip) on the following internet page. (Hello.java)
    http://rapidshare.com/files/28536450/Hello.java.html
    I have uploaded only the Java page of ball production here.
    I have not uploaded the other Java page of calls of the Editorseite.
    I think we do not need it for this problem.
    But, if it is necessary, I can upload it later.
    Please, somebody can help me at it?
    And as I have already written I am a whole beginner in programming, primarily in Java3D.
    Because we learn very little programming in my course of study "electrical engineering".
    But I learn it as a voluntary traineeship.
    I am immediately available for further explanations.
    I am address within reach also under the following e-mail:
    [email protected]
    Yours
    Angelo

    My Dear Friend, you posted your question in wrong forum,
    Please Post your question here.
    forums.java.net/jive/forum.jspa?forumID=70
    you will find many very good devlopers who can help you...

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

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

  • 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

  • Simple question of java3d

    Dear all,
    I am trying to make a sphere and cube on the same graph. I try to modify the code from http://www.vrupl.evl.uic.edu/LabAccidents/java3d if you run the following code, you can see only a cube. However, if you change the size of sphere from 0.1f to 0.7f, then you will only see a blackscreen. Could anyone please tell me what wrong of the code. The problem should be under createSceneGraph function.
    Thanks
    package java3d01;
    // First we import packages that I use for Java3D
    import java.awt.Frame;
    import java.applet.Applet;
    import java.awt.*;
    import java.awt.event.*;
    import com.sun.j3d.utils.applet.MainFrame;
    import com.sun.j3d.utils.geometry.*;
    import com.sun.j3d.utils.universe.*;
    import javax.media.j3d.*;
    import javax.vecmath.*;
    public class Tools extends Applet { // notice'lesson01', which is also the name of the file : lesson01.java
        SimpleUniverse simpleU; // this is the SimpleUniverse Class that is used for Java3D
         public Tools (){  // this constructor is sometimes needed, even when empty as in here   
         public void init() {
         // this function will be called by both applications and applets
         //this is usually the first function to write       
         setLayout(new BorderLayout()); // standard Java code for BorderLayout
         // Canvas3D is where all the action will be taking place, don't worry, after adding it
         // to your layout, you don't have to touch it.         
            Canvas3D c = new Canvas3D(SimpleUniverse.getPreferredConfiguration());
         // add Canvas3D to center of BorderLayout
             add("Center", c);   
         simpleU= new SimpleUniverse(c); // setup the SimpleUniverse, attach the Canvas3D
         //This is very important, the SceneGraph (where all the action takes place) is created
         //by calling a function which here is called 'createSceneGraph'.
         //The function is not necessary, you can put all your code here, but it is a
         //standard in Java3D to create your SceneGraph contents in the function 'createSceneGraph'
             BranchGroup scene = createSceneGraph();
         //set the ViewingPlatform (where the User is) to nominal, more on this in the next lesson
            simpleU.getViewingPlatform().setNominalViewingTransform();
         // this will optimize your SceneGraph, not necessary, but it will allow your program to run faster.
            scene.compile();
            simpleU.addBranchGraph(scene); //add your SceneGraph to the SimpleUniverse  
        public BranchGroup createSceneGraph() {     
         //Here we will create a basic SceneGraph with a ColorCube object
            BranchGroup objRoot = new BranchGroup();
         TransformGroup cctg = new TransformGroup();      // a TransformGroup for the ColorCube called cctg
         ColorCube c = new ColorCube(0.1f);     // create a ColorCube object
             cctg.addChild(c);                // add ColorCube to cctg
         Sphere sphere = new Sphere(0.1f);
         cctg.addChild(sphere);
            Transform3D cc3d = new Transform3D(); // a Transform3D allows a TransformGroup to move
         cc3d.setTranslation(new Vector3f (0.5f ,0.2f ,0.0f )); // set translation to x=0.8, y=1.0, z= -2.0
         cctg.setTransform(cc3d); //
            objRoot.addChild(cctg);
         return objRoot;
        public void destroy() {     // this function will allow Java3D to clean up upon quiting
         simpleU.removeAllLocales();   
        public static void main(String[] args) {
         // if called as an application, a 500x500 window will be opened   
            Frame frame = new MainFrame(new Tools(), 1000, 1000);   
    }

    Don't use char and switch in this case.
    String answer = JOptionPane.showInputDialog("A/B?");
    if (answer.equalsIgnoreCase("A")) {
    } else if (answer.equalsIgnoreCase("B")) {
    } else {
    }

  • 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

  • Java3D + Newer Eclipse Version - Access Restriction (solution + question)

    Current eclipse versions don't go well with java3d. Programs that worked fine before now produce 100s of strange errors, e.g.
       <tt>"Access restriction: The type SimpleUniverse is not accessible due to restriction on required library C:\Program Files\Java\jre6\lib\ext\j3dutils.jar"</tt>
    Java3D is installed correctly and everything was (and is) working perfectly well with older eclipse versions. I googled for a solution and found out that changing
       <i>Windows -> Preferences -> Java -> Compiler -> Errors/Warnings -> Deprecated and restricted API -> Forbidden reference (access rules)</i>
    to <i>"warning / ignore"</i> eliminated the error(s).
    Can anyone explain me what is going on here? Why is Java3D "Deprecated and restricted"? Is the default setting of eclipse correct or oversuspicious? Did I miss anything else? Will the next java3d / eclipse version be fix this? Do I have to fix this?
    Many thanks in advance!
    Ingo

    Hi,
    my Eclipse Helios SDK 3.6.1 installation also shows this behavior, even if all classes of all three Java 3D-jars are declared as accessible in their access rules! See:
    Project -> Properties -> Java Build Path -> Libraries JRE System Library [JavaSE-1.6] -j3dcore.jar, -j3dutils.jar, -vecmath.jar
    I have no idea what is going on here. Following work arounds do the job well without accepting 'forbidden references':
    A. Per project add the three Java 3D-jars to the Libraries and place them on the top:
    Project -> Properties -> Java Build Path -> Libraries AddExternal JARs.. ..\jre6\lib\ext\j3dcore.jar, j3dutils.jar, vecmath.jar
    Project -> Properties -> Java Build Path -> Order and Export Top j3dcore.jar j3dutils.jar vecmath.jar
    B. An alternative is to create and add a 'User Library' in this way:
    Windows -> Preferences -> Java -> Build Path -> User Libraries 1. New: J3DAll, 2. Add JARs.. select all three at ..\jre6\lib\ext\j3dcore.jar, j3dutils.jar, vecmath.jar
    Project -> Properties -> Java Build Path -> Libraries Add Library .. -> User Library -> Next select J3DAll Finish
    Project -> Properties -> Java Build Path -> Order and Export Top J3DAll
    Does this help? August

  • Java3D Simple Question

    Hello,
    The default view coordinates of SimpleUniverse is from -1 to 1 for all coordinates. But I want to change it to something like;
    X coordinate => min -10 max 10
    Y coordinate => min -10 max 10
    Z coordinate => min 0 max 20
    Please help me,
    Thanks

    Note: This thread was originally posted in the [New To Java|http://forums.sun.com/forum.jspa?forumID=54] forum, but moved to this forum for closer topic alignment.

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

  • 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

  • JAVA3D rotation problem

    I'm using JAVA3D that creates a map. The map is split into 4 parts. I forced each part to rotate only around the X-axis and this is done with the user clicking on it with the mouse. I want to limit the rotation where the user can rotate up to 90 degrees only downwards, and want to eliminate the option of rotation upwards. Is that possible.
    Another question is that when the user rotates one of the parts, the part comes out towards the user. Is it possible i can stop that and make it rotate on itself?
    Thanks in advance

    well my dear friend sorry to disappoint you but i did understand and that's the way rotX/Y/Z work within the Transform3D.
    the behavior you desire by the rotation is based on a cylindric coordinate system in which the point of view will move on the cylinder while the upVector of the lookAt method stay at the Y axis(Y axis is "up" in Java3D).
    since the Transform3d is based on spherical coordinate system you can't use it.
    the only way i know is to write an object as the Transform3d but much simpler, well lets see:
    class Transform extends Transform3D {
       Point3d position=new Point3d();
       Point3d lookingAt=new Point3d(1,0,0); // looking at the x axis
       Vector3d upVector=new Vector3d(0,1,0); // y is up
       double totalAngleXZ=0; // its a must to add the angle and to calculate it from the top since it creates a bug later on
       double totalAngleY=0; // its a must to add the angle and to calculate it from the top since it creates a bug later on
       public void rotXZ(double angle) {
          totalAngleXZ+= angle;
          lookAt();
       public void rotY(double angle) {
          totalAngleY+= angle;
          lookAt();
       private void lookAt() {
            lookingAt.set(Math.cos(totalAngleXZ),Math.cos(totalAngleY),Math.sin(totalAngleXZ));
            lookAt(position,lookingAt,upVector);
    }now if i'm not mistaken this should work...
    best of luck.

  • Loading raw images in java3d

    i am new to java3d, as u can very well know from my last question. i have loaded raw images in awt panels, but how can i do the same with java3d.
    please help me with one more question, if my image is very large, how can i pan through the image?
    also, if anyone can tell me what can i do with images that are not powers of 2?
    its my final semester project. please help me.

    i am new to java3d, as u can very well know from my
    last question. i have loaded raw images in awt panels,
    but how can i do the same with java3d.Use a simple plane in 3d space and put your image as texture on it.
    please help me with one more question, if my image is
    very large, how can i pan through the image?
    also, if anyone can tell me what can i do with images
    that are not powers of 2?
    Resize it. You could use the TexureLoader, which does a resizing afaik.
    its my final semester project. please help me.

Maybe you are looking for

  • Authorization to change attribute co.code

    Hi, We have tested and see that authorization to change attributes is coming from role /SAPSRM/MANAGER. Our goal in here is to make the attribute company code to be changeable for purchaser, but the purchaser cannot change other attribute. Can someon

  • Erratic behaviour/results using DAQmx

    Hi!, One of our PXI based automation systems is not working as expected. The errors we are observing: 1) Timed while loop hangs and is unable to read the clock source. The clock source is TTL pulse train coming from encoder and fed to Counter 0. When

  • No 'Holidays' Calendar

    I want to enable the 'Holidays' calendar in Calendar on my Mac Pro. I opened Preferences>General and both "Show Birthdays Calendar" and "Show Holidays Calendar" are already checked. I have a 'Birthdays' calendar, but no 'Holidays' calendar. I've unch

  • Synergy 3105 Base reset to default - tech. Expert ...

    Hi, I've had my Synergy 3105 for years and for me (with decent 1100mAh re-chargeable) it has been a great system i want to keep. However Handset 2(HS2) developed a display problem then a catastrophic fault. I managed to get 3 more Synergy 3105 handse

  • Remove decimal out of an equation to send to a payment gateway

    i have a value that currently has shows a decimal @$amount = $_POST['amount']; i need the decimal to show until the variable $amount is sent to the payment gateway what is the best way to remove the decimal from the variable so a value of e.g 250.59