Hello,
I have a program that relies on Java 3D and the vrml97.jar loader. I am using the latest versions of jogamp's java3D: https://jogamp.org/deployment/java3d/1.7.1-build-20200222/ and what I believe is one of the original versions of vrml97.jar My program runs properly with Java 8, but crashes with Java 13. I decided to recompile everything from Java 3D sources with Java 13. Unfortunatelly, I cannot build the project, because of vrml97.jar. I tried to decompile it, but there are many incompatibilities between Jogamp's Java 3D and my current vrml97.jar. I would like to know if there are newer implementations of vrml97.jar. Thank you for your help! |
Administrator
|
Hello
Where does this JAR come from? It's not maintained by the JogAmp community. If it relies on an old version of Java3D, you'll be able to make it work by decompiling it and adapting it to Java3D 1.7, it's mostly a problem of package names.
Julien Gouesse | Personal blog | Website
|
Pierre,
I just gone ahead and done what Julien suggested you do. I assumed this jar came from: http://www.java2s.com/Code/Jar/j/Downloadj3dvrml97jar.htm This looks like it's under the jdesktop license, even though the source code isn't easily found online. I'd like to include this loader in Java3D1.7 utils jar at some point, so I've had a go at de compiling it and making it work. java3d1.zip If you like you can download it and see if you can get it to work as you need it to. Just start from the test.java file in the default package. Some input files work, some don't. The code is de compiled code so it looks very ugly. Phil. |
Thank you so much Phil,
This seems to work. At least I could compile my program. I did not test it completely as I have to move many other files. I will do it over the weekend. I also tested your test.java program and it seems to show something, but it is transient. I would like the window to stay, but it does not on my mac. Do you have this too? Otherwise, you can test the loader on the wrl model I paste below. It worked before. I did not find a way to attach the file. Pierre == #VRML V2.0 utf8 ################################################################################ PROTO Car [ field SFColor carros 0.5 0.5 0.5 field SFColor capote 0 0 0 field SFColor pneu 0.1 0.1 0.1 field SFColor metal 0.9 0.9 0.9 field SFColor vitre 0.8 0.8 1 field SFColor stop 0.8 0 0 ] { DEF Voiture Transform { translation 0 2.5 0 children [ DEF Carrosserie Transform { scale 1 1 1.8 children [ Transform { # COFFRE translation -3.8 0 0 rotation 0 0 1 0.55 scale 1.7 1 1 children [ Transform { rotation 0 0 1 0.7854 children [ Shape { appearance Appearance { material Material { diffuseColor IS carros } } geometry Box {} }]}]} Transform { # CAPOTE translation -1.52 1.2 0 rotation 1 0 0 1.5708 scale 2 0.95 1 children [ Shape { appearance Appearance { material Material { diffuseColor IS capote } } geometry Cylinder { radius 1.5 } }]} Transform { # HABITACLE translation -1.52 1.1 0 rotation 1 0 0 1.5708 scale 2 1 1 children [ Shape { appearance Appearance { material Material { diffuseColor IS carros } } geometry Cylinder { radius 1.5 } }]} Transform { translation 1.3 1 0 rotation 0 0 1 0.7854 children [ Shape { appearance Appearance { material Material { diffuseColor IS carros } } geometry Box { size 1 1 2 } }]} Shape { # CAPOT appearance Appearance { material Material { diffuseColor IS carros } } geometry IndexedFaceSet { coord Coordinate { point [ 2 1 -1, 3.937825 0.505192 -0.75, 3.937825 0.505192 0.75, 2 1 1, 4.840447 0.065034 -0.5624, 4.840447 0.065034 0.5624, 5.367987 -0.521024 -0.421875, 5.367987 -0.521024 0.421875, 5.559249 -1.199491 -0.316406, 5.559249 -1.199491 0.316406 ] } coordIndex [ 0, 1, 2, 3, -1, 1, 4, 5, 2, -1, 4, 6, 7, 5, -1, 6, 8, 9, 7, -1 ] normalPerVertex FALSE solid FALSE creaseAngle 0.5 }} Transform { translation -0.96 -0.125 0 scale 3 1.14 1 children [ Shape { appearance Appearance { material Material { diffuseColor IS carros } } geometry Box {} }]} Shape { # TABLIERS appearance Appearance { material Material { diffuseColor IS carros } } geometry IndexedFaceSet { coord Coordinate { point [ 2 1 1, 2 -1.26 1, 5.562 -1.2 0.31, 5.37 -0.52 0.42, 4.85 0.06 0.56, 3.943 0.5 0.75, 2 1 -1, 2 -1.26 -1, 5.562 -1.2 -0.31, 5.37 -0.52 -0.42, 4.85 0.06 -0.56, 3.943 0.5 -0.75 ] } coordIndex [ 0, 1, 2, -1, 0, 2, 3, -1, 0, 3, 4, -1, 0, 4, 5, -1, 6, 7, 8, -1, 6, 8, 9, -1, 6, 9, 10, -1, 6, 10, 11, -1 ] normalPerVertex FALSE solid FALSE creaseAngle 0.5 }} Shape { # SOUS MOTEUR appearance Appearance { material Material { diffuseColor IS carros } } geometry IndexedFaceSet { coord Coordinate { point [ 2 -1.26 1, 5.562 -1.2 0.31, 5.562 -1.2 -0.31, 2 -1.26 -1 ] } coordIndex [ 0, 1, 2, 3, -1 ] normalPerVertex FALSE solid FALSE creaseAngle 0.5 }} Transform { translation 4.6 0.1 0.8 children [ DEF PhareAv Transform { scale 1 1.2 0.6667 children [ Transform { translation 0.35 0 0 rotation 0 0 1 1.5708 children [ Shape { appearance Appearance { material Material { diffuseColor IS carros } } geometry Cylinder { radius 0.255 height 0.25 }}]} Transform { translation 0.2 0 0 children [ Shape { appearance Appearance { material Material { diffuseColor IS carros } } geometry Sphere { radius 0.26 } }]} Transform { translation 0.1 0 0 children [ Shape { appearance Appearance { material Material { diffuseColor IS carros } } geometry Sphere { radius 0.24 } }]} Shape { appearance Appearance { material Material { diffuseColor IS carros } } geometry Sphere { radius 0.22 } }]}]} Transform { translation 4.6 0.1 -0.8 children [ DEF PhareAv Transform { scale 1 1.2 0.6667 children [ Transform { translation 0.35 0 0 rotation 0 0 1 1.5708 children [ Shape { appearance Appearance { material Material { diffuseColor IS carros } } geometry Cylinder { radius 0.255 height 0.25 }}]} Transform { translation 0.2 0 0 children [ Shape { appearance Appearance { material Material { diffuseColor IS carros } } geometry Sphere { radius 0.26 } }]} Transform { translation 0.1 0 0 children [ Shape { appearance Appearance { material Material { diffuseColor IS carros } } geometry Sphere { radius 0.24 } }]} Shape { appearance Appearance { material Material { diffuseColor IS carros } } geometry Sphere { radius 0.22 } }]}]} Shape { # AILE AV D appearance Appearance { material Material { diffuseColor IS carros } } geometry IndexedFaceSet { coord Coordinate { point [ 2 -1.26 1, 2.9 -0.15 0.88, 3.35 0.1 0.81, 3.8 0.2 0.74, 2.3 -0.9 1.15, 2.9 -0.4 1.27 3.5 -0.15 1.3, 4 -0.12 1.3, 4.5 0 0.6, 5 -0.6 0.49, 4.5 -0.3 1.3, 5.2 -1.2 0.4, 5.1 -1.2 1, 4.9 -1 1.2 ] } coordIndex [ 0, 1, 5, 4, -1, 1, 2, 3, 6, 5, -1, 3, 8, 9, 10, 7, 6, -1, 9, 11, 12, 13, 10, -1 ] normalPerVertex FALSE solid FALSE creaseAngle 0.5 }} Shape { # AILE AV G appearance Appearance { material Material { diffuseColor IS carros } } geometry IndexedFaceSet { coord Coordinate { point [ 2 -1.26 -1, 2.9 -0.15 -0.88, 3.35 0.1 -0.81, 3.8 0.2 -0.74, 2.3 -0.9 -1.15, 2.9 -0.4 -1.27 3.5 -0.15 -1.3, 4 -0.12 -1.3, 4.5 0 -0.6, 5 -0.6 -0.49, 4.5 -0.3 -1.3, 5.2 -1.2 -0.4, 5.1 -1.2 -1, 4.9 -1 -1.2 ] } coordIndex [ 0, 1, 5, 4, -1, 1, 2, 3, 6, 5, -1, 3, 8, 9, 10, 7, 6, -1, 9, 11, 12, 13, 10, -1 ] normalPerVertex FALSE solid FALSE creaseAngle 0.5 }} Shape { # AILE AR D appearance Appearance { material Material { diffuseColor IS carros } } geometry IndexedFaceSet { coord Coordinate { point [ -5.7 -1.26 1, -5.25 -0.46 1, -4.575 -0.06 1, -4.35 -0.46 1.3, -5.025 -0.78 1.2, -4.35 -1.26 1.38, -5.025 -1.26 1.32, -3.9 0.26 1, -3.45 -0.38 1.33, -3.675 -1.26 1.4, -3.45 0.34 1, -3 0.3 1, -2.55 -0.06 1, -2.55 -0.62 1.2, -2.19 -0.54 1, -2.1 -1.26 1, -2.55 -1.26 1.32, -3 -1.26 1.38 ] } coordIndex [ 0, 1, 4, 6, -1, 1, 2, 3, 4, -1, 4, 3, 5, 6, -1, 2, 7, 10, 8, 3, -1, 3, 8, 9, 5, -1, 8, 10, 11, 13, -1, 11, 12, 14, 13, -1, 8, 13, 17, 9, -1, 13, 14, 15, 16, 17, -1 ] normalPerVertex FALSE solid FALSE creaseAngle 0.5 }} Shape { # AILE AR G appearance Appearance { material Material { diffuseColor IS carros } } geometry IndexedFaceSet { coord Coordinate { point [ -5.7 -1.26 -1, -5.25 -0.46 -1, -4.575 -0.06 -1, -4.35 -0.46 -1.3, -5.025 -0.78 -1.2, -4.35 -1.26 -1.38, -5.025 -1.26 -1.32, -3.9 0.26 -1, -3.45 -0.38 -1.33, -3.675 -1.26 -1.4, -3.45 0.34 -1, -3 0.3 -1, -2.55 -0.06 -1, -2.55 -0.62 -1.2, -2.19 -0.54 -1, -2.1 -1.26 -1, -2.55 -1.26 -1.32, -3 -1.26 -1.38 ] } coordIndex [ 0, 1, 4, 6, -1, 1, 2, 3, 4, -1, 4, 3, 5, 6, -1, 2, 7, 10, 8, 3, -1, 3, 8, 9, 5, -1, 8, 10, 11, 13, -1, 11, 12, 14, 13, -1, 8, 13, 17, 9, -1, 13, 14, 15, 16, 17, -1 ] normalPerVertex FALSE solid FALSE creaseAngle 0.5 }}]} Transform { translation -3.53 -1.5 2 children [ DEF Roue Transform { rotation 1 0 0 1.5708 children [ Shape { appearance Appearance { material Material { diffuseColor IS pneu } } geometry Cylinder { height 0.4 } } Transform { translation 0 0.26 0 children [ Shape { appearance Appearance { material Material { diffuseColor IS metal } } geometry Cylinder { radius 0.6 height 0.01 } }]}]}]} Transform { translation -3.53 -1.5 -2 rotation 0 1 0 3.1416 children [ DEF Roue Transform { rotation 1 0 0 1.5708 children [ Shape { appearance Appearance { material Material { diffuseColor IS pneu } } geometry Cylinder { height 0.4 } } Transform { translation 0 0.26 0 children [ Shape { appearance Appearance { material Material { diffuseColor IS metal } } geometry Cylinder { radius 0.6 height 0.01 } }]}]}]} Transform { translation 3.76 -1.5 2 children [ DEF Roue Transform { rotation 1 0 0 1.5708 children [ Shape { appearance Appearance { material Material { diffuseColor IS pneu } } geometry Cylinder { height 0.4 } } Transform { translation 0 0.26 0 children [ Shape { appearance Appearance { material Material { diffuseColor IS metal } } geometry Cylinder { radius 0.6 height 0.01 } }]}]}]} Transform { translation 3.76 -1.5 -2 rotation 0 1 0 3.1416 children [ DEF Roue Transform { rotation 1 0 0 1.5708 children [ Shape { appearance Appearance { material Material { diffuseColor IS pneu } } geometry Cylinder { height 0.4 } } Transform { translation 0 0.26 0 children [ Shape { appearance Appearance { material Material { diffuseColor IS metal } } geometry Cylinder { radius 0.6 height 0.01 } }]}]}]} Transform { # BARRE PHARES translation 4.82 -0.2 0 rotation 1 0 0 1.5708 children [ Shape { appearance Appearance { material Material { diffuseColor IS metal } } geometry Cylinder { radius 0.05 height 3 } }]} Transform { # PARE-CHOCS AV translation 5.65 -1 0 children [ DEF Parechoc Transform { rotation 1 0 0 1.5708 scale 1 1 1.8 children [ Shape { appearance Appearance { material Material { diffuseColor IS metal } } geometry Cylinder { radius 0.1 height 3.5 } }]}]} Transform { # PARE-CHOCS AR translation -5.88 -1 0 scale 1 1 1.1 children [ DEF Parechoc Transform { rotation 1 0 0 1.5708 scale 1 1 1.8 children [ Shape { appearance Appearance { material Material { diffuseColor IS metal } } geometry Cylinder { radius 0.1 height 3.5 } }]}]} Transform { # GLOBE D translation 5.06 0.1 1.44 children [ DEF Globe Transform { scale 0.35 1 1 children [ Shape { appearance Appearance { material Material { diffuseColor IS vitre } } geometry Sphere { radius 0.3 } }]}]} Transform { # GLOBE G translation 5.06 0.1 -1.44 children [ DEF Globe Transform { scale 0.35 1 1 children [ Shape { appearance Appearance { material Material { diffuseColor IS vitre } } geometry Sphere { radius 0.3 } }]}]} Transform { translation 1.67 1.37 0 children [ DEF Parebrise Transform { rotation 0 0 1 0.78 children [ Shape { appearance Appearance { material Material { diffuseColor IS vitre } } geometry Box { size 0.01 0.9 3.3 } }]}]} Transform { translation -4.55 1.25 0 rotation 0 0 1 5.05 children [ DEF Parebrise Transform { rotation 0 0 1 0.78 children [ Shape { appearance Appearance { material Material { diffuseColor IS vitre } } geometry Box { size 0.01 0.9 3.3 } }]}]} Transform { translation -1 0.8 1.82 children [ DEF Vitres Shape { appearance Appearance { material Material { diffuseColor IS vitre } } geometry IndexedFaceSet { coord Coordinate { point [ 0.4 1.4 0, 0.9 1.35 0, 1.4 1.15 0, 2 0.8 0, 2.3 0.4 0, 2.1 0 0, 0.4 0 0, 0.1 1.4 0, -0.5 1.35 0, -0.9 1.15 0, -1.5 0.8 0, -1.7 0.4 0, -1.8 0 0, 0.1 0 0, -1.5 1.3 0, -2 1.2 0, -2.8 0.8 0, -3.3 0.2 0, -3.1 0 0, -2.15 0 0, -2 0.5 0, -1.5 1.1 0 ] } coordIndex [ 0, 1, 2, 3, 4, 5, 6, -1, 7, 8, 9, 10, 11, 12, 13, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1 ] normalPerVertex FALSE solid FALSE creaseAngle 0.5 }}]} Transform { translation -1 0.8 -1.82 children [ DEF Vitres Shape { appearance Appearance { material Material { diffuseColor IS vitre } } geometry IndexedFaceSet { coord Coordinate { point [ 0.4 1.4 0, 0.9 1.35 0, 1.4 1.15 0, 2 0.8 0, 2.3 0.4 0, 2.1 0 0, 0.4 0 0, 0.1 1.4 0, -0.5 1.35 0, -0.9 1.15 0, -1.5 0.8 0, -1.7 0.4 0, -1.8 0 0, 0.1 0 0, -1.5 1.3 0, -2 1.2 0, -2.8 0.8 0, -3.3 0.2 0, -3.1 0 0, -2.15 0 0, -2 0.5 0, -1.5 1.1 0 ] } coordIndex [ 0, 1, 2, 3, 4, 5, 6, -1, 7, 8, 9, 10, 11, 12, 13, -1, 14, 15, 16, 17, 18, 19, 20, 21, -1 ] normalPerVertex FALSE solid FALSE creaseAngle 0.5 }}]} Transform { translation -5.41 -0.6 1.3 children [ DEF PhareAr Transform { rotation 0 0 1 6.08319 children [ Shape { appearance Appearance { material Material { diffuseColor IS stop } } geometry Box { size 0.4 0.4 0.6 } }]}]} Transform { translation -5.41 -0.6 -1.3 children [ DEF PhareAr Transform { rotation 0 0 1 6.08319 children [ Shape { appearance Appearance { material Material { diffuseColor IS stop } } geometry Box { size 0.4 0.4 0.6 } }]}]}]} } Transform { children [ Background { skyColor [ 0.8 0.8 1 ] } ]} Transform { children [ Viewpoint { position 0 5 25 orientation 1 0 0 0 description "SUD" } Viewpoint { position 25 5 0 orientation 0 1 0 1.5708 description "EST" } Viewpoint { position 0 5 -25 orientation 0 1 0 3.1416 description "NORD" } Viewpoint { position -25 5 0 orientation 0 1 0 -1.5708 description "OUEST" } Viewpoint { position 0 25 0 orientation 1 0 0 -1.5708 description "DESSUS" } DEF A Transform { children [ Car { carros 1, 1, 0 } ]} ]} |
In reply to this post by philjord
Just one more thing. The vrml.jar file you used is not the same as mine. Mine is smaller: 316 697 bytes (319 K). If you want, I could send it to you, but which address do you want me to use?
Pierre |
Administrator
|
In reply to this post by Pierre Nugues
Which version of JOGL do you use with Java3D?
Julien Gouesse | Personal blog | Website
|
This one:
Manifest-Version: 1.0 Ant-Version: Apache Ant 1.10.5 Created-By: 11.0.5+10-post-Debian-1deb10u1 (Debian) Application-Name: Java Bindings for OpenGL Specification-Title: Java Bindings for OpenGL API Specification Specification-Version: 2.4 Specification-Vendor: JogAmp Community Implementation-Title: Java Bindings for OpenGL Runtime Environment Implementation-Version: 2.4.0-rc-20200202 Implementation-Build: 2.4-b1503-20200202 Implementation-Branch: origin/master Implementation-Commit: 77ae1b75f3c6feab97a4fffea44aadbd6e1d0b15 Implementation-Vendor: JogAmp Community Implementation-URL: http://jogamp.org/ Extension-Name: com.jogamp.opengl Implementation-Vendor-Id: com.jogamp Trusted-Library: true Permissions: all-permissions Application-Library-Allowable-Codebase: * Codebase: *.jogamp.org |
In reply to this post by philjord
Hello Phil,
I have now converted my program and it works fine. Thank you again for your kind help. By the way, I think that this VRML loader can help a few people. It would be great if you could upload it somewhere so that it can benefit more people like me. Just a precision, I had to use java 13. I could not compile it with java 14. Pierre |
Administrator
|
Please tell us why you couldn't compile it with Java 14.
Julien Gouesse | Personal blog | Website
|
Hello Julien,
I made a miskate in the compiler configuration. I am sorry for this misleading message. I can compile it now. I was to mail it to you, when I read your message. Pierre |
Pierre,
that's good news, fixes like that are the best! If you reply to this email could you press the "more" button on the right of the title bar of the reply editor pane and try to "upload a file" so I can see your vrml.jar file? |
vrml97.jar
Hello Phil, Here you are! By the way, there seems to be a site that maintained versions of at least parts of Java3D here: http://svn.xj3d.org/xj3d_code/trunk/src/java/ The vrml folder seems to have the same files as the ones in the jar file. Pierre |
Hello again,
I do not know if you will find it useful, but I could find a version of the source VRML loader, not inclusing the vrml folder. I attach it. Pierre vrml97.zip |
Pierre,
That's great, funnily enough I was seearching myself last night and found a copy of it on this site http://en.pudn.com/Download/item/id/361931.html 87196350java3dloadersrc.rar It required logging in and mucking about a bit though. My plan is to put a project up called java3d-vrml97 next to java3d-utils in my git repo that's been modified for 1.7 I'm glad we can preserve this utility nicely. |
Hello Phil,
May I ask you how you found it? I am curious to know... I tried myself to google a few class names and I found two sites, but not the one you mentioned. And yours has more recent versions. Pierre |
Pierre,
I googled all sorts of crazy variations, and read a whole lot of blog entries on the life of vrml. Most search results included the jar you supplied. I think I googled org.jdesktop.j3d.loaders.vrml97.impl and the second link was to VrmlLoader.java on that site and then I had to muck around with the account verification process until it let me download it. But that site doesn't have anything else to do with vrml specifically which is a pity. |
Vrml97 loader for Java3D 1.7 up here now
https://github.com/philjord/java3d-vrml97 Thanks for this work Pierre :) |
Free forum by Nabble | Edit this page |