Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

11997 Posts in 1588 Topics- by 3508 Members - Latest Member: PienueDut

26. May 2012, 11:41:35 am
Xith3D CommunityGeneral CategoryGeneral Discussion (Moderators: Marvin Fröhlich, 'n ddrylliog)problems when i try to load MD2 files
Pages: [1]
Print
Author Topic: problems when i try to load MD2 files  (Read 657 times)
qq349689821
Just dropped in

Offline Offline

Posts: 4

qq349689821@hotmail.com
View Profile Email
« on: 06. June 2009, 03:12:34 pm »

hi guys,I'm newer here,I got a problem when i try to load MD2 files.But when I lanuch the code below,can sb tell why? thank you very much and sorry for my English
I see nothing in my CANVAS,(and I change many models,but the problems still exist)

Code:
public class LoadMODEL extends InputAdapterRenderLoop
{
Point3f eyePosition = new Point3f( 2.41f, 0f, 0f );
Point3f viewFocus = new Point3f( 0f, 0f, 0f );
Vector3f vecUp = Vector3f.POSITIVE_Y_AXIS;

    private BranchGroup createScene( ResourceLocator resLoc, Animator animator ) throws Exception
    {
        MD2Model model = new MD2Loader().loadModel( resLoc.getResource("models/tris.MD2") );
       
        TransformationDirectives rotDirecs =
                            new TransformationDirectives( 0.3f, 0.2f, 0f );
        RotatableGroup rg = new RotatableGroup( rotDirecs );
       
        rg.addChild( model );
        animator.addAnimatableObject( rg );
       
        return( new BranchGroup( rg ) );
    }
   
    Xith3DEnvironment env;
    public LoadMODEL() throws Exception
    {
        super( 10f );
       
         env = new Xith3DEnvironment( this );
       
        Canvas3D canvas = Canvas3DFactory.createWindowed( 800, 600,
                                                          "Model Loading"
                                                        );
        canvas.disableLighting(); // either do this or add a light source!
        this.getInputManager().registerKeyboardAndMouse( canvas );
       
        env.addCanvas( canvas );
       
        ResourceLocator resLoc = ResourceLocator.create( "test-resources/" );
       
        resLoc.createAndAddTSL( "textures" );
       
        env.addPerspectiveBranch( createScene( resLoc, this.getAnimator() ) );
       
        env.getView().lookAt(eyePosition, viewFocus, vecUp);
        this.begin();
    }
   
    public static void main( String[] args ) throws Exception
    {
        new LoadMODEL();
    }
« Last Edit: 06. June 2009, 06:34:14 pm by Marvin Fröhlich » Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #1 on: 06. June 2009, 06:35:16 pm »

Pleasae update to the latest SVN trunk and try again. You seem to be using some older code.

Marvin
Logged
qq349689821
Just dropped in

Offline Offline

Posts: 4

qq349689821@hotmail.com
View Profile Email
« Reply #2 on: 07. June 2009, 02:14:42 am »

THANK YOU.
But I not get the "org.xith3d.loaders.models.impl.md2" package.
I try to use blender files.

I want to know where can I find some tutorial of shadows and others
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #3 on: 07. June 2009, 03:28:55 am »

But I not get the "org.xith3d.loaders.models.impl.md2" package.
I try to use blender files.

You don't need it anymore. Simply load a model this way:
Code:
ModelLoader.getInstance().loadModel( ... );

I want to know where can I find some tutorial of shadows and others

It's all in xith-tk SVN.

Marvin
Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic