Loading VRML 1.0 files in Java 3D

Hi all,
Does anyone have a successful experience loading VRML 1.0 file into Java 3D as a scene graph? While I think it's too complicated to write my own loader, is there any existing loader available for this task?
I've tried 2 VRML loaders, but neither seems to work. org.web3d.j3d.loaders.VRML97Loader works fine loading VRML 2.0 files, but not for 1.0 files. An exception with the following message was thrown.
Error loading VRML file: Unsupported version V1.0
com.sun.j3d.loaders.vrml97.VrmlLoader always complains about the format of my VRML files (both version 1.0 and 2.0). In this case the exceptions is...
java.lang.InstantiationError: vrml.node.Node
     at com.sun.j3d.loaders.vrml97.impl.Node.wrap(Node.java:114)
OR
Exception: com.sun.j3d.loaders.vrml97.impl.ParseException: Unknown node type: Separator
Last token was "Separator" at line 5
com.sun.j3d.loaders.vrml97.impl.ParseException: Unknown node type: Separator

VRML1.0 and VRML97 (or 2.0), are very different in the structure, so it is very unlikely that a loader built for version 2.0 works for 1.0 files.
I don't know whether there is a J3D loader for 1.0.
You may try with some conversion program,
http://www.nhcad.com/old/html/vrml2.html
try this.. hope it helps.
Chris

Similar Messages

  • Loading Vrml files in Swing using java3d loader

    I've got problems loading Vrml files in Swing using java3d vrmlLoader. It seems to be only able to load vrml files that contains simple geometry like squares, cones etc. But when it comes to complicated shapes like IndexedFaceSet, its a blank. Does anyone know why?
    What are the points to note when loading vrml files? Doesn't the code:
    vrmlLoader = new VRML97Loader(VRML97Loader.LOAD_ALL);
    and
    scene = vrmlLoader.load(loadUrl);
    load the entire vrml file? Is there any comprehensive tutorial or example that I can refer to? The fly through in Java 3d demo is too complicated. I'm still pretty new to this field. Thanks.

    Did you download the example VRML file I had listed?
    First make sure you test it with that one...it that works
    then maybe the VRML file you are using is not version
    #VRML V2.0 utf8
    ...Actually, I think you'd get some parsing error if you
    used a VRML v1.0, so that probably is not the issue.
    Do you have the vrml97.jar file in you path, maybe?
    Check you path in Windows by typing "path" in command window. If you have the vrml97.jar file then
    that's cool...if not then you must add it to your path.
    OR you can temporarily compile by invoking
    the -classpath <path> command....I think you'll have to
    do the same when running the code....so do:
    javac -classpath PUTPATHHERE TestVrml.java
    java -classpath PUTPATHHERE TestVrml
    If that doesn't work, do you have Java 3D installed?
    just checking...
    I'm kind of lost as to what to do beyond that....by the way, I double checked my files and and recompiled and
    reran them and they work fine. I've also checked them
    on a different computer at work and they work their too.
    So, long story short, it's something wrong on your end either with the java install or the vrml97.jar file not being in the path...I don't know much more.
    Let me know if anything worked.
    Mariusz Zaczek ([email protected])

  • Path problem for "Load VRML File.vi" in EXE

    Hello,
    The new integrated 3d Picture Control functionality in LabVIEW 8.20 is amazing.  It is a really easy to use implementation of OpenGL.  I've discovered one bug/issue when building VI's to an exe that includes the 3d Picture Control:
    If "Load VRML File.vi" is used, in the executable, you will encounter a LabVIEW Error 7 due to a path problem in the following vi:
    NI_3D Picture Control.lvlib:Load VRML File.vi->NI_3D Picture Control.lvlib:NI_Old 3D Toolkit.lvlib:Read WRL file.vi->NI_3D Picture Control.lvlib:NI_Old 3D Toolkit.lvlib:Initialize.vi
    The File Not Found problem will prevent the vrml file from loading.  Navigating down into the subVI's of the "Load VRML File.vi" shown above easily reveals the problem.  I've included a screenshot of the diagram of that VI.  The relative
    path resulting from the double "Strip Path" operation is not valid
    in the executable.  I'm not sure where that "definitions" file resides
    in the runtime deployment or if it's even included, so fixing the path to account for the differences in the exe vs. development environment path is not an option.   I'm also usually very hesitant to make any mods to anything in vi.lib.
    For the development environment, the "definitions" file can be found at: [LabVIEW 8.2 dir]\vi.lib\picture\3D Picture Control
    The easy fix is to include the "definitions" file in the same directory as your exe when you build.  Fortuitously, this does the trick because the first strip path gives the path to the exe and then the second strip path results in the path to the directory where the exe resides.
    Hopefully NI will fix this path reference properly in future revisions.
    Enjoy!
    Attachments:
    WRL Debug.jpg ‏77 KB

    Hi Chris,
    Thanks a lot for the feedback!  This was reported to R&D (# 47F9DJIQ) for further investigation.
    Regards,
    Justin D

  • How to load word .doc-files into java applications?

    Hi,
    I want to load a word .doc-file (or any other type of document) into a java application, as part of the application.
    Is there any java special library to do it?
    Any solution or hint?
    Thank you.

    No, there is no existing Java library to do it that I am aware of. You could write your own, however, as the Word 97 binary file format is published. I am not sure that the Word 2000, or XP formats are as well, but since they put out the 97 presumably they'd do the same with the rest -- although I am suprised that Micro$$$oft even published the 97 format.
    A library such as this would take quite some time write, due to the extensive format, but here's a link to a copy of it just so you can see what it'd take: http://www.redbrick.dcu.ie/~bob/Tech/wword8.html
    Also keep in mind that Micro$$$oft has never remained binary compatable between versions. In short, this means that you'd have to parse each version's documents differently. Not a fun task.
    If a Java library to read Micro$$$oft file formats already does exist, I'm willing to bet that it costs $$$ mucho dinero $$$.
    Hey, aren't proprietary file formats just wonderful?

  • Question for load VRML file with scale and position missed

    Hi,
    I trid to read a .wrl file from the "load VRML" vi, most simple .wrl models can be correctly read but for some more compliacted models their scales and positions were incorrect.
    I attached the file which I read the .wrl file and a car model from Matlab Virtual Reality toolbox. The file can be read but their position and scale was missed. I check this model on other VRML readers and I believe the car model is correct. Does anyone know how to fix this problem?
    Thanks,
    -Alex
    Attachments:
    VRMLproblem.zip ‏88 KB

    Hi Yi Y,
    Thanks for your reply.
    The attached files are the correct .wrl file and the one read from LabVIEW.
    The colored is incorrect, the car is seperated to some parts, and the scale of some of the parts are wrong.
    I think you can use any .wrl reader to read the wrl file I posted, all the reader I tried can read it successfully besides LabVIEW.
    In the vi I have you can try to adjust the scale or rotate it then I think you can find the seperated car parts.
    I will appreciate if you can give me any suggestion. Thanks,
    -Alex
    Attachments:
    original.JPG ‏110 KB
    readfromLabView.JPG ‏74 KB

  • Loading XML Configuration File into Java

    I have a stored procedure wrapper to a Java method (within a jar file) that has been loaded into the database. I need to load an XML configuration file in this method and parse it but get the following error.
    <Line 2, Column 192>: XML-24538: (Error) Can not find definition for element 'LODConfigs'
    When I run the method standalone through netbeans it parses fine and is able to load the file. I've confirmed that it is able to read the file but I am lost as to what could be the problem. Any suggestions would be welcome.
    The header of the file is
    <?xml version="1.0" encoding="UTF-8" ?>
    <LODConfigs xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.oracle.com/spatial/network/lodLODConfigs.xsd"
    xmlns="http://xmlns.oracle.com/spatial/network">
    <LODConfig globalNetworkName="$DEFAULT$" networkName="$DEFAULT$">
    <networkIO>
    </networkIO>
    </LODConfig>
    </LODConfigs>

    Just a guess really, (and this is an old question now - so you may have moved on).. is your XML parser attempting to use the schema location to pull the XML schema from the internet?
    If so, that might run fine in netbeans, but hit java permission limits in Oracle. Have you tried running it in netbeans with the network cable unplugged.
    If that fails with the same error as the Oracle JVM, that might give a clue as to the problem and you can troubleshoot the permissions from there.

  • How to load avi files using java ?

    Hi, i need to load avi (movie file) using java. I have usually done with java applet, but the applet just can load image (jpeg, gif)

    All types of data should be downloaded in same way. What is your problem: exception or something else? Post here.

  • Code to load VRML into java3d  (10 dukes availble) please

    Im trying to load a VRML file into java 3d but have had no sucess if someone please pots some code to do this it would be a massive help. Ive been struggling for a long time now trying to do this so theres 10 duke points up for grabs if your interested in that kinda thing.

    well vrmlloader97 works perfectly, but when i try to use the Text3D node it fails, any solutions please?
    this is the error
    vrml.InvalidVRMLSyntaxException: Last token was "Text3D" at line 10
         at org.jdesktop.j3d.loaders.vrml97.impl.Loader.load(Loader.java:481)
         at org.jdesktop.j3d.loaders.vrml97.impl.Loader.load(Loader.java:419)
         at org.jdesktop.j3d.loaders.vrml97.impl.Loader.load(Loader.java:334)
         at org.jdesktop.j3d.loaders.vrml97.VrmlLoader.doLoad(VrmlLoader.java:191)
         ... 17 more
    Caused by: org.jdesktop.j3d.loaders.vrml97.impl.ParseException: Unknown node type: Text3D
    when i load a normal 3d shape it works fine, it only happens whenm i use the text3d node, its because its a vrml extension?
    thnx for your help :D

  • Executing batch file from Java stored procedure hang

    Dears,
    I'm using the following code to execute batch file from Java Stored procedure, which is working fine from Java IDE JDeveloper 10.1.3.4.
    public static String runFile(String drive)
    String result = "";
    String content = "echo off\n" + "vol " + drive + ": | find /i \"Serial Number is\"";
    try {
    File directory = new File(drive + ":");
    File file = File.createTempFile("bb1", ".bat", directory);
    file.deleteOnExit();
    FileWriter fw = new java.io.FileWriter(file);
    fw.write(content);
    fw.close();
    // The next line is the command causing the problem
    Process p = Runtime.getRuntime().exec("cmd.exe /c " + file.getPath());
    BufferedReader input = new BufferedReader(new InputStreamReader(p.getInputStream()));
    String line;
    while ((line = input.readLine()) != null)
    result += line;
    input.close();
    file.delete();
    result = result.substring( result.lastIndexOf( ' ' )).trim();
    } catch (Exception e) {
    e.printStackTrace();
    result = e.getClass().getName() + " : " + e.getMessage();
    return result;
    The above code is used in getting the volume of a drive on windows, something like "80EC-C230"
    I gave the SYSTEM schema the required privilege to execute the code.
    EXEC DBMS_JAVA.grant_permission('SYSTEM', 'java.io.FilePermission', '&lt;&lt;ALL FILES&gt;&gt;', 'read ,write, execute, delete');
    EXEC DBMS_JAVA.grant_permission('SYSTEM', 'SYS:java.lang.RuntimePermission', 'writeFileDescriptor', '');
    EXEC DBMS_JAVA.grant_permission('SYSTEM', 'SYS:java.lang.RuntimePermission', 'readFileDescriptor', '');
    GRANT JAVAUSERPRIV TO SYSTEM;
    I have used the following to load the class in Oracle 9ir2 DB:
    loadjava -u [system/******@orcl|mailto:system/******@orcl] -v -resolve C:\Server\src\net\dev\Util.java
    CREATE FUNCTION A1(drive IN VARCHAR2) RETURN VARCHAR2 AS LANGUAGE JAVA NAME 'net.dev.Util.a1(java.lang.String) return java.lang.String';
    variable serial1 varchar2(1000);
    call A1( 'C' ) into :serial1;
    The problem that it hangs when I execute the call to the function (I have indicated the line causing the problem in a comment in the code).
    I have seen similar problems on other forums, but no solution posted
    [http://oracle.ittoolbox.com/groups/technical-functional/oracle-jdeveloper-l/run-an-exe-file-using-oracle-database-trigger-1567662]
    I have posted this in JDeveloper forum ([t-853821]) but suggested to post for forum in DB.
    Can anyne help?

    Dear Peter,
    You are totally right, I got this as mistake copy paste. I'm just having a Java utility for running external files outside Oracle DB, this is the method runFile()
    I'm passing it the content of script and names of file to be created on the fly and executed then deleted, sorry for the mistake in creating caller function.
    The main point, how I claim that the line in code where creating external process is the problem. I have tried the code with commenting this line and it was working ok, I made this to make sure of the permission required that I need to give to the schema passing security permission problems.
    The function script is running perfect if I'm executing vbs script outside Oracle using something like "cscript //NoLogo aaa1.vbs", but when I use the command line the call just never returns to me "cmd.exe /c bb1.bat".
    where content of bb1.bat as follows:
    echo off
    vol C: | find /i "Serial Number is"
    The above batch file just get the serial number of hard drive assigned when windows formatted HD.
    Same code runs outside Oracle just fine, but inside Oracle doesn't return if I exectued the following:
    variable serial1 varchar2(1000);
    call A1( 'C' ) into :serial1;
    Never returns
    Thanks for tracing teh issue to that details ;) hope you coul help.

  • How to create and edit a .ini file using java

    Hi All...
    Pls help me in creating and editing an .ini file using java...
    thanks in advance
    Regards,
    sathya

    Let's assume the ini file is a mapping type storage (key=value) so lets use Properties object. (works with java 1.4 & up)
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.util.Properties;
    public class Test {
         private static Properties props;
         public static void main(String[] args) throws IOException {
              File file = new File("test.ini");//This is out ini file
              props = new Properties();//Create the properties object
              read(file);//Read the ini file
              //Once we've populated the Properties object. set/add a property using the setProperty() method.
              props.setProperty("testing", "value");
              write(file);//Write to ini file
         public static void read(File file) throws IOException {
              FileInputStream fis = new FileInputStream(file);//Create a FileInputStream
              props.load(fis);//load the ini to the Properties file
              fis.close();//close
         public static void write(File file) throws IOException {
              FileOutputStream fos = new FileOutputStream(file);//Create a FileOutputStream
              props.store(fos, "");//write the Properties object values to our ini file
              fos.close();//close
    }

  • How to compare and edit Resource bundle file using java programe

    Hi All
    I have two resource bundle with key, value and some comments. I need to write a java code to compare both of the values of the keys and if the values are different then i want to replace the second value with the first value.
    Its a programe which will udpate the second file with the first file values.
    I tried using Properties class but it didnt worked because when i am saving the file using store method it removes all the comments and the order of text also got disturbed.
    How I need to do this any help appriciated.
    Please elt me know if someone needs more info.
    Thanks in advance.

    Let's assume the ini file is a mapping type storage (key=value) so lets use Properties object. (works with java 1.4 & up)
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.util.Properties;
    public class Test {
         private static Properties props;
         public static void main(String[] args) throws IOException {
              File file = new File("test.ini");//This is out ini file
              props = new Properties();//Create the properties object
              read(file);//Read the ini file
              //Once we've populated the Properties object. set/add a property using the setProperty() method.
              props.setProperty("testing", "value");
              write(file);//Write to ini file
         public static void read(File file) throws IOException {
              FileInputStream fis = new FileInputStream(file);//Create a FileInputStream
              props.load(fis);//load the ini to the Properties file
              fis.close();//close
         public static void write(File file) throws IOException {
              FileOutputStream fos = new FileOutputStream(file);//Create a FileOutputStream
              props.store(fos, "");//write the Properties object values to our ini file
              fos.close();//close
    }

  • An Error Message when loading a Resource.properties File

    Hi, all:
    I tried to load a Resources.properties file in a JSP page:
    <%@ page import="java.util.*" %>
    <%
    ResourceBundle rb = null;
    try {
    rb = ResourceBundle.getBundle("Resources");
    } catch (MissingResourceException e) {
    rb = null;
    throw new RuntimeException("The resource is missing!");
    %>
    Test
    When I run it, I got the following error message:
    Error 500--Internal Server Error
    From RFC 2068 Hypertext Transfer Protocol -- HTTP/1.1:
    10.5.1 500 Internal Server Error
    The server encountered an unexpected condition which prevented it from fulfilling the request.
    Any ideas what's going on here?
    Thanks
    Jeff

    Hi,
    I had a similar error just a few days ago. I could solve it by replicating the datasources again and activating the transfer structures via rs_transtru_activate_all. After that the load went fine.
    regards
    Siggi

  • I can't open or save file with Java Web Start

    Hi,
    i can't open or save file with Java Web Start:
    import java.io.*;
    import java.util.*;
    public class MetaDataFileCreator {
    public String fileNameSpace = null;
    public String fileName = null;
    protected Properties file = null;
    public MetaDataFileCreator(String fileNameSpace, String fileName) {
    this.fileNameSpace = fileNameSpace;
    this.fileName = fileName;
    public void createMetaDataFile() {
    try {
    System.out.println("file METADATA");
    ClassLoader cl = this.getClass().getClassLoader();
    String nameFileMetaData = fileNameSpace + fileName + ".txt";
    FileOutputStream fileOS = new FileOutputStream(cl.getResource(nameFileMetaData).getFile());
    file = new Properties();
    file.setProperty("aaaaa", "aaaa");
    file.store(fileOS, "");
    fileOS.close();
    } catch (Exception e) {
    System.out.println("Error writing metadata-file: " + e);
    System.exit(1);
    e.printStackTrace();
    I have try also to open a file like this:
    ClassLoader cl = this.getClass().getClassLoader();
    file.load(cl.getResourceAsStream(nameFile));
    also like this:
    try {
    fos = (FileOpenService)ServiceManager.lookup("javax.jnlp.FileOpenService");
    fss = (FileSaveService)ServiceManager.lookup("javax.jnlp.FileSaveService");
    } catch (UnavailableServiceException e) {
    fss = null;
    fos = null;
    System.out.println("Error with JNLP");
    System.exit(1);
    if (fss != null && fos != null) {
    try {
    // get a FileContents object to work with from the
    // FileOpenService
    FileContents fc = fos.openFileDialog(null, null);
    //FileContents newfc2 = fss.saveAsFileDialog(null, null, fc);
    // get the OutputStream and write the file back out
    if (fc.canWrite()) {
    // don't append
    os = fc.getOutputStream(false);
    } catch (Exception e) {
    e.printStackTrace();
    also like this:
    File f = new File((System.getProperty("user.home")+"x.txt").toString());
    FileOutputStream fileX = new FileOutputStream(f);
    OutputX = new PrintWriter(new BufferedWriter(new OutputStreamWriter(fileX, "UTF8")));
    OutputX.println(....
    but it doesn't work with Java Web Start.
    Can someone help me?
    How can I open or save file?
    thank you.
    Sebastiano

    Did you specify <all-permissions/> in your JNLP file? Did you sign your code? What error are you getting?

  • Problem in loading the jaxrpc war file - URGENT

    hi
    i am getting the exception when i tried to load the jaxrpc war file in JWSDP2.0 version.
    please see the following exception.
    javax.servlet.ServletException
    at com.sun.xml.rpc.server.http.JAXRPCServletDelegate.init(JAXRPCServletDelegate.java:50)
    at com.sun.xml.rpc.server.http.JAXRPCServlet.init(JAXRPCServlet.java:40)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:919)
    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:811)
    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3288)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:3468)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:821)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:545)
    at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:256)
    at org.apache.catalina.core.StandardHost.install(StandardHost.java:739)
    at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:474)
    at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:381)
    at org.apache.catalina.startup.HostConfig.start(HostConfig.java:780)
    at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:339)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:166
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1194)
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:705)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1186)
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:339)
    at org.apache.catalina.core.StandardService.start(StandardService.java:496)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:699)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:497)
    at org.apache.catalina.startup.Catalina.execute(Catalina.java:397)
    at org.apache.catalina.startup.Catalina.process(Catalina.java:177)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)
    [ERROR] http - -null <javax.servlet.ServletException>
    thanx in advance
    ~prasad

    Yes, that's true, but I think that happens because you deploy the web service in a non public area as your home directory. If you put it in a public area, your service should have 'running' status.
    Pedro Salazar.
    This is not a solution but I am posting this because
    this might help in guessing the cause of the error.
    I had similar problem. When I installed JWSDP, I
    copied the hello example from the tutorial example to
    my home directory. I also copied the "common"
    directory which is required by the build.xml.
    (common/target.xml is included in build.xml).
    Then I ran "ant build" and "ant install". I made
    required change in the "build.properties" in the
    "common" directory. But after this when I do "ant
    list" it shows me all the services running but this
    hello server as stopped.
    Then I copied the war file of the service (generated
    using "ant package") to the <JWSDP_HOME>/webapps. Then
    "ant list" showed me the hello service as running. I
    don't know why this is happening.
    regards
    Pankaj

  • How to use parameter file with java

    Is it possible to use a parameter file with Java, and is there any class/method to make it easy to call and use these parameter from a text file, other than scanning the whole text file manually as we can do normally with visual basic/c++, so we can call the program with the parameter file, like java testing c:\\testing.ini

    If I understand you correctly, you may be looking for a properties file. This is basically a text file that contains pairs of strings in the form:
    parameter1=value1
    parameter2=value2
    parameter3=value3
    ...etc.
    and the values are retrieved using the java.util.Properties class - see:
    http://java.sun.com/j2se/1.3/docs/api/java/util/Properties.html
    Sample use://Call chis method once, to load the props file.
    //props file is called "demo.properties", and is
    //in a directory that is included in the classpath
        private void loadMyProperties() throws Exception
         InputStream stream = getResourceAsStream("/demo.properties");
         if(stream == null)
             throw new Exception("stream is null!");
         demoProperties = new Properties();
         demoProperties.load(stream);
         stream.close();
    // Then you can retrieve properties in your code using:
    String param3 = demoProperties.getProperty("parameter3");
    //...etc

Maybe you are looking for