aviatrix3d swt problem

Sonnenblume5

Grünschnabel
Hallo,

ich versuche vergeblich das mit gelieferte Beispiel von aviatrix3d swt AnimationDemo zum laufen zu bringen.

Die Klasse schaut so aus:

PHP:
package swt;

// External imports
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

import javax.vecmath.Matrix4f;
import javax.vecmath.Vector3f;

import javax.media.opengl.GLCapabilities;

import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FillLayout;

// Local imports
import org.j3d.aviatrix3d.*;

import org.j3d.aviatrix3d.output.graphics.SimpleSWTSurface;
import org.j3d.aviatrix3d.pipeline.graphics.GraphicsCullStage;
import org.j3d.aviatrix3d.pipeline.graphics.DefaultGraphicsPipeline;
import org.j3d.aviatrix3d.pipeline.graphics.GraphicsOutputDevice;
import org.j3d.aviatrix3d.pipeline.graphics.NullCullStage;
import org.j3d.aviatrix3d.pipeline.graphics.NullSortStage;
import org.j3d.aviatrix3d.pipeline.graphics.GraphicsSortStage;
import org.j3d.aviatrix3d.management.SingleThreadRenderManager;
import org.j3d.aviatrix3d.management.SingleDisplayCollection;

/**
 * Example application that demonstrates how to put together a single-threaded
 * rendering system.
 *
 * @author Justin Couch
 * @version $Revision: 1.7 $
 */
public class AnimationDemo
{
    /** Manager for the scene graph handling */
    private SingleThreadRenderManager sceneManager;

    /** Manager for the layers etc */
    private SingleDisplayCollection displayManager;

    /** Our drawing surface */
    private GraphicsOutputDevice surface;

    /**
     * Create a new demo instance.
     *
     * @param parent The parent widget of the display
     */
    public AnimationDemo(Shell parent)
    {
        setupAviatrix(parent);
        setupSceneGraph();

        sceneManager.setEnabled(true);
    }

    /**
     * Setup the avaiatrix pipeline here
     */
    private void setupAviatrix(Shell parent)
    {
        // Assemble a simple single-threaded pipeline.
        GLCapabilities caps = new GLCapabilities();
        caps.setDoubleBuffered(true);
        caps.setHardwareAccelerated(true);

        GraphicsCullStage culler = new NullCullStage();
        culler.setOffscreenCheckEnabled(false);

        GraphicsSortStage sorter = new NullSortStage();
        surface = new SimpleSWTSurface(parent, SWT.NONE, caps);
        DefaultGraphicsPipeline pipeline = new DefaultGraphicsPipeline();

        pipeline.setCuller(culler);
        pipeline.setSorter(sorter);
        pipeline.setGraphicsOutputDevice(surface);

        displayManager = new SingleDisplayCollection();
        displayManager.addPipeline(pipeline);

        // Render manager
        sceneManager = new SingleThreadRenderManager();
        sceneManager.addDisplay(displayManager);
        sceneManager.setMinimumFrameInterval(100);
    }

    /**
     * Setup the basic scene which consists of a quad and a viewpoint
     */
    private void setupSceneGraph()
    {
        // View group

        Viewpoint vp = new Viewpoint();

        Vector3f trans = new Vector3f(0, 0, 1);

        Matrix4f mat = new Matrix4f();
        mat.setIdentity();
        mat.setTranslation(trans);

        TransformGroup tx = new TransformGroup();
        tx.addChild(vp);
        tx.setTransform(mat);

        Group scene_root = new Group();
        scene_root.addChild(tx);

        // Flat panel that has the viewable object as the demo
        float[] coord = { 0, 0, -1, 0.25f, 0, -1, 0, 0.25f, -1 };
        float[] normal = { 0, 0, 1, 0, 0, 1, 0, 0, 1 };
        float[] color = { 0, 0, 1, 0, 1, 0, 1, 0, 0 };

        TriangleArray geom = new TriangleArray();
        geom.setValidVertexCount(3);
        geom.setVertices(TriangleArray.COORDINATE_3, coord);
        geom.setNormals(normal);
        geom.setColors(false, color);

        Shape3D shape = new Shape3D();
        shape.setGeometry(geom);

        trans.set(0.5f, 0, 0);
        Matrix4f mat2 = new Matrix4f();
        mat2.setIdentity();
        mat2.setTranslation(trans);

        TransformGroup shape_transform = new TransformGroup();
        shape_transform.addChild(shape);
        shape_transform.setTransform(mat2);

        scene_root.addChild(shape_transform);

        SimpleScene scene = new SimpleScene();
        scene.setRenderedGeometry(scene_root);
        scene.setActiveView(vp);

        // Then the basic layer and viewport at the top:
        SimpleViewport view = new SimpleViewport();
        view.setDimensions(0, 0, 500, 500);
        view.setScene(scene);

        SimpleLayer layer = new SimpleLayer();
        layer.setViewport(view);

        Layer[] layers = { layer };
        displayManager.setLayers(layers, 1);

        RotationAnimation anim = new RotationAnimation(shape_transform);
        sceneManager.setApplicationObserver(anim);
    }

    /**
     * Cause the rendering cycle to exit now.
     */
    public void shutdown()
    {
        sceneManager.shutdown();
    }

    //---------------------------------------------------------------
    // Local methods
    //---------------------------------------------------------------

    public static void main(String[] args)
    {
        Shell shell = new Shell();
        shell.setLayout(new FillLayout());
        AnimationDemo demo = new AnimationDemo(shell);

        shell.setSize (640, 480);
        shell.setText("Basic AV3D Animation + SWT Demo");
        shell.open();

        Display display = shell.getDisplay();

        while(!shell.isDisposed())
        {
            if(!display.readAndDispatch())
                display.sleep();
        }

        demo.shutdown();
        display.dispose();
    }
}


PHP:
Exception in thread "main" javax.media.opengl.GLException: java.lang.ClassNotFoundException: org.j3d.opengl.swt.SWTRIDrawableFactory
	at javax.media.opengl.GLDrawableFactory.getFactory(GLDrawableFactory.java:120)
	at org.j3d.opengl.swt.GLCanvas.<init>(GLCanvas.java:122)
	at org.j3d.aviatrix3d.output.graphics.SimpleSWTSurface.init(SimpleSWTSurface.java:244)
	at org.j3d.aviatrix3d.output.graphics.SimpleSWTSurface.<init>(SimpleSWTSurface.java:214)
	at org.j3d.aviatrix3d.output.graphics.SimpleSWTSurface.<init>(SimpleSWTSurface.java:49)
	at swt.AnimationDemo.setupAviatrix(AnimationDemo.java:73)
	at swt.AnimationDemo.<init>(AnimationDemo.java:53)
	at swt.AnimationDemo.main(AnimationDemo.java:171)
Caused by: java.lang.ClassNotFoundException: org.j3d.opengl.swt.SWTRIDrawableFactory
	at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:169)
	at javax.media.opengl.GLDrawableFactory.getFactory(GLDrawableFactory.java:104)
	... 7 more

ich hab folgende libaries in meinen build path:

aviatrix3d-all_2.0.0.jar
aviatrix3d-core_2.0.0.jar
aviatrix3d-utils_2.0.0.jar
org.eclipse.draw2d_3.2.1.jar
j3d-org-util.jar
j3d-org-opengl-swt.jar
org.j3d.aviatrix3d_2.0.0.jar
org.j3d.core_0.9.jar
j3d-org-elumens.jar
j3d-org-geom-core.jar
j3d-org-geom-hanim.jar
j3d-org-geom-particle.jar
j3d-org-geom-terrain.jar
j3d-org-loader-3ds.jar
j3d-org-loader-core.jar
j3d-org-loader-dem.jar
j3d-org-loader-stl.jar
j3d-org-loader-vterrain.jar
j3d-org-navigation.jar
j3d-org-texture.jar
vecmath.jar
jogl.jar

hat von euch jemand schon mal diese Beispiele ausprobiert? Ich denke ich habe vllt. falsche Libaries reingeladen?

ich wuerde mich sehr freuen wenn jemand rat wuesste

vielen dank
 
Hast du wirklich alle Jars die mit dabei waren in deinen Classpath eingebunden? Schau doch mal in die Jars rein ob du dort die Klasse org.j3d.opengl.swt.SWTRIDrawableFactory finden kannst.
 
Zurück