[x3d-public] Forgot what we did Re: ProtoInstance for material in X3DUOM.

John Carlson yottzumm at gmail.com
Tue Sep 5 02:30:29 PDT 2017


I forgot what we did to support ProtoInstance under X3DMaterialNode under Appearance.  I don’t see much support for ProtoInstance in material fields in Appearance in X3DUOM.  Is it valid to have a material which is a ProtoInstance?  I need some way of generating it in the JSON schema from X3DUOM.

See attached files.  Also, run the X3D file through X3DJSAIL and see if it produces similar JSON.  I see two differences (ProtoInstance is in an array, containerField is -children instead of -material), but my serializers may be off.

$ node ../node/jsondiff.js X3dHeaderPrototypeSyntaxExamples.json X3dHeaderPrototypeSyntaxExamples.new.json
================================================================================
C:\Users\coderextreme\X3DJSONLD\src\main\node\jsondiff.js X3dHeaderPrototypeSynt
axExamples.json X3dHeaderPrototypeSyntaxExamples.new.json
@5 /X3D/Scene/-children/11/Transform/-children/0/Shape/-appearance/Appearance/-m
aterial
< {"ProtoInstance":{"@name":"EmissiveMaterial","fieldValue":[{"@name":"onlyColor
","@value":[0.2,0.6,0.6]}]}}
@7 /X3D/Scene/-children/11/Transform/-children/0/Shape/-appearance/Appearance/-c
hildren
> [{"ProtoInstance":{"@name":"EmissiveMaterial","fieldValue":[{"@name":"onlyColo
r","@value":[0.2,0.6,0.6]}]}}]

Related Java:
              .setMaterial(ProtoInstance2 = new ProtoInstanceObject().setName("EmissiveMaterial")))

See, containerField is material. However the ProtoBody has two children, the first is a comment, so -children may be correct???

Rescue me from my confusion!
John

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20170905/2d138f6f/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: X3dHeaderPrototypeSyntaxExamples.json
Type: application/json
Size: 14190 bytes
Desc: not available
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20170905/2d138f6f/attachment-0001.json>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: X3dHeaderPrototypeSyntaxExamples.x3d
Type: application/octet-stream
Size: 6397 bytes
Desc: not available
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20170905/2d138f6f/attachment-0001.obj>


More information about the x3d-public mailing list