<ProtoDeclare name="Ball"> <ProtoInterface> <field accessType="inputOutput" name="translation" type="SFVec3f"/> <field accessType="initializeOnly" name="radius" type="SFFloat"/> <field accessType="inputOutput" name="color" type="SFColor"/> </ProtoInterface> <ProtoBody> <Transform DEF="s_transform"> <IS> <connect nodeField="translation" protoField="translation"/> </IS> <Shape> <Sphere DEF="sphere"> <IS> <connect nodeField="radius" protoField="radius"/> </IS> </Sphere> <Appearance> <Material DEF="s_mat"> <IS> <connect nodeField="diffuseColor" protoField="color"/> </IS> </Material> </Appearance> </Shape> </Transform> </ProtoBody> </ProtoDeclare> |
<ProtoInstance name="Ball"> <fieldValue name="translation" value="10 0 0"/> <fieldValue name="radius" value="2"/> <fieldValue name="color" value="1 0 0"/> </ProtoInstance> |