Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

11991 Posts in 1587 Topics- by 3508 Members - Latest Member: NevilleKemp

26. May 2012, 05:55:01 pm
Xith3D CommunityGeneral CategorySupport (Moderator: Marvin Fröhlich)how to use the Xith3D in the eclipse
Pages: [1]
Print
Author Topic: how to use the Xith3D in the eclipse  (Read 255 times)
Eastman
Just dropped in

Offline Offline

Posts: 1


View Profile Email
« on: 19. July 2011, 02:29:35 am »

I download the xith3d from svn,but I don't know how to begin with it.I built the project that like this :
Code:
import java.io.File;
import javax.vecmath.Vector3f;
import net.jtank.input.KeyCode;
import org.xith3d.geometry.Cube;
import org.xith3d.loaders.texture.TextureLoader;
import org.xith3d.loaders.texture.TextureStreamLocatorFile;
import org.xith3d.render.base.Xith3DEnvironment;
import org.xith3d.render.canvas.Canvas3DWrapper;
import org.xith3d.render.canvas.Canvas3DWrapper.Resolution;
import org.xith3d.render.loop.RenderLoop;
import org.xith3d.scenegraph.BranchGroup;
public class TestXith extends RenderLoop
{
    public void onKeyReleased(int key)
    {
        switch (key)
        {
            case KeyCode.VK_ESCAPE:
                this.end();
                break;
        }
    }
    private BranchGroup createScene()
    {
        Cube cube = new Cube( "stone.jpg", false, 3.0f );        BranchGroup bg = new BranchGroup();
        bg.addChild( cube );
        return( bg );
    }
    public XithTest()
    {
        super( 128L );
        Xith3DEnvironment env = new Xith3DEnvironment( new Vector3f( 3f, 2f, 5f ),
                                                       new Vector3f( 0f, 0f, 0f ),
                                                       new Vector3f( 0f, 1f, 0f ),
                                                       this );
        Canvas3DWrapper canvas = Canvas3DWrapper.createStandalone(
                                                 Resolution.RES_800X600,
                                                 "My empty scene" );
        this.registerKeyboardAndMouse( canvas );
        env.addCanvas( canvas );
        TextureLoader.getInstance().addTextureStreamLocator(
                   new TextureStreamLocatorFile( new File( "demo/textures") ) );
        env.addPerspectiveBranch( createScene() );
        this.begin();
    }
    public static void main(String[] args)
    {
        new XithTest();
    }
}

But there are lots problems,such as there are not exist the followed libs:
import net.jtank.input.KeyCode;
import org.xith3d.geometry.Cube;

please give me some suggestions!thanks vary much
« Last Edit: 19. July 2011, 09:30:55 pm by Marvin Fröhlich » Logged
lonesomeStranger
Becoming dependent
**
Offline Offline

Posts: 111

197432680
View Profile
« Reply #1 on: 19. July 2011, 08:12:39 am »

You used an obsolete code.
Read XIN as well as look at xith-tk project for examples.
Also, unlink sun vecmath library - xith3d uses openmali instead.
Logged

Anton
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic