Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (522)
Games in Android Showcase (127)
games submitted by our members
Games in WIP (590)
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  
  Bug using Xith3D and LWJGL  (Read 951 times)
0 Members and 1 Guest are viewing this topic.
Offline jeep

Senior Newbie





« Posted 2005-10-10 06:21:13 »

I tried both the May and August release of LWJGL. I'm using the August 19 release of Xith3D and using Java 1.5 Update 5. Sapphire ATI Radeon 9800 Pro on WinXP. It looks like it may be in LWJGL from the GL11 JNI:

   public static void glGetInteger(int pname, IntBuffer params) {
      long function_pointer = GLContext.getCapabilities().GL11_glGetIntegerv_pointer;
      BufferChecks.checkFunctionAddress(function_pointer);
      BufferChecks.checkBuffer(params, 16);
      nglGetIntegerv(pname, params, params.position(), function_pointer);
   }
   private static native void nglGetIntegerv(int pname, IntBuffer params, int params_position, long function_pointer);

     [exec] int1: java.nio.DirectIntBufferU[pos=0 lim=16 cap=16]
    exec]     at org.lwjgl.opengl.GL11.glGetInteger(GL11.java:1161)
    exec]     at com.xith3d.render.lwjgl.CanvasPeerImpl.render(CanvasPeerImpl.java:1035)
     [exec]     at com.xith3d.scenegraph.View.renderOnce(View.java:604)
    exec]     at java.lang.Thread.run(Thread.java:595)
    exec]     at com.xith3d.render.lwjgl.CanvasPeerImpl.render(CanvasPeerImpl.java:1035)
     [exec]     at com.xith3d.scenegraph.View.renderOnce(View.java:604)
    exec]     at java.lang.Thread.run(Thread.java:595)
    exec]     at com.xith3d.render.lwjgl.CanvasPeerImpl.renderStart(CanvasPeerImpl.java:285)
     [exec]     at com.xith3d.render.lwjgl.CanvasPeerImpl.display(CanvasPeerImpl.java:868)
     [exec]     ... 5 more

comes after this code executes....which is from the getting started tutorial....

    private void buildBaseSceneGraph()
    {
        // Construct the root of the scene graph
        universe = new VirtualUniverse();
        view = new View();
        universe.addView(view);
        locale = new Locale();
        universe.addLocale(locale);
        scene = new BranchGroup();
        locale.addBranchGraph(scene);

        // Create an initial rotation transformation
        Transform3D rotate = new Transform3D();
        rotate.rotXYZ(
            (float) Math.PI/4,
            (float) Math.PI/5,
            (float) Math.PI/2);
        TransformGroup objRotate = new TransformGroup(rotate);

        // Add to rotation object to scene graph
        scene.addChild(objRotate);

        // Create an add an initial cube to the rotation object
        Geometry g = Cube.createCubeViaTriangles(0, 0, 0, 1, true);
        Shape3D sh = new Shape3D(g);
        objRotate.addChild(sh);

        // draw a quad in the lower-left corner
        Shape3D sh4 = new Shape3D(createQuad(), new Appearance());
        scene.addChild(sh4);

        // Compile the scene for the renderer. Not necessary here.
        scene.compile();

        // Now we still need a Canvas for displaying our cube. We use
        // RenderPeer and CanvasPeer, which are an abstraction layer enabling
        // us to use Jogl and LWJGL. We can specify the owner, the dimension,
        // the color depth and fullscreen mode.
        RenderPeer rp;
        if (rendererType == RendererType.JOGL)
            rp = new com.xith3d.render.jogl.RenderPeerImpl();
        else
            rp = new com.xith3d.render.lwjgl.RenderPeerImpl();
        CanvasPeer cp = rp.makeCanvas(null, 640, 480, 32, false);
        Canvas3D canvas = new Canvas3D();
        canvas.set3DPeer(cp);
        view.addCanvas3D(canvas);

        // After adding the canvas to the view component of our scenegraph
        // the only thing remaining is to set back the position of the viewer.
        // We do this by modifying a Transform3D component of view. The first
        // vector is the position of the eye of the viewer. Because the z-axis
        // is pointing towards us we use a positive z value. The value should
        // be large enough to be outside the cube. The next vector specifies
        // the center of view. The third vector specifies the up direction which
        // is the positive y-axis here.
        view.getTransform().lookAt(
            new Vector3f(0, 0, 2.41f), // location of eye
            new Vector3f( 0, 0, 0), // center of view
            new Vector3f( 0, 1, 0)); // vector pointing up
        view.startView();
    }

    /**
     * QuadArray is used here. Four points are one quad.
     */
    public Geometry createQuad()
    {
        Point3f[] coords = new Point3f[]
        {
            new Point3f( 0,  0, 0),
            new Point3f(-1,  0, 0),
            new Point3f(-1, -1, 0),
            new Point3f( 0, -1, 0),
        };

        Color3f[] colors = new Color3f[]
        {
            new Color3f(1,0,0),
            new Color3f(1,1,1),
            new Color3f(0,1,0),
            new Color3f(1,1,1)
        };

        QuadArray g = new QuadArray(coords.length, GeometryArray.COORDINATES
            | GeometryArray.COLOR_3);
        g.setCoordinates(0,coords);
        g.setColors(0,colors);

        return g;
    }
Offline William Denniss

JGO Coder


Projects: 2


Fire at will


« Reply #1 - Posted 2005-10-11 11:07:35 »

Do you think the bug is in LWJGL or Xith3D?  They have possibly fixed it if it is LWJGL.

Will.

Offline jeep

Senior Newbie





« Reply #2 - Posted 2005-10-15 12:03:18 »

could be anything:

1. bug with with jni and lwjgl, either caused internally by my graphics card setup or lwjgl
2. something being passed incorrectly by xith3d
3. something i'm not doing to load lwjgl correctly where it works with jogl

of course i don't want to point the finger at myself with #3. i rather point it at poor documentation. Wink

i could of course improve my debugging skills with a debugger, find out the values being passed around, and find out what the "... 5 more" is.

i'm thinking it could have just been the fact i was using a non-power-of-2 texture. but i think i get the same thing without textures. i'll double check on it once i get a code reorganization complete to test geometry again....i got sidetracked with trying to get jogl to do true fullscreen.
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

trollwarrior1 (27 views)
2014-11-22 12:13:56

xFryIx (69 views)
2014-11-13 12:34:49

digdugdiggy (48 views)
2014-11-12 21:11:50

digdugdiggy (42 views)
2014-11-12 21:10:15

digdugdiggy (36 views)
2014-11-12 21:09:33

kovacsa (60 views)
2014-11-07 19:57:14

TehJavaDev (64 views)
2014-11-03 22:04:50

BurntPizza (62 views)
2014-11-03 18:54:52

moogie (77 views)
2014-11-03 06:22:04

CopyableCougar4 (77 views)
2014-11-01 23:36:41
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
java-gaming.org 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‑gaming.org
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!