AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Java3D on Linux RH Enterprise 2.4

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> 3D Graphics API's for Java
View previous topic :: View next topic  
Author Message
Andrew Neiderer
Guest





PostPosted: Thu Apr 06, 2006 2:12 pm    Post subject: Java3D on Linux RH Enterprise 2.4 Reply with quote



I have not done any Java3D for 4/3 years now but I am starting to get back to it.
Since then our sys administrators have placed JDK 1.6 (used to be 1.4.2) on our
Linux RH Enterprise 2.4 and I think Java3D 1.4. I can translate HelloUniverse.java
just fine, but when I go to execute it I get the following

------------------------------------------------------------------------------------------------------------------------------------------------

$java HelloUniverse

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.

************************************************************************

*** ERROR: Canvas3D constructed with a null GraphicsConfiguration

*** This will cause a NullPointerException in a subsequent release

************************************************************************

Exception in thread "Thread-1" java.lang.NullPointerException: Canvas3D: null

aphicsConfiguration

at javax.media.j3d.Canvas3D.<init>(Canvas3D.java:1182)

at javax.media.j3d.Canvas3D.<init>(Canvas3D.java:1147)

at HelloUniverse.init(HelloUniverse.java:102)

at com.sun.j3d.utils.applet.MainFrame.run(MainFrame.java:267)

at java.lang.Thread.run(Thread.java:595)



Do I need some driver s/w or something ? The graphics card we have is an ATI Radeon.



Please provide suggestions or URLs so that I can start doing some Java3D programming, which I prefer.



I include HelloUniverse.java since I vaguely recall talk about the Canvas3D and configuration (?).



Thank you.



- Andrew M. Neiderer

- US Army Research Lab





public class HelloUniverse extends Applet {



private SimpleUniverse u = null;



public BranchGroup createSceneGraph() {

// Create the root of the branch graph

BranchGroup objRoot = new BranchGroup();



// Create the TransformGroup node and initialize it to the

// identity. Enable the TRANSFORM_WRITE capability so that

// our behavior code can modify it at run time. Add it to

// the root of the subgraph.

TransformGroup objTrans = new TransformGroup();

objTrans.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);

objRoot.addChild(objTrans);



// Create a simple Shape3D node; add it to the scene graph.

objTrans.addChild(new ColorCube(0.4));



// Create a new Behavior object that will perform the

// desired operation on the specified transform and add

// it into the scene graph.

Transform3D yAxis = new Transform3D();

Alpha rotationAlpha = new Alpha(-1, 4000);



RotationInterpolator rotator =

new RotationInterpolator(rotationAlpha, objTrans, yAxis,

0.0f, (float) Math.PI*2.0f);

BoundingSphere bounds =

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

rotator.setSchedulingBounds(bounds);

objRoot.addChild(rotator);



// Have Java 3D perform optimizations on this scene graph.

objRoot.compile();



return objRoot;

}



public HelloUniverse() {

}



public void init() {

setLayout(new BorderLayout());



GraphicsDevice dev =

GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevic

e();

GraphicsConfigTemplate3D template = new GraphicsConfigTemplate3D();

GraphicsConfiguration config =

GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevic

e().getBestConfiguration(template);

Canvas3D canvas3d = new Canvas3D(config);



add("Center",canvas3d);



// Create a simple scene and attach it to the virtual universe

BranchGroup scene = createSceneGraph();

u = new SimpleUniverse(canvas3d);



// This will move the ViewPlatform back a bit so the

// objects in the scene can be viewed.

u.getViewingPlatform().setNominalViewingTransform();



u.addBranchGraph(scene);

}



public void destroy() {

u.cleanup();

}



//

// The following allows HelloUniverse to be run as an application

// as well as an applet

//

public static void main(String[] args) {

new MainFrame(new HelloUniverse(), 256, 256);

}

}
Back to top
Alexander Gran
Guest





PostPosted: Fri Apr 07, 2006 12:12 am    Post subject: Re: Java3D on Linux RH Enterprise 2.4 Reply with quote



Andrew Neiderer wrote:

Quote:
Do I need some driver s/w or something ? The graphics card we have is an
ATI Radeon.

try
export LD_PRELOAD=/usr/bin/libGL.so.1
before running java.
Dunno why that's neccessary, but at least on my machine I need that.

GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevic
Quote:

e().getBestConfiguration(template);

Canvas3D canvas3d = new Canvas3D(config);

That does not seem to work. Try
Canvas3D(SimpleUniverse.getPreferredConfiguration())

regards
Alex

--
Some operating systems are called `user friendly',
Linux however is `expert friendly'.
Encrypted Mails welcome. Send spam to toZodiac (AT) gmx (DOT) net, please.
PGP-Key at http://zodiac.dnsalias.org/misc/pgpkey.asc | Key-ID: 0x6D7DD291
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> 3D Graphics API's for Java All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.