[X3D-Public] VRML models - was Re: Octaga?

Richard Kennaway jrk at cmp.uea.ac.uk
Fri May 13 08:40:40 PDT 2011


At 05:59 +0100 6/5/11, Don Brutzman wrote:
>On 5/5/2011 10:12 AM, Richard Kennaway wrote:
>>  [...]
>>  If anyone wants a torture test for their VRML viewer (I haven't 
>>made the jump to X3D yet), there's a 0.8MB example at 
>>http://www.cmp.uea.ac.uk/~jrk/distribution/TestSuccessiveFingers.wrl, 
>>and a screen shot at 
>>http://www.cmp.uea.ac.uk/~jrk/distribution/TestSuccessiveFingers.png
>>  I generate these files for prototyping animations. The production 
>>environment that uses my animation generator doesn't involve VRML 
>>at all.
>
>i clicked and it worked, looks fabulous in BS Contact under windows.
>They also have a Mac version.
>
>HUD controls all seemed to work too.  Very nice!
>
>i then tried the VRML-to-X3D importer we bundled into X3D-Edit.
>that translation produced the following output with some errors:

Thanks for doing this.

I've just installed X3D-Edit and got the same result.  The reported 
line numbers though don't seem to correspond well to the original 
file.

>  [DefParserOutput.error] [Node] [Error] invalid field name IS at line 1038
>  ignoring remaining fields of node Group
>  [DefParserOutput.error] [Node] [Error] invalid field name IS at line 1060
>  ignoring remaining fields of node Transform

I believe this refers to the two PROTOs defined in lines 945 to 991. 
There are quite a few of these errors.  I'm at a loss to know what is 
wrong, but here are three minimal self-contained examples.  Two fail 
and one succeeds.

This fails:

#VRML V2.0 utf8

Script {
     eventIn SFFloat set_fraction
     field SFNode test ScalarInterpolator {
         set_fraction IS set_fraction
     }
}


This fails:

#VRML V2.0 utf8

PROTO Test [
     eventIn SFFloat set_fraction
]{
     ScalarInterpolator {
         set_fraction IS set_fraction
     }
}


This succeeds:

#VRML V2.0 utf8

PROTO Test [
     field MFFloat key [ 0 1 ]
]{
     ScalarInterpolator {
         key IS key
     }
}


In general, it seems that all of the problematic cases involve 
eventIn or eventOut fields.  Nodes that only used IS on fields and 
exposedFields didn't cause any errors.

========

>  [DefParserOutput.error] [Node] [Error] unresolveable reference USE 
>BWSensor at line 10647

"USE BWSensor" occurs on line 10343, like this:

		DEF BWSensor Script {
		    ...various fields...
		    field SFNode self USE BWSensor
		    ...more fields...
		}

Can a Script node in X3D not reference itself like this?  I use 
"self" in the script of this node and others, as an argument to 
Browser.addRoute, called by initialize() to set up routes between the 
script and a node supplied as a field of the enclosing PROTO.

If the self-reference is a problem, I could split the script into two 
scripts nodes, one of them setting up routes between the external 
node and the other script node, the latter doing all of the rest of 
the work of the script.  But shouldn't it work as is, as it does in 
VRML?  Here's a self-contained example that fails:

#VRML V2.0 utf8

DEF Test Script {
     field SFNode self USE Test
}

========


>  [DefParserOutput.error] [Node] [Error] unresolveable reference USE 
>HUDToggleTransform at line 12754

Another circular reference that works in VRML.  This script needs a 
reference to an ancestral Transform node in order to set one of its 
fields.  Here's a self-contained example that also fails:

#VRML V2.0 utf8

DEF Test Transform {
     children [
         Script {
             field SFNode test USE Test
         }
     ]
}

On the other hand, it works if I move the Script out of the Transform:

#VRML V2.0 utf8

Group {
     children [
         DEF Test Transform {
             children [
             ]
         }
         Script {
             field SFNode test USE Test
         }
     ]
}


--
Richard Kennaway, jrk at cmp.uea.ac.uk, http://www.cmp.uea.ac.uk/~jrk/
School of Computing Sciences,
University of East Anglia, Norwich NR4 7TJ, U.K.




More information about the X3D-Public mailing list