Hi !
Featured games (84)
games approved by the League of Dukes
Games in Showcase (604)
Games in Android Showcase (171)
games submitted by our members
Games in WIP (654)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Java Game APIs & Engines / Java 3D / Trouble with loading a model (solved) on: 2007-09-13 00:09:02
I tried to load a model into my Program, but the model just doesn't appear Huh. I debugged the whole thing a couple of times and to me it looks like the loading itself is fine. I hope you can help me, because this thing is bugging me for about a week and i can't come up with a solution myself for some unknown reason  Cry

import java.applet.Applet;

import java.awt.BorderLayout;
import java.awt.Frame;
import java.awt.GraphicsConfiguration;

import com.sun.j3d.utils.applet.MainFrame;

import com.sun.j3d.utils.universe.SimpleUniverse;

import com.sun.j3d.loaders.*;
import com.glyphein.j3d.loaders.milkshape.MS3DLoader;

public class Flasche extends Applet
   public Flasche()
      setLayout(new BorderLayout());
      GraphicsConfiguration gc = SimpleUniverse.getPreferredConfiguration();
      Canvas3D canvas = new Canvas3D(gc);
      BranchGroup bg = createScene();
      SimpleUniverse bottle = new SimpleUniverse(canvas);
   public BranchGroup createScene()
      BranchGroup root = new BranchGroup();
      Scene scene = null;
      Loader loader = new MS3DLoader(MS3DLoader.LOAD_ALL);
       file = new"./flasche.ms3d");
          if (file.getParent() != null)
            if (file.getParent().length() > 0) // figure out the base path
              loader.setBasePath(file.getParent() +;
          scene = loader.load(file.getName());

      catch(Exception e)

      return root;
   public static void main(String[] args)
      Frame mf = new MainFrame(new Flasche(),500,500);

September 12, 2007, 05:22:26 pm :
solved the problem myself by adding a background, maybe this might help others, who are also new to java3d, because this was never mentioned on any tutorial i read this far

public BranchGroup createScene()
      ... //same code as stated above

       //the new code segment
       Background back = new Background();
       BoundingSphere bounds = new BoundingSphere(new Point3d(0,0,0), 100.0d);
       back.setColor(0.0f, 0.0f, 1.0f);
     ... //return statement as listed above

Finally I can continue my studies on java3d in my spare time Grin
2  Java Game APIs & Engines / Java 3D / Re: Trouble with suns Java 3d tutorial on: 2007-08-24 14:54:43
thanks for your help, it did work:) now it's time to continue my studies on the java 3d tutorial:)
3  Java Game APIs & Engines / Java 3D / Trouble with suns Java 3d tutorial (solved) on: 2007-08-23 17:27:15
Hallo, i tried to learn something about java 3d by following sun's java 3d tutorial step by step but everytime i try to compile i get a NullPointerException. The code from the Example is listed below, I'm working with the Eclipse IDE on a Windows system (which shouldn't matter anyway, because it should work on any IDE / OS, but I listed those things just in case...)


import java.applet.Applet;
import java.awt.BorderLayout;
import java.awt.Frame;
import java.awt.event.*;
import com.sun.j3d.utils.applet.MainFrame;
import com.sun.j3d.utils.universe.*;
import com.sun.j3d.utils.geometry.ColorCube;
import javax.vecmath.*;

public class HelloJava3Da extends Applet
   public HelloJava3Da()
      setLayout(new BorderLayout());
      Canvas3D canvas3D = new Canvas3D(null);
      add("Center", canvas3D);

      BranchGroup scene = createSceneGraph();

    // SimpleUniverse is a Convenience Utility class
      SimpleUniverse simpleU = new SimpleUniverse(canvas3D);

      // This moves the ViewPlatform back a bit so the
      // objects in the scene can be viewed.

   } // end of HelloJava3Da (constructor)

   public BranchGroup createSceneGraph()
   // Create the root of the branch graph
      BranchGroup objRoot = new BranchGroup();

   // Create a simple shape leaf node, add it to the scene graph.
   // ColorCube is a Convenience Utility class
      objRoot.addChild(new ColorCube(0.4));

      return objRoot;
   } // end of createSceneGraph method of HelloJava3Da
   // The following allows this to be run as an application
   // as well as an applet

   public static void main(String[] args)
       Frame frame = new MainFrame(new HelloJava3Da(), 256, 256);
   } // end of main (method of HelloJava3Da)

Pages: [1]
bilznatch (24 views)
2015-08-04 11:03:17

SHC (39 views)
2015-08-01 03:58:20

Jesse (24 views)
2015-07-29 04:35:27

Riven (46 views)
2015-07-27 16:38:00

Riven (25 views)
2015-07-27 15:35:20

Riven (27 views)
2015-07-27 12:26:13

Riven (18 views)
2015-07-27 12:23:39

BurntPizza (41 views)
2015-07-25 00:14:37

BurntPizza (54 views)
2015-07-24 22:06:39

BurntPizza (33 views)
2015-07-24 06:06:53
List of Learning Resources
by gouessej
2015-07-09 11:29:36

How Do I Expand My Game?
by bashfrog
2015-06-14 11:34:43

List of Learning Resources
by PocketCrafter7
2015-05-31 05:37:30

Intersection Methods
by Roquen
2015-05-29 08:19:33

List of Learning Resources
by SilverTiger
2015-05-05 10:20:32

How to: JGO Wiki
by Mac70
2015-02-17 20:56:16

2D Dynamic Lighting
by ThePixelPony
2015-01-01 20:25:42

How do I start Java Game Development?
by gouessej
2014-12-27 19:41:21 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!