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 (652)
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 / Problem with 3ds loader on: 2007-10-31 16:26:33
I've tried starfire loader for .3ds files, and I cannot see anything. Yes, it loads OK (no errors) but no image is seen.
here is my code

import java.awt.*;
import com.sun.j3d.utils.geometry.*;
import javax.vecmath.*;
import java.applet.Applet;
import com.sun.j3d.utils.applet.MainFrame;
import com.sun.j3d.utils.universe.*;
import com.sun.j3d.loaders.Scene;
import com.sun.j3d.loaders.ParsingErrorException;
import com.sun.j3d.loaders.IncorrectFormatException;
import com.mnstarfire.loaders3d.Loader3DS;
//import com.microcrowd.loader.java3d.max3ds.Loader3DS;
//import com.mnstarfire.loaders3d.Inspector3DS;
public class load3d extends Applet
  private Canvas3D c;
       public load3d()
              setLayout(new BorderLayout());
              GraphicsConfiguration config =
              c = new Canvas3D(config);
              SimpleUniverse u = new SimpleUniverse();
              BranchGroup scene = createSceneBranchGroup();
       protected BranchGroup createSceneBranchGroup()
              BranchGroup objRoot = new BranchGroup();
              TransformGroup objTrans1 = new TransformGroup();
              Transform3D tr = new Transform3D();
              objTrans1.getTransform( tr );
           // tr.rotX(90.0 * Math.PI / 180.0);
              tr.setScale( 0.7 );
              objTrans1.setTransform( tr );
              TransformGroup objTrans2 = new TransformGroup();
    BoundingSphere bounds = new BoundingSphere(
                                      new Point3d(0.0,0.0,0.0), 100.0);
              //Set up the global lights
              Color3f lColor1 = new Color3f(0.7f, 0.7f, 0.7f);
              Vector3f lDir1 = new Vector3f(1.0f, 1.0f, 1.0f);
              Color3f alColor = new Color3f(0.2f, 0.2f, 0.2f);
              AmbientLight aLgt = new AmbientLight(alColor);
              DirectionalLight lgt1 = new DirectionalLight(lColor1, lDir1);
             //load the object file
                Loader3DS loader = new Loader3DS();
                 Scene scene = null;
    scene = loader.load("3Dimka_Pink_Panther_ready.3DS");
    catch (Exception e)
              scene = null;
              if( scene == null )
              //connect the scenegraph
              objTrans2.addChild( scene.getSceneGroup() );
              objTrans1.addChild( objTrans2 );  
              objRoot.addChild( objTrans1 );
    // Set up the background
              Color3f bgColor = new Color3f(0.05f, 0.05f, 0.5f);
              Background bgNode = new Background(bgColor);
              return objRoot;
       public static void main(String[] args)
              load3d t = new load3d();              

I tried to use obj loader and it work but without the color

what should I do to get the model on screen, is it something wrong with the model if so please show me where I can get a model that works(just for the test).

Does anyone have an example that uses any of the free .3ds loaders that actually WORKS?

2  Java Game APIs & Engines / Java 3D / Re: How can I use loader on: 2007-09-30 20:05:23
Thank you darkpegasus ,
I put the full file bath and there was no error , but the box did'nt appear. Embarrassed
I want to use 3DS loader but , I don't know how . Roll Eyes
 Must I download 3DS loader?! and where I can find it ?
and if you have any complete example please give me.
3  Java Game APIs & Engines / Java 3D / How can I use loader on: 2007-09-30 18:46:10
I drew the box in 3d max and I want to display it using java 3d
my question are in what format can I export the box and how can I use loader
I tried before and this my tries:
I export the file in .OBJ format

import com.sun.j3d.loaders.objectfile.ObjectFile;
 import com.sun.j3d.loaders.ParsingErrorException;
 import com.sun.j3d.loaders.IncorrectFormatException;
 import com.sun.j3d.loaders.Scene;
 import java.applet.Applet;
 import javax.vecmath.*;

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

 public class ObjLoad extends Applet {

 private String filename = "test";

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

 ObjectFile f = new ObjectFile();
Scene s = null;
 try {
 s = f.load(filename);
 catch (FileNotFoundException e) {
 catch (ParsingErrorException e) {
 catch (IncorrectFormatException e) {

 return objRoot;
 public ObjLoad() {
        setLayout(new BorderLayout());
        GraphicsConfiguration config =

        Canvas3D canvas3D = new Canvas3D(config);
        add("Center", canvas3D);

        BranchGroup scene = createSceneGraph();

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

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

    } // end of HelloJava3Db (constructor)
    //  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 ObjLoad(), 256, 256);
    } // end of main (method of HelloJava3Db)

} // end of class HelloJava3D
and I have this error in the run time: test (The system cannot find the file specified)

 ----jGRASP wedge2: exit code for process is 1.
 ----jGRASP: operation complete.
Pages: [1]
SHC (22 views)
2015-08-01 03:58:20

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

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

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

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

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

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

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

BurntPizza (28 views)
2015-07-24 06:06:53

NoxInc (36 views)
2015-07-22 22:16: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!