Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (757)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (844)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Problem with 3ds loader  (Read 3205 times)
0 Members and 1 Guest are viewing this topic.
Offline Rahoobah

Junior Newbie

« Posted 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?

Offline Herkules

Senior Devvie

Friendly fire isn't friendly!

« Reply #1 - Posted 2007-11-07 15:32:09 » uses Starfires 3DS loader successfully.

If you like, I can give further hints where it is actually used in the source tree. Look for 'scene3d' project as a small-scale example.

HARDCODE    --     DRTS/FlyingGuns/JPilot/JXInput  --    skype me: joerg.plewe
Pages: [1]
  ignore  |  Print  

EgonOlsen (59 views)
2018-06-10 19:43:48

EgonOlsen (42 views)
2018-06-10 19:43:44

EgonOlsen (61 views)
2018-06-10 19:43:20

DesertCoockie (240 views)
2018-05-13 18:23:11

nelsongames (142 views)
2018-04-24 18:15:36

nelsongames (141 views)
2018-04-24 18:14:32

ivj94 (883 views)
2018-03-24 14:47:39

ivj94 (144 views)
2018-03-24 14:46:31

ivj94 (795 views)
2018-03-24 14:43:53

Solater (159 views)
2018-03-17 05:04:08
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 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!