LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-30-2009, 08:34 AM   #1
aihaike
Member
 
Registered: Feb 2006
Location: Paris, France
Distribution: Slackware, CentOS
Posts: 270

Rep: Reputation: 20
Question Java 3D


Dear all,

I'm new in Java3D (and in Java as well) and trying to run the following code on an inspiron 1525 under Slackware 13.
I've just installed jdk1.7.0 and java3d-1_5_1.
I can execute 3D Java applet from the web but when I run a code I compile I just get a white window.

Here is the code:

Code:
import com.sun.j3d.utils.geometry.*;

import com.sun.j3d.utils.universe.*;

import javax.media.j3d.*;

import javax.vecmath.*;

public class Ball {

public Ball() {

   // Create the universe

   SimpleUniverse universe = new SimpleUniverse();

   // Create a structure to contain objects

   BranchGroup group = new BranchGroup();

   // Create a ball and add it to the group of objects

   Sphere sphere = new Sphere(0.5f);

   group.addChild(sphere);

   // Create a red light that shines for 100m from the origin

   Color3f light1Color = new Color3f(1.8f, 0.1f, 0.1f);

   BoundingSphere bounds =

   new BoundingSphere(new Point3d(0.0,0.0,0.0), 100.0);

   Vector3f light1Direction = new Vector3f(4.0f, -7.0f, -12.0f);

   DirectionalLight light1

      = new DirectionalLight(light1Color, light1Direction);

   light1.setInfluencingBounds(bounds);

   group.addChild(light1);

   // look towards the ball

   universe.getViewingPlatform().setNominalViewingTransform();

   // add the group of objects to the Universe

   universe.addBranchGraph(group);

}

public static void main(String[] args) { new Ball(); }

}
It compile well doing

Code:
javac Ball.java
But when I do

Code:
java Ball
I get

Code:
Java 3D WARNING : reported GLX version = 1.2
    GLX version 1.3 or higher is required
    The reported version number may be incorrect.  There is a known
    ATI driver bug in glXQueryVersion that incorrectly reports the GLX
    version as 1.2 when it really is 1.3, so Java 3D will attempt to
    run anyway.
and a white window.

Does someone have any idea about that?

Thanks in advance,

Eric.
 
Old 09-30-2009, 03:50 PM   #2
Sangaho
LQ Newbie
 
Registered: Jul 2007
Posts: 4

Rep: Reputation: 0
Looks like Java 3D requires GLX version 1.3 or higher, but you have either (1) GLX v. 1.2 installed, or (2) 1.3, but your system is erroneously reporting it as 1.2.

It'll probably be the latter, but you should still check. Type in "glxinfo | grep version" in a command line window to see what you have installed.
 
Old 09-30-2009, 03:55 PM   #3
aihaike
Member
 
Registered: Feb 2006
Location: Paris, France
Distribution: Slackware, CentOS
Posts: 270

Original Poster
Rep: Reputation: 20
Sorry I forgot to put this information ...
When I do

Code:
glxinfo | grep VERSION
I get

Code:
GL_VERSION: 2.1 Mesa 7.5
GLU_VERSION: 1.3
GLUT_API_VERSION: 5
So it seems to me that I have GLX 1.3 installed.
In this case, Jave reports the wrong version but it does not explain the white window.

Did I miss something?

Eric.
 
Old 09-30-2009, 07:50 PM   #4
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
I ran into a similar problem some time ago. This gave me more information:

export J2D_TRACE_LEVEL=4
java -Dsun.java2d.opengl=True -jar myapplication.jar

Unfortunately I forgot what it does, I copied this from the history file. Fortunately it was untouched on that machine, it is almost a year ago.

My conclusion was eventually that the graphics card did not support that very special GLX mode Java wants to use. When I inserted a slightly newer NVIDIA card it would display 3D allright.

What makes it complicated is that although glxinfo shows the correct modes are present, java doesn't want to use them.

Ah now I remember what those options did. It shows that java tries a number of GLX modes and find that they are not present or not satisfactory and eventually defaults to a white screen. It has something to do with color buffers and color depth. Java needs a certain combination of those to be happy.

jlinkels
 
Old 10-01-2009, 04:59 AM   #5
aihaike
Member
 
Registered: Feb 2006
Location: Paris, France
Distribution: Slackware, CentOS
Posts: 270

Original Poster
Rep: Reputation: 20
ok I use your two lines and I got

Code:
[I] GLXGC_FindBestVisual: scn=0
[I] GLXGC_InitGLX
[I] OGLFuncs_OpenLibrary
[I] OGLFuncs_InitPlatformFuncs
[I] OGLFuncs_InitBaseFuncs
[I] OGLFuncs_InitExtFuncs
[I] GLXGC_InitGLX: client GLX version=1.4
[I] GLXGC_InitFBConfig: scn=0 vis=0x0
[V]   candidate fbconfigs:
[V]     id=0xcc db=0 alpha=0 depth=24 stencil=0 valid=false (bad match)
[V]     id=0xee db=0 alpha=0 depth=24 stencil=0 valid=false (bad match)
[V]     id=0xd2 db=0 alpha=0 depth=24 stencil=8 valid=false (bad match)
[V]     id=0xf4 db=0 alpha=0 depth=24 stencil=8 valid=false (bad match)
[V]     id=0xce db=1 alpha=0 depth=24 stencil=0 valid=false (bad match)
[V]     id=0xd0 db=1 alpha=0 depth=24 stencil=0 valid=false (bad match)
[V]     id=0xf0 db=1 alpha=0 depth=24 stencil=0 valid=false (bad match)
[V]     id=0xf2 db=1 alpha=0 depth=24 stencil=0 valid=false (bad match)
[V]     id=0xd4 db=1 alpha=0 depth=24 stencil=8 valid=false (bad match)
[V]     id=0xd6 db=1 alpha=0 depth=24 stencil=8 valid=false (bad match)
[V]     id=0xf6 db=1 alpha=0 depth=24 stencil=8 valid=false (bad match)
[V]     id=0xf8 db=1 alpha=0 depth=24 stencil=8 valid=false (bad match)
[V]     id=0xde db=0 alpha=8 depth=24 stencil=0 valid=false (bad match)
[V]     id=0x100 db=0 alpha=8 depth=24 stencil=0 valid=false (bad match)
[V]     id=0xe4 db=0 alpha=8 depth=24 stencil=8 valid=false (bad match)
[V]     id=0x106 db=0 alpha=8 depth=24 stencil=8 valid=false (bad match)
[V]     id=0xe0 db=1 alpha=8 depth=24 stencil=0 valid=false (bad match)
[V]     id=0xe2 db=1 alpha=8 depth=24 stencil=0 valid=false (bad match)
[V]     id=0x102 db=1 alpha=8 depth=24 stencil=0 valid=false (bad match)
[V]     id=0x104 db=1 alpha=8 depth=24 stencil=0 valid=false (bad match)
[V]     id=0x21 db=1 alpha=8 depth=24 stencil=8 valid=false (bad match)
[V]     id=0x65 db=1 alpha=8 depth=24 stencil=8 valid=false (bad match)
[V]     id=0x22 db=1 alpha=8 depth=24 stencil=8 valid=false (bad match)
[V]     id=0x109 db=1 alpha=8 depth=24 stencil=8 valid=false (bad match)
[E] GLXGC_InitFBConfig: could not find an appropriate fbconfig
[E] GLXGC_FindBestVisual: could not find best visual
[I] GLXGraphicsConfig_getGLXConfigInfo
[I] GLXGC_InitFBConfig: scn=0 vis=0x21
[V]   candidate fbconfigs:
[V]     id=0x21 db=1 alpha=8 depth=24 stencil=8 valid=false (bad match)
[E] GLXGC_InitFBConfig: could not find an appropriate fbconfig
[E] GLXGraphicsConfig_getGLXConfigInfo: could not create fbconfig
Could not enable OpenGL pipeline for default config on screen 0
[I] GLXGraphicsConfig_getGLXConfigInfo
[I] GLXGC_InitFBConfig: scn=0 vis=0xc6
[V]   candidate fbconfigs:
[E] GLXGC_InitFBConfig: could not find an appropriate fbconfig
[E] GLXGraphicsConfig_getGLXConfigInfo: could not create fbconfig
[I] GLXGraphicsConfig_getGLXConfigInfo
[I] GLXGC_InitFBConfig: scn=0 vis=0xc7
[V]   candidate fbconfigs:
[E] GLXGC_InitFBConfig: could not find an appropriate fbconfig
[E] GLXGraphicsConfig_getGLXConfigInfo: could not create fbconfig
[I] GLXGraphicsConfig_getGLXConfigInfo
[I] GLXGC_InitFBConfig: scn=0 vis=0xc8
[V]   candidate fbconfigs:

........

Java 3D WARNING : reported GLX version = 1.2
    GLX version 1.3 or higher is required
    The reported version number may be incorrect.  There is a known
    ATI driver bug in glXQueryVersion that incorrectly reports the GLX
    version as 1.2 when it really is 1.3, so Java 3D will attempt to
    run anyway.
It's weird, in the same log it reports "client GLX version=1.4" and "GLX version = 1.2" whereas I've glx 1.3 installed.
Obviously I got also troubles with fbconfig which I don't know what is it.

Eric.

Last edited by aihaike; 10-01-2009 at 05:02 AM.
 
Old 10-01-2009, 08:02 AM   #6
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
If I recall correctly that is the problem I had. I was not able to solve it, only by upgrading the video card.

What graphics chip do you have. It is an Inspiron, is it a laptop?

jlinkels
 
Old 10-01-2009, 08:14 AM   #7
aihaike
Member
 
Registered: Feb 2006
Location: Paris, France
Distribution: Slackware, CentOS
Posts: 270

Original Poster
Rep: Reputation: 20
Thumbs up

yes it's a labtop, a DELL inspiron 1525, the card is an
Intel Corporation Mobile GM965/GL960 Integrated Graphics Controller.

Actually I've just install jdk-6 from the package of my distribution (Slackware 13) and the problem has been solved.

Thanks you so munch for your help.
Best,

Eric.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Java plugin installed correctly for Firefox but not able to view any java applet tvn Linux - Software 10 04-15-2010 02:13 AM
IN JAVA, how to do a multi chat client in java with the option of private message ? nicolasd Programming 5 09-16-2009 08:53 PM
Ubuntu 7.10 64bit - how to set java path to/redirect java to libjvm.so ? Thane Ubuntu 1 03-25-2008 05:52 PM
LXer: Java news met with cautious optimism in free Java community LXer Syndicated Linux News 0 11-14-2006 10:21 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:39 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration