APS Excellence in Physics Education Award
November 2019

Education Prize Logo
Science SPORE Prize
November 2011

NSF Logo
The Open Source Physics Project is supported by NSF DUE-0442581.

How to enalble JAVA3D ? post and replies

Return to the How to enalble JAVA3D ? thread
Login to post to this thread

First attempt
Juan Maria Fernandez
11 Posts

1) Download JAVA3D from https://java3d.java.net/binary-builds.html

2) Changing the CLASSPATH variable, adding to the old one:

C:\Program Files\Java\Java3D\1.5.2\lib\ext\j3dcore.jar;C:\Program Files\Java\Java3D\1.5.2\lib\ext\j3dutils.jar;C:\Program Files\Java\Java3D\1.5.2\lib\ext\vecmath.jar

this way the system knows where are the JAVA3D jar  files

That made, reboot, and after launch of EJS, creating a 3D model and trying to pass IMPLEMENTATION property in a drawingPanel3D  from SIMPLE3D to JAVA3D.

But a null pointer exception appears and the thing do not work at all.

Sure I am missing something, perhaps in the system installing of JAVA3D, perhaps in telling EJS that JAVA3D is in the system, perhaps in some previous work on the simulation. No idea to do next :-((


Could you help, please?


*********
The long error message:

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at org.opensourcephysics.drawing3d.java3d.Java3dDrawingPanel3D.setEyeDistance(Java3dDrawingPanel3D.java:292)
at org.opensourcephysics.drawing3d.java3d.Java3dDrawingPanel3D.(Java3dDrawingPanel3D.java:108)
at org.opensourcephysics.drawing3d.DrawingPanel3D.doSetImplementation(DrawingPanel3D.java:257)
at org.opensourcephysics.drawing3d.DrawingPanel3D.setImplementation(DrawingPanel3D.java:237)
at org.colos.ejs.library.control.drawing3d.ControlDrawingPanel3D.setValue(ControlDrawingPanel3D.java:569)
at org.colos.ejs.library.control.ControlElement.setProperty(ControlElement.java:579)
at org.colos.ejs.library.control.ControlElement.setProperty(ControlElement.java:493)
at org.colos.ejs.library.control.drawing3d.ControlDrawingPanel3D.setProperty(ControlDrawingPanel3D.java:456)
at org.colos.ejs.osejs.view.ViewElement.setTheProperty(ViewElement.java:891)
at org.colos.ejs.osejs.view.ViewElement.doTheChange(ViewElement.java:1444)
at org.colos.ejs.osejs.view.ViewElement.access$7(ViewElement.java:1439)
at org.colos.ejs.osejs.view.ViewElement$MyMouseListener.mouseClicked(ViewElement.java:1435)
at java.awt.AWTEventMulticaster.mouseClicked(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$200(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)


Thanks ind advance.


Replies to First attempt

Re: First attempt -
Francisco Esquembre
237 Posts

Ooops! Sorry, my fault. We were playing with experimental support for 3D stereo graphics display (they do work!) and left an offending line somewhere.

I have fixed it an it works for me. (I used the J3D installer for Windows.)

You will need to use this experimental EjsS: http://fem.um.es/EjsWiki/uploads/Download/EJS_5.01beta_140825.zip

which I will make public soon.

Paco



Re: Re: First attempt -
Juan Maria Fernandez
11 Posts

Sorry, Paco, but also the experimental version does the work. When reading the file, the Implementation property whit value JAVA3D in the source code is detected as an error, and do not work either.

It works in EJS 4.3.5. But the 3D implementation is quite ugly when running in Java3D (I do use simple 3D primitives to mimic an Stern-Gerlach dispositive in a Bell inequalities experiment).

By now I will stick to the SIMPLE3D option.



Perhaps I will try to code the simulator in javascript. I will open a new thread on this.



OSP Projects:
Open Source Physics - EJS Modeling
Tracker
Physlet Physics
Physlet Quantum Physics
STP Book