ScreenScaling ignored

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

ScreenScaling ignored

Roland Schützig
The SimpleUniverse seems to ignore the ScreenScaling. I have worked my way through all the "HelloUniverse" examples and I could not figure out how to modify the screen scaling.
I am using my Windows 10 machine with a screen scaling of 250%. Any graphic is shown on the JFrame in the lower/left corner with a factor of 2.5 smaller than the size of the JFrame.
Following the API specification I tried (this is Kotlin code):
        universe.viewingPlatform.viewPlatform.viewAttachPolicy = NOMINAL_SCREEN
        universe.viewingPlatform.viewers[0].view.screenScalePolicy= SCALE_EXPLICIT
        universe.viewingPlatform.viewers[0].view.screenScale=2.5

But it does not work and I have run out of ideas.
Does anybody have a suggestion (or better: a working example)?

Roland
Reply | Threaded
Open this post in threaded view
|

Re: ScreenScaling ignored

gouessej
Administrator
Hello

Which version of Java3D do you use?
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: ScreenScaling ignored

Roland Schützig
Hi Julien
It is version 1_5_2, downloaded from https://download.freedownloadmanager.org/Windows-PC/Java-3D/FREE-1.5.2.html.

I have uploaded the little "HelloUniverse" program in case you want to look at the code.
And there is the screenshot of the window. The graph is showing in the lower left corner of the window. The window is larger by exactly a factor 2.5, which is precisely the 250% screen scaling set in Windows. I can modify that value and the result changes accordingly. So, it is clear, that the screen scaling that I set in the program is being ignored.

Screenshot_2021-09-18_051602.png

HelloUniverse.kt

Regards, Roland
Reply | Threaded
Open this post in threaded view
|

Re: ScreenScaling ignored

hharrison
I'm sorry, 1.5.2 is far too old, try the java 1.6.2 version from jogamp and see if it fixes this issue. I believe this was fixed between 1.6.1 and 1.6.2

Reply | Threaded
Open this post in threaded view
|

Re: ScreenScaling ignored

Roland Schützig
Hi. I got version 1.6.2 (Jars j3dcore, j3dutils and vecmath) OK. But it seems I do not have the proper matching native library for Windows. I am using j3dcore-ogl.dll that works OK with 1.5.2. Do I have to get a newer version of the DLL?

The error I receive now:
Exception in thread "main" java.lang.NoClassDefFoundError: com/jogamp/opengl/GLException
        at java.base/java.lang.Class.forName0(Native Method)
        at java.base/java.lang.Class.forName(Class.java:315)
        at javax.media.j3d.Pipeline$PipelineCreator.run(Pipeline.java:74)
        at javax.media.j3d.Pipeline$PipelineCreator.run(Pipeline.java:61)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at javax.media.j3d.Pipeline.createPipeline(Pipeline.java:91)
        at javax.media.j3d.MasterControl.loadLibraries(MasterControl.java:858)
        at javax.media.j3d.VirtualUniverse.<clinit>(VirtualUniverse.java:267)
        at helloUniverse.TestKt.main(Test.kt:8)
        at helloUniverse.TestKt.main(Test.kt)
Reply | Threaded
Open this post in threaded view
|

Re: ScreenScaling ignored

hharrison
You need the jogl libraries. You can find some instructions here:

https://gouessej.wordpress.com/2012/08/01/java-3d-est-de-retour-java-3d-is-back/#installation

Reply | Threaded
Open this post in threaded view
|

Re: ScreenScaling ignored

Roland Schützig
This post was updated on .
That solved the issue with the ingnored screenScaling indeed. Thanks a lot.
I got https://jogamp.org/deployment/v2.4.0-rc-20210111/archive/jogamp-fat-all.7z and the problem is gone (with using version 1.6.2 of java3D as you suggested, of course).

Now I have this "An illegal reflective access operation has occurred" warning.
After some searching I ended up with using JDK 12 and Java3D 1.7.0 but the warning was still there:

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.jogamp.java3d.JoglPipeline$1 (file:/C:/tools/Java3D/java3D_170/j3dcore.jar) to method sun.awt.Win32GraphicsDevice.getScreen()
WARNING: Please consider reporting this to the maintainers of org.jogamp.java3d.JoglPipeline$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release


And finally - following the advise giving in the post https://forum.jogamp.org/Java3D-Illegal-reflective-access-td4040908.html by user "goodwilling" - the message goes away with the Java VM option:
--add-exports=java.desktop/sun.awt=ALL-UNNAMED

I just don't know, if it is clever to hide the messages and some future JDK release is not benign anymore and makes it an error instead a mere warning.
Reply | Threaded
Open this post in threaded view
|

Re: ScreenScaling ignored

gouessej
Administrator
Reply | Threaded
Open this post in threaded view
|

Re: ScreenScaling ignored

Roland Schützig
Yes, of course. I missed that. The case is closed than for now.
Thanks again for your help.
Roland