meta5.setContent("https://coderextreme.net/X3DJSONLD/sphere.x3d") head1.addMeta(meta5) meta6 = x3dpsail.meta() meta6.setName("description") meta6.setContent("a sphere") head1.addMeta(meta6) X3D0.setHead(head1) Scene7 = x3dpsail.Scene() Group8 = x3dpsail.Group() Shape9 = x3dpsail.Shape() Appearance10 = x3dpsail.Appearance() Material11 = x3dpsail.Material() Material11.setDiffuseColor([1, 1, 1]) Appearance10.setMaterial(Material11) Shape9.setAppearance(Appearance10) Sphere12 = x3dpsail.Sphere() Shape9.setGeometry(Sphere12) Group8.addChildren(Shape9) Scene7.addChildren(Group8) X3D0.setScene(Scene7) X3D0.toFileX3D("././sphere_RoundTrip.x3d")
x3dpsail.Viewpoint().setDescription( x3dpsail.SFString("Rubiks Cube")).setPosition( x3dpsail.SFVec3f(0, 0, 12)) ).addChild(x3dpsail.ProtoDeclare().setName( x3dpsail.SFString("sphere")).setProtoInterface( x3dpsail.ProtoInterface().addField(x3dpsail.field().setName( x3dpsail.SFString("xtranslation")).setAccessType( x3dpsail.SFString("inputOutput")).setType( x3dpsail.SFString("SFVec3f")).setValue( x3dpsail.SFString("0 0 0"))) ).setProtoBody(x3dpsail.ProtoBody().addChild( x3dpsail.Transform().setIS(x3dpsail.IS().addConnect( x3dpsail.connect().setNodeField( x3dpsail.SFString("translation")).setProtoField( x3dpsail.SFString("xtranslation")))).addChild( x3dpsail.Shape().setGeometry(x3dpsail.Sphere( )).setAppearance( x3dpsail.Appearance().setMaterial( x3dpsail.Material().setDiffuseColor( x3dpsail.SFColor(1, 1, 1))))) ))).addChild(x3dpsail.ProtoDeclare().setName( x3dpsail.SFString("three")).setProtoInterface( x3dpsail.ProtoInterface().addField( x3dpsail.field().setName( x3dpsail.SFString("ytranslation")).setAccessType( x3dpsail.SFString("inputOutput")).setType( x3dpsail.SFString("SFVec3f")).setValue( x3dpsail.SFString("0 0 0"))) ).setProtoBody(x3dpsail.ProtoBody().addChild( x3dpsail.Transform().setIS(x3dpsail.IS().addConnect( x3dpsail.connect().setNodeField( x3dpsail.SFString("translation")).setProtoField(
ProtoDeclare10 = x3dpsail.ProtoDeclare() ProtoDeclare10.setName("anyShape") ProtoInterface11 = x3dpsail.ProtoInterface() field12 = x3dpsail.field() field12.setName("xtranslation") field12.setAccessType("inputOutput") field12.setType("SFVec3f") field12.setValue("0 0 0") ProtoInterface11.addField(field12) field13 = x3dpsail.field() field13.setName("myShape") field13.setAccessType("inputOutput") field13.setType("MFNode") Shape14 = x3dpsail.Shape() Sphere15 = x3dpsail.Sphere() Shape14.setGeometry(Sphere15) Appearance16 = x3dpsail.Appearance() Material17 = x3dpsail.Material() Material17.setDiffuseColor([1, 1, 1]) Appearance16.setMaterial(Material17) Shape14.setAppearance(Appearance16) field13.addChildren(Shape14) ProtoInterface11.addField(field13) ProtoDeclare10.setProtoInterface(ProtoInterface11)
ProtoInterface29.addField(field30) ProtoDeclare28.setProtoInterface(ProtoInterface29) ProtoBody31 = x3dpsail.ProtoBody() Transform32 = x3dpsail.Transform() Transform32.setDEF("node") IS33 = x3dpsail.IS() connect34 = x3dpsail.connect() connect34.setNodeField("translation") connect34.setProtoField("translation") IS33.addConnect(connect34) Transform32.setIS(IS33) Shape35 = x3dpsail.Shape() Sphere36 = x3dpsail.Sphere() Sphere36.setRadius(0.1) Shape35.setGeometry(Sphere36) Appearance37 = x3dpsail.Appearance() Material38 = x3dpsail.Material() Material38.setDiffuseColor([1, 0, 0]) Appearance37.setMaterial(Material38) Shape35.setAppearance(Appearance37) Transform32.addChildren(Shape35) PositionInterpolator39 = x3dpsail.PositionInterpolator() PositionInterpolator39.setDEF("PI1") PositionInterpolator39.setKey([0, 1])
"resources/images/bLF.png", "https://coderextreme.net/X3DJSONLD/src/main/resources/images/bLF.png" ]) Background12.setRightUrl([ "resources/images/bRT.png", "https://coderextreme.net/X3DJSONLD/src/main/resources/images/bRT.png" ]) Background12.setTopUrl([ "resources/images/bTP.png", "https://coderextreme.net/X3DJSONLD/src/main/resources/images/bTP.png" ]) Scene9.addChildren(Background12) Transform13 = x3dpsail.Transform() Shape14 = x3dpsail.Shape() Sphere15 = x3dpsail.Sphere() Shape14.setGeometry(Sphere15) Appearance16 = x3dpsail.Appearance() Material17 = x3dpsail.Material() Material17.setDiffuseColor([0.7, 0.7, 0.7]) Material17.setSpecularColor([0.5, 0.5, 0.5]) Appearance16.setMaterial(Material17) ComposedCubeMapTexture18 = x3dpsail.ComposedCubeMapTexture() ComposedCubeMapTexture18.setDEF("texture") ImageTexture19 = x3dpsail.ImageTexture() ImageTexture19.setUrl([ "resources/images/bBK.png", "https://coderextreme.net/X3DJSONLD/src/main/resources/images/bBK.png" ])
)).addMeta(x3dpsail.meta().setName( x3dpsail.SFString("identifier")).setContent( x3dpsail.SFString( "https://coderextreme.net/X3DJSONLD/SFVec3f.x3d")))). setScene(x3dpsail.Scene().addChild( x3dpsail.NavigationInfo()).addChild( x3dpsail.Transform().setDEF( x3dpsail.SFString("transform")).addChild( x3dpsail.Shape().setAppearance( x3dpsail.Appearance().setMaterial( x3dpsail.Material().setDiffuseColor( x3dpsail.SFColor( 0.7, 0.7, 0.7)).setSpecularColor( x3dpsail.SFColor( 0.5, 0.5, 0.5)))).setGeometry( x3dpsail.Sphere())) ).addChild(x3dpsail.Script().setDEF( x3dpsail.SFString("Bounce")).addField( x3dpsail.field().setName( x3dpsail.SFString("set_translation")).setAccessType( x3dpsail.SFString("inputOnly")).setType( x3dpsail.SFString("SFVec3f")).setValue( x3dpsail.SFString("0 0 0")) ).addField(x3dpsail.field().setName( x3dpsail.SFString("translation_changed")).setAccessType( x3dpsail.SFString("outputOnly")).setType( x3dpsail.SFString("SFVec3f")).setValue( x3dpsail.SFString("0 0 0")) ).addField(x3dpsail.field().setName( x3dpsail.SFString("translation")).setAccessType( x3dpsail.SFString("inputOutput")).setType(
.addMeta(x3dpsail.meta().setName(x3dpsail.SFString("license")).setContent(x3dpsail.SFString("../../license.html")))) .setScene(x3dpsail.Scene() .addChild(x3dpsail.NavigationInfo().setType(x3dpsail.MFString(["EXAMINE","WALK","FLY","ANY"]))) .addChild(x3dpsail.Group() .addChild(x3dpsail.Transform().setTranslation(x3dpsail.SFVec3f(6.14221,0.0694613,-0.000999451)) .addChild(x3dpsail.Shape() .setAppearance(x3dpsail.Appearance() .setMaterial(x3dpsail.Material()) .setTexture(x3dpsail.PixelTexture().setDEF(x3dpsail.SFString("RgbOpacityCheckerboard")).setImage(x3dpsail.SFImage(2,2,4,-16776961,-65536,-65536,-16776961)))) .setGeometry(x3dpsail.Box()))) .addChild(x3dpsail.Transform().setTranslation(x3dpsail.SFVec3f(-4.85443,0.0694381,-0.00149918)) .addChild(x3dpsail.Shape() .setAppearance(x3dpsail.Appearance() .setMaterial(x3dpsail.Material()) .setTexture(x3dpsail.PixelTexture().setUSE(x3dpsail.SFString("RgbOpacityCheckerboard")))) .setGeometry(x3dpsail.Sphere()))) .addChild(x3dpsail.Transform().setTranslation(x3dpsail.SFVec3f(-1.47341,0.036672,-0.00175095)) .addChild(x3dpsail.Shape() .setAppearance(x3dpsail.Appearance() .setMaterial(x3dpsail.Material()) .setTexture(x3dpsail.PixelTexture().setUSE(x3dpsail.SFString("RgbOpacityCheckerboard")))) .setGeometry(x3dpsail.Cone()))) .addChild(x3dpsail.Transform().setTranslation(x3dpsail.SFVec3f(2.31094,0.0694206,-0.00187683)) .addChild(x3dpsail.Shape() .setAppearance(x3dpsail.Appearance() .setMaterial(x3dpsail.Material()) .setTexture(x3dpsail.PixelTexture().setUSE(x3dpsail.SFString("RgbOpacityCheckerboard")))) .setGeometry(x3dpsail.Cylinder())))))) X3D0.toFileX3D("./future/./rgb_alpha_RoundTrip.x3d")
]))).addChild(x3dpsail.Viewpoint().setDescription( x3dpsail.SFString("Cubes on Fire")).setPosition( x3dpsail.SFVec3f(0, 0, 12))).addChild(x3dpsail.ProtoDeclare( ).setName(x3dpsail.SFString("anyShape")).setProtoInterface( x3dpsail.ProtoInterface().addField( x3dpsail.field().setName( x3dpsail.SFString("xtranslation")).setAccessType( x3dpsail.SFString("inputOutput")).setType( x3dpsail.SFString("SFVec3f")).setValue( x3dpsail.SFString("0 0 0"))). addField(x3dpsail.field().setName( x3dpsail.SFString("myShape")).setAccessType( x3dpsail.SFString("inputOutput")).setType( x3dpsail.SFString("MFNode")). addChild(x3dpsail.Shape().setGeometry( x3dpsail.Sphere()).setAppearance( x3dpsail.Appearance().setMaterial( x3dpsail.Material().setDiffuseColor( x3dpsail.SFColor(1, 1, 1)))))) ).setProtoBody(x3dpsail.ProtoBody().addChild( x3dpsail.Transform().setIS(x3dpsail.IS().addConnect( x3dpsail.connect().setNodeField( x3dpsail.SFString("translation")).setProtoField( x3dpsail.SFString("xtranslation") )).addConnect(x3dpsail.connect().setNodeField( x3dpsail.SFString("children")).setProtoField( x3dpsail.SFString("myShape"))))))). addChild(x3dpsail.ProtoDeclare( ).setName(x3dpsail.SFString("three")).setProtoInterface( x3dpsail.ProtoInterface().addField(x3dpsail.field().setName( x3dpsail.SFString("ytranslation")).setAccessType(
Scene7.addChildren(Viewpoint9) ProtoDeclare10 = x3dpsail.ProtoDeclare() ProtoDeclare10.setName("anyShape") ProtoInterface11 = x3dpsail.ProtoInterface() field12 = x3dpsail.field() field12.setName("xtranslation") field12.setAccessType("inputOutput") field12.setType("SFVec3f") field12.setValue("0 0 0") ProtoInterface11.addField(field12) field13 = x3dpsail.field() field13.setName("myShape") field13.setAccessType("inputOutput") field13.setType("SFNode") Sphere14 = x3dpsail.Sphere() field13.addChildren(Sphere14) ProtoInterface11.addField(field13) ProtoDeclare10.setProtoInterface(ProtoInterface11) ProtoBody15 = x3dpsail.ProtoBody() Transform16 = x3dpsail.Transform() IS17 = x3dpsail.IS() connect18 = x3dpsail.connect() connect18.setNodeField("translation") connect18.setProtoField("xtranslation") IS17.addConnect(connect18)
Group22.addChildren(Transform23) Transform29 = x3dpsail.Transform() Transform29.setTranslation([-4.85443,0.0694381,-0.00149918]) Shape30 = x3dpsail.Shape() Appearance31 = x3dpsail.Appearance() Material32 = x3dpsail.Material() Appearance31.setMaterial(Material32) PixelTexture33 = x3dpsail.PixelTexture() PixelTexture33.setUSE("RgbOpacityCheckerboard") Appearance31.setTexture(PixelTexture33) Shape30.setAppearance(Appearance31) Sphere34 = x3dpsail.Sphere() Shape30.setGeometry(Sphere34) Transform29.addChildren(Shape30) Group22.addChildren(Transform29) Transform35 = x3dpsail.Transform() Transform35.setTranslation([-1.47341,0.036672,-0.00175095]) Shape36 = x3dpsail.Shape() Appearance37 = x3dpsail.Appearance() Material38 = x3dpsail.Material() Appearance37.setMaterial(Material38) PixelTexture39 = x3dpsail.PixelTexture() PixelTexture39.setUSE("RgbOpacityCheckerboard")
x3dpsail.SFString( "reference")))). setScene( x3dpsail.Scene() # Example scene to illustrate X3D nodes and fields (XML elements and attributes) .addChild(x3dpsail.WorldInfo().setTitle( x3dpsail.SFString("Hello world!") )).addChild(x3dpsail.Group().addChild( x3dpsail.Viewpoint().setDEF(x3dpsail.SFString("ViewUpClose")). setCenterOfRotation(x3dpsail.SFVec3f(0, -1, 0)) .setDescription(x3dpsail.SFString("Hello world!")) .setPosition(x3dpsail.SFVec3f(0, -1, 7)) ).addChild(x3dpsail.Transform( ).setRotation(x3dpsail.SFRotation( 0, 1, 0, 3 )).addChild(x3dpsail.Shape().setGeometry(x3dpsail.Sphere( )).setAppearance(x3dpsail.Appearance().setMaterial(x3dpsail.Material( ).setDEF(x3dpsail.SFString( "MaterialLightBlue" )).setDiffuseColor(x3dpsail.SFColor( 0.1, 0.5, 1 ))).setTexture(x3dpsail.ImageTexture().setDEF( x3dpsail .SFString("ImageCloudlessEarth") ).setUrl( x3dpsail .MFString([ "earth-topo.png", "earth-topo.jpg", "earth-topo-small.gif", "http://www.web3d.org/x3d/content/examples/Basic/earth-topo.png", "http://www.web3d.org/x3d/content/examples/Basic/earth-topo.jpg", "http://www.web3d.org/x3d/content/examples/Basic/earth-topo-small.gif"
ComposedShader34.addField(field40) ShaderPart41 = x3dpsail.ShaderPart() ShaderPart41.setUrl(["../shaders/cobweb.vs","https://coderextreme.net/X3DJSONLD/shaders/cobweb.vs"]) ShaderPart41.setType("VERTEX") ComposedShader34.addParts(ShaderPart41) ShaderPart42 = x3dpsail.ShaderPart() ShaderPart42.setUrl(["../shaders/pc_bubbles.fs","https://coderextreme.net/X3DJSONLD/shaders/pc.fs"]) ShaderPart42.setType("FRAGMENT") ComposedShader34.addParts(ShaderPart42) Appearance17.addShaders(ComposedShader34) Shape16.setAppearance(Appearance17) Sphere43 = x3dpsail.Sphere() Shape16.setGeometry(Sphere43) Transform15.addChildren(Shape16) ProtoBody14.addChildren(Transform15) Script44 = x3dpsail.Script() Script44.setDEF("Bounce") field45 = x3dpsail.field() field45.setName("translation") field45.setAccessType("inputOutput") field45.setType("SFVec3f") field45.setValue("0 0 0") Script44.addField(field45)
X3D0.setHead(head1) Scene7 = x3dpsail.Scene() Viewpoint8 = x3dpsail.Viewpoint() Viewpoint8.setPosition([0, 0, 5]) Viewpoint8.setDescription("Only Viewpoint") Scene7.addChildren(Viewpoint8) Background9 = x3dpsail.Background() Background9.setSkyColor([0.4, 0.4, 0.4]) Scene7.addChildren(Background9) Transform10 = x3dpsail.Transform() Transform10.setDEF("DECLpoint_G1_node") Shape11 = x3dpsail.Shape() Sphere12 = x3dpsail.Sphere() Sphere12.setRadius(0.1) Shape11.setGeometry(Sphere12) Appearance13 = x3dpsail.Appearance() Material14 = x3dpsail.Material() Material14.setDiffuseColor([1, 0, 0]) Appearance13.setMaterial(Material14) Shape11.setAppearance(Appearance13) Transform10.addChildren(Shape11) PositionInterpolator15 = x3dpsail.PositionInterpolator() PositionInterpolator15.setDEF("DECLpoint_G1_PI1") PositionInterpolator15.setKey([0, 1])
NavigationInfo8.setType(["EXAMINE"]) Scene7.addChildren(NavigationInfo8) Viewpoint9 = x3dpsail.Viewpoint() Viewpoint9.setPosition([0,0,4]) Viewpoint9.setOrientation([1,0,0,0]) Viewpoint9.setDescription("Bubble in action") Scene7.addChildren(Viewpoint9) ProtoDeclare10 = x3dpsail.ProtoDeclare() ProtoDeclare10.setName("Bubble") ProtoBody11 = x3dpsail.ProtoBody() Transform12 = x3dpsail.Transform() Transform12.setDEF("transform") Shape13 = x3dpsail.Shape() Sphere14 = x3dpsail.Sphere() Sphere14.setRadius(0.25) Shape13.setGeometry(Sphere14) Appearance15 = x3dpsail.Appearance() Material16 = x3dpsail.Material() Material16.setDiffuseColor([1,0,0]) Material16.setTransparency(0.2) Appearance15.setMaterial(Material16) Shape13.setAppearance(Appearance15) Transform12.addChildren(Shape13) Script17 = x3dpsail.Script() Script17.setDEF("bounce")
).setRightUrl( x3dpsail.MFString([ "../resources/images/RT.png", "https://coderextreme.net/X3DJSONLD/images/RT.png" ])). setTopUrl( x3dpsail.MFString([ "../resources/images/TP.png", "https://coderextreme.net/X3DJSONLD/images/TP.png" ]))).addChild(x3dpsail.ProtoDeclare().setName( x3dpsail.SFString("Bubble") ).setProtoBody(x3dpsail.ProtoBody().addChild( x3dpsail.Transform().setDEF( x3dpsail.SFString("transform") ).addChild(x3dpsail.Shape().setGeometry( x3dpsail.Sphere().setRadius( x3dpsail.SFFloat(0.25)) ).setAppearance(x3dpsail.Appearance().setMaterial( x3dpsail.Material().setDiffuseColor( x3dpsail.SFColor(1, 0, 0)).setTransparency( x3dpsail.SFFloat(0.2))))). addChild(x3dpsail.Script().setDEF( x3dpsail.SFString("bounce") ).addField(x3dpsail.field().setName( x3dpsail.SFString("scale")).setAccessType( x3dpsail.SFString("inputOutput")).setType( x3dpsail.SFString("SFVec3f")).setValue( x3dpsail.SFString("1 1 1"))). addField(x3dpsail.field().setName( x3dpsail.SFString("translation") ).setAccessType( x3dpsail.SFString("inputOutput")
X3D0 = (x3dpsail.X3D().setProfile(x3dpsail.SFString("Immersive")).setVersion(x3dpsail.SFString("3.3")) .setHead(x3dpsail.head() .addMeta(x3dpsail.meta().setName(x3dpsail.SFString("title")).setContent(x3dpsail.SFString("cobweb.x3d"))) .addMeta(x3dpsail.meta().setName(x3dpsail.SFString("creator")).setContent(x3dpsail.SFString("John Carlson"))) .addMeta(x3dpsail.meta().setName(x3dpsail.SFString("description")).setContent(x3dpsail.SFString("Tour around a prismatic sphere"))) .addMeta(x3dpsail.meta().setName(x3dpsail.SFString("generator")).setContent(x3dpsail.SFString("X3D-Edit, https://savage.nps.edu/X3D-Edit"))) .addMeta(x3dpsail.meta().setName(x3dpsail.SFString("identifier")).setContent(x3dpsail.SFString("https://coderextreme.net/X3DJSONLD/cobweb.x3d")))) .setScene(x3dpsail.Scene() .addChild(x3dpsail.NavigationInfo().setType(x3dpsail.MFString(["EXAMINE"]))) .addChild(x3dpsail.Viewpoint().setPosition(x3dpsail.SFVec3f(0,0,4)).setOrientation(x3dpsail.SFRotation(1,0,0,0)).setDescription(x3dpsail.SFString("Bubbles in action"))) .addChild(x3dpsail.Background().setBackUrl(x3dpsail.MFString(["../resources/images/BK.png","https://coderextreme.net/X3DJSONLD/images/BK.png"])).setBottomUrl(x3dpsail.MFString(["../resources/images/BT.png","https://coderextreme.net/X3DJSONLD/images/BT.png"])).setFrontUrl(x3dpsail.MFString(["../resources/images/FR.png","https://coderextreme.net/X3DJSONLD/images/FR.png"])).setLeftUrl(x3dpsail.MFString(["../resources/images/LF.png","https://coderextreme.net/X3DJSONLD/images/LF.png"])).setRightUrl(x3dpsail.MFString(["../resources/images/RT.png","https://coderextreme.net/X3DJSONLD/images/RT.png"])).setTopUrl(x3dpsail.MFString(["../resources/images/TP.png","https://coderextreme.net/X3DJSONLD/images/TP.png"]))) .addChild(x3dpsail.ProtoDeclare().setName(x3dpsail.SFString("Bubble")) .setProtoBody(x3dpsail.ProtoBody() .addChild(x3dpsail.Transform().setDEF(x3dpsail.SFString("transform")) .addChild(x3dpsail.Shape() .setGeometry(x3dpsail.Sphere().setRadius(x3dpsail.SFFloat(0.25))) .setAppearance(x3dpsail.Appearance() .setMaterial(x3dpsail.Material().setDiffuseColor(x3dpsail.SFColor(1,0,0)).setTransparency(x3dpsail.SFFloat(0.2))))) .addChild(x3dpsail.Script().setDEF(x3dpsail.SFString("bounce")) .addField(x3dpsail.field().setName(x3dpsail.SFString("scale")).setAccessType(x3dpsail.SFString("inputOutput")).setType(x3dpsail.SFString("SFVec3f")).setValue(x3dpsail.SFString("1 1 1"))) .addField(x3dpsail.field().setName(x3dpsail.SFString("translation")).setAccessType(x3dpsail.SFString("inputOutput")).setType(x3dpsail.SFString("SFVec3f")).setValue(x3dpsail.SFString("0 0 0"))) .addField(x3dpsail.field().setName(x3dpsail.SFString("velocity")).setAccessType(x3dpsail.SFString("inputOutput")).setType(x3dpsail.SFString("SFVec3f")).setValue(x3dpsail.SFString("0 0 0"))) .addField(x3dpsail.field().setName(x3dpsail.SFString("scalvel")).setAccessType(x3dpsail.SFString("inputOutput")).setType(x3dpsail.SFString("SFVec3f")).setValue(x3dpsail.SFString("0 0 0"))) .addField(x3dpsail.field().setName(x3dpsail.SFString("set_fraction")).setAccessType(x3dpsail.SFString("inputOnly")).setType(x3dpsail.SFString("SFFloat"))).setSourceCode('''ecmascript:\n"+ "function initialize() {\n"+ " velocity = new SFVec3f(Math.random() * 0.25 - 0.125, Math.random() * 0.25 - 0.125, Math.random() * 0.25 - 0.125);\n"+ "\n"+ " scalvel = new SFVec3f(Math.random() * 0.4, Math.random() * 0.4, Math.random() * 0.4);\n"+ "}\n"+ "\n"+ "function set_fraction(value) {\n"+
"../resources/images/all_probes/uffizi_cross/uffizi_left.png", "https://coderextreme.net/X3DJSONLD/images/all_probes/uffizi_cross/uffizi_left.png" ]) ).setRightUrl( x3dpsail.MFString([ "../resources/images/all_probes/uffizi_cross/uffizi_right.png", "https://coderextreme.net/X3DJSONLD/images/all_probes/uffizi_cross/uffizi_right.png" ]) ).setTopUrl( x3dpsail.MFString([ "../resources/images/all_probes/uffizi_cross/uffizi_top.png", "https://coderextreme.net/X3DJSONLD/images/all_probes/uffizi_cross/uffizi_top.png" ]) )).addChild(x3dpsail.Transform().setDEF( x3dpsail.SFString("Rose01") ).addChild(x3dpsail.Shape().setGeometry(x3dpsail.Sphere( )).setAppearance(x3dpsail.Appearance().setDEF( x3dpsail .SFString("_01_-_Default") ).setMaterial(x3dpsail.Material( ).setDiffuseColor(x3dpsail.SFColor( 0.7, 0.7, 0.7 )).setSpecularColor(x3dpsail.SFColor( 0.5, 0.5, 0.5 ))).setTexture(x3dpsail.ComposedCubeMapTexture().setBack(x3dpsail.ImageTexture( ).setUrl( x3dpsail .MFString([ "../resources/images/all_probes/uffizi_cross/uffizi_back.png", "https://coderextreme.net/X3DJSONLD/images/all_probes/uffizi_cross/uffizi_back.png" ]) )).setBottom(x3dpsail.ImageTexture().setUrl(
ShaderPart41.setType("FRAGMENT") IS42 = x3dpsail.IS() connect43 = x3dpsail.connect() connect43.setNodeField("url") connect43.setProtoField("fragment") IS42.addConnect(connect43) ShaderPart41.setIS(IS42) ComposedShader26.addParts(ShaderPart41) Appearance17.addShaders(ComposedShader26) Shape16.setAppearance(Appearance17) Sphere44 = x3dpsail.Sphere() Shape16.setGeometry(Sphere44) Transform15.addChildren(Shape16) Script45 = x3dpsail.Script() Script45.setDEF("Bounce") field46 = x3dpsail.field() field46.setName("translation") field46.setAccessType("inputOutput") field46.setType("SFVec3f") field46.setValue("0 0 0") Script45.addField(field46) field47 = x3dpsail.field() field47.setName("velocity")
x3dpsail.SFString("2") )).addParts(x3dpsail.ShaderPart().setUrl( x3dpsail.MFString([ "../shaders/cobweb.vs", "https://coderextreme.net/X3DJSONLD/shaders/cobweb.vs" ]) ).setType( x3dpsail.SFString("VERTEX") )).addParts(x3dpsail.ShaderPart().setUrl( x3dpsail .MFString([ "../shaders/pc_bubbles.fs", "https://coderextreme.net/X3DJSONLD/shaders/pc.fs" ])).setType(x3dpsail.SFString("FRAGMENT"))))). setGeometry( x3dpsail.Sphere()))).addChild(x3dpsail.Script().setDEF( x3dpsail.SFString("Bounce")).addField( x3dpsail.field().setName( x3dpsail.SFString("translation")).setAccessType( x3dpsail.SFString("inputOutput")).setType( x3dpsail.SFString("SFVec3f")).setValue( x3dpsail.SFString("0 0 0")) ).addField( x3dpsail.field().setName( x3dpsail.SFString("velocity")).setAccessType( x3dpsail.SFString("inputOutput")).setType( x3dpsail.SFString("SFVec3f")).setValue( x3dpsail.SFString("0 0 0")) ).addField(x3dpsail.field().setName( x3dpsail.SFString("set_fraction")).setAccessType( x3dpsail.SFString("inputOnly")).setType(
.addShaders(x3dpsail.ComposedShader().setDEF(x3dpsail.SFString("cobweb")).setLanguage(x3dpsail.SFString("GLSL")) .addField(x3dpsail.field().setName(x3dpsail.SFString("cube")).setType(x3dpsail.SFString("SFNode")).setAccessType(x3dpsail.SFString("inputOutput")) .addChild(x3dpsail.ComposedCubeMapTexture().setUSE(x3dpsail.SFString("texture")))) .addField(x3dpsail.field().setName(x3dpsail.SFString("chromaticDispertion")).setAccessType(x3dpsail.SFString("initializeOnly")).setType(x3dpsail.SFString("SFVec3f")).setValue(x3dpsail.SFString("0.98 1 1.033"))) .addField(x3dpsail.field().setName(x3dpsail.SFString("bias")).setType(x3dpsail.SFString("SFFloat")).setAccessType(x3dpsail.SFString("inputOnly")).setValue(x3dpsail.SFString("0.5"))) .addField(x3dpsail.field().setName(x3dpsail.SFString("scale")).setType(x3dpsail.SFString("SFFloat")).setAccessType(x3dpsail.SFString("inputOnly")).setValue(x3dpsail.SFString("0.5"))) .addField(x3dpsail.field().setName(x3dpsail.SFString("power")).setType(x3dpsail.SFString("SFFloat")).setAccessType(x3dpsail.SFString("inputOnly")).setValue(x3dpsail.SFString("2"))) .addField(x3dpsail.field().setName(x3dpsail.SFString("a")).setType(x3dpsail.SFString("SFFloat")).setAccessType(x3dpsail.SFString("inputOnly")).setValue(x3dpsail.SFString("10"))) .addField(x3dpsail.field().setName(x3dpsail.SFString("b")).setType(x3dpsail.SFString("SFFloat")).setAccessType(x3dpsail.SFString("inputOnly")).setValue(x3dpsail.SFString("1"))) .addField(x3dpsail.field().setName(x3dpsail.SFString("c")).setType(x3dpsail.SFString("SFFloat")).setAccessType(x3dpsail.SFString("inputOnly")).setValue(x3dpsail.SFString("20"))) .addField(x3dpsail.field().setName(x3dpsail.SFString("d")).setType(x3dpsail.SFString("SFFloat")).setAccessType(x3dpsail.SFString("inputOnly")).setValue(x3dpsail.SFString("20"))) .addField(x3dpsail.field().setName(x3dpsail.SFString("tdelta")).setType(x3dpsail.SFString("SFFloat")).setAccessType(x3dpsail.SFString("inputOnly")).setValue(x3dpsail.SFString("0"))) .addField(x3dpsail.field().setName(x3dpsail.SFString("pdelta")).setType(x3dpsail.SFString("SFFloat")).setAccessType(x3dpsail.SFString("inputOnly")).setValue(x3dpsail.SFString("0"))) .addParts(x3dpsail.ShaderPart().setUrl(x3dpsail.MFString(["../shaders/cobweb_flowers_chromatic.vs","https://coderextreme.net/X3DJSONLD/shaders/cobweb_flowers_chromatic.vs"])).setType(x3dpsail.SFString("VERTEX"))) .addParts(x3dpsail.ShaderPart().setUrl(x3dpsail.MFString(["../shaders/common.fs","https://coderextreme.net/X3DJSONLD/shaders/common.fs"])).setType(x3dpsail.SFString("FRAGMENT"))))) .setGeometry(x3dpsail.Sphere().setSolid(x3dpsail.SFBool(False))))) .addChild(x3dpsail.Script().setDEF(x3dpsail.SFString("UrlSelector")).setDirectOutput(x3dpsail.SFBool(True)) .addField(x3dpsail.field().setName(x3dpsail.SFString("frontUrls")).setType(x3dpsail.SFString("MFString")).setAccessType(x3dpsail.SFString("initializeOnly")).setValue(x3dpsail.SFString("\"../resources/images/all_probes/beach_cross/beach_front.png\" \"../resources/images/all_probes/building_cross/building_front.png\" \"../resources/images/all_probes/campus_cross/campus_front.png\" \"../resources/images/all_probes/galileo_cross/galileo_front.png\" \"../resources/images/all_probes/grace_cross/grace_front.png\" \"../resources/images/all_probes/kitchen_cross/kitchen_front.png\" \"../resources/images/all_probes/rnl_cross/rnl_front.png\" \"../resources/images/all_probes/stpeters_cross/stpeters_front.png\" \"../resources/images/all_probes/uffizi_cross/uffizi_front.png\""))) .addField(x3dpsail.field().setName(x3dpsail.SFString("backUrls")).setType(x3dpsail.SFString("MFString")).setAccessType(x3dpsail.SFString("initializeOnly")).setValue(x3dpsail.SFString("\"../resources/images/all_probes/beach_cross/beach_back.png\" \"../resources/images/all_probes/building_cross/building_back.png\" \"../resources/images/all_probes/campus_cross/campus_back.png\" \"../resources/images/all_probes/galileo_cross/galileo_back.png\" \"../resources/images/all_probes/grace_cross/grace_back.png\" \"../resources/images/all_probes/kitchen_cross/kitchen_back.png\" \"../resources/images/all_probes/rnl_cross/rnl_back.png\" \"../resources/images/all_probes/stpeters_cross/stpeters_back.png\" \"../resources/images/all_probes/uffizi_cross/uffizi_back.png\""))) .addField(x3dpsail.field().setName(x3dpsail.SFString("leftUrls")).setType(x3dpsail.SFString("MFString")).setAccessType(x3dpsail.SFString("initializeOnly")).setValue(x3dpsail.SFString("\"../resources/images/all_probes/beach_cross/beach_left.png\" \"../resources/images/all_probes/building_cross/building_left.png\" \"../resources/images/all_probes/campus_cross/campus_left.png\" \"../resources/images/all_probes/galileo_cross/galileo_left.png\" \"../resources/images/all_probes/grace_cross/grace_left.png\" \"../resources/images/all_probes/kitchen_cross/kitchen_left.png\" \"../resources/images/all_probes/rnl_cross/rnl_left.png\" \"../resources/images/all_probes/stpeters_cross/stpeters_left.png\" \"../resources/images/all_probes/uffizi_cross/uffizi_left.png\""))) .addField(x3dpsail.field().setName(x3dpsail.SFString("rightUrls")).setType(x3dpsail.SFString("MFString")).setAccessType(x3dpsail.SFString("initializeOnly")).setValue(x3dpsail.SFString("\"../resources/images/all_probes/beach_cross/beach_right.png\" \"../resources/images/all_probes/building_cross/building_right.png\" \"../resources/images/all_probes/campus_cross/campus_right.png\" \"../resources/images/all_probes/galileo_cross/galileo_right.png\" \"../resources/images/all_probes/grace_cross/grace_right.png\" \"../resources/images/all_probes/kitchen_cross/kitchen_right.png\" \"../resources/images/all_probes/rnl_cross/rnl_right.png\" \"../resources/images/all_probes/stpeters_cross/stpeters_right.png\" \"../resources/images/all_probes/uffizi_cross/uffizi_right.png\""))) .addField(x3dpsail.field().setName(x3dpsail.SFString("topUrls")).setType(x3dpsail.SFString("MFString")).setAccessType(x3dpsail.SFString("initializeOnly")).setValue(x3dpsail.SFString("\"../resources/images/all_probes/beach_cross/beach_top.png\" \"../resources/images/all_probes/building_cross/building_top.png\" \"../resources/images/all_probes/campus_cross/campus_top.png\" \"../resources/images/all_probes/galileo_cross/galileo_top.png\" \"../resources/images/all_probes/grace_cross/grace_top.png\" \"../resources/images/all_probes/kitchen_cross/kitchen_top.png\" \"../resources/images/all_probes/rnl_cross/rnl_top.png\" \"../resources/images/all_probes/stpeters_cross/stpeters_top.png\" \"../resources/images/all_probes/uffizi_cross/uffizi_top.png\""))) .addField(x3dpsail.field().setName(x3dpsail.SFString("bottomUrls")).setType(x3dpsail.SFString("MFString")).setAccessType(x3dpsail.SFString("initializeOnly")).setValue(x3dpsail.SFString("\"../resources/images/all_probes/beach_cross/beach_bottom.png\" \"../resources/images/all_probes/building_cross/building_bottom.png\" \"../resources/images/all_probes/campus_cross/campus_bottom.png\" \"../resources/images/all_probes/galileo_cross/galileo_bottom.png\" \"../resources/images/all_probes/grace_cross/grace_bottom.png\" \"../resources/images/all_probes/kitchen_cross/kitchen_bottom.png\" \"../resources/images/all_probes/rnl_cross/rnl_bottom.png\" \"../resources/images/all_probes/stpeters_cross/stpeters_bottom.png\" \"../resources/images/all_probes/uffizi_cross/uffizi_bottom.png\""))) .addField(x3dpsail.field().setName(x3dpsail.SFString("front")).setType(x3dpsail.SFString("MFString")).setAccessType(x3dpsail.SFString("inputOutput"))) .addField(x3dpsail.field().setName(x3dpsail.SFString("back")).setType(x3dpsail.SFString("MFString")).setAccessType(x3dpsail.SFString("inputOutput"))) .addField(x3dpsail.field().setName(x3dpsail.SFString("left")).setType(x3dpsail.SFString("MFString")).setAccessType(x3dpsail.SFString("inputOutput"))) .addField(x3dpsail.field().setName(x3dpsail.SFString("right")).setType(x3dpsail.SFString("MFString")).setAccessType(x3dpsail.SFString("inputOutput"))) .addField(x3dpsail.field().setName(x3dpsail.SFString("top")).setType(x3dpsail.SFString("MFString")).setAccessType(x3dpsail.SFString("inputOutput"))) .addField(x3dpsail.field().setName(x3dpsail.SFString("bottom")).setType(x3dpsail.SFString("MFString")).setAccessType(x3dpsail.SFString("inputOutput"))) .addField(x3dpsail.field().setName(x3dpsail.SFString("set_fraction")).setType(x3dpsail.SFString("SFFloat")).setAccessType(x3dpsail.SFString("inputOnly"))) .addField(x3dpsail.field().setName(x3dpsail.SFString("old")).setType(x3dpsail.SFString("SFInt32")).setAccessType(x3dpsail.SFString("inputOutput")).setValue(x3dpsail.SFString("-1"))).setSourceCode('''ecmascript:\n"+
"../resources/images/LF.png", "https://coderextreme.net/X3DJSONLD/images/LF.png" ]) Background10.setRightUrl([ "../resources/images/RT.png", "https://coderextreme.net/X3DJSONLD/images/RT.png" ]) Background10.setTopUrl([ "../resources/images/TP.png", "https://coderextreme.net/X3DJSONLD/images/TP.png" ]) Scene8.addChildren(Background10) Transform11 = x3dpsail.Transform() Shape12 = x3dpsail.Shape() Sphere13 = x3dpsail.Sphere() Shape12.setGeometry(Sphere13) Appearance14 = x3dpsail.Appearance() Material15 = x3dpsail.Material() Material15.setDiffuseColor([0.7, 0.7, 0.7]) Material15.setSpecularColor([0.5, 0.5, 0.5]) Appearance14.setMaterial(Material15) Shape12.setAppearance(Appearance14) Transform11.addChildren(Shape12) Scene8.addChildren(Transform11) TimeSensor16 = x3dpsail.TimeSensor()
Transform43.addChildren(Shape44) #<Transform translation=\"-0.5 -2.5 0\"> <Shape> <Text DEF=\"DownString\" string='\"d\"'/> </Shape> </Transform> <StringSensor DEF=\"DownSensor\" enabled=\"false\"/> <TouchSensor description='touch to activate' DEF=\"DownTouch\" enabled=\"true\"/> Group13.addChildren(Transform43) #center Transform48 = x3dpsail.Transform() Shape49 = x3dpsail.Shape() Appearance50 = x3dpsail.Appearance() Material51 = x3dpsail.Material() Material51.setDiffuseColor([1,0,0.7]) Appearance50.setMaterial(Material51) Shape49.setAppearance(Appearance50) Sphere52 = x3dpsail.Sphere() Shape49.setGeometry(Sphere52) Transform48.addChildren(Shape49) Transform53 = x3dpsail.Transform() Transform53.setScale([0.5,0.5,0.5]) Transform53.setTranslation([-0.5,0,1]) Shape54 = x3dpsail.Shape() Appearance55 = x3dpsail.Appearance() Material56 = x3dpsail.Material() Material56.setUSE("MaterialLightBlue") Appearance55.setMaterial(Material56) Shape54.setAppearance(Appearance55)
ProtoInterface10.addField(field11) ProtoDeclare9.setProtoInterface(ProtoInterface10) ProtoBody12 = x3dpsail.ProtoBody() Transform13 = x3dpsail.Transform() Transform13.setDEF("transform") IS14 = x3dpsail.IS() connect15 = x3dpsail.connect() connect15.setNodeField("translation") connect15.setProtoField("position") IS14.addConnect(connect15) Transform13.setIS(IS14) Shape16 = x3dpsail.Shape() Sphere17 = x3dpsail.Sphere() Shape16.setGeometry(Sphere17) Appearance18 = x3dpsail.Appearance() Material19 = x3dpsail.Material() Material19.setDiffuseColor([1, 0, 0]) Appearance18.setMaterial(Material19) Shape16.setAppearance(Appearance18) Transform13.addChildren(Shape16) Transform20 = x3dpsail.Transform() Transform20.setTranslation([1, 0, 0]) Shape21 = x3dpsail.Shape() Text22 = x3dpsail.Text()
ProtoInterface11.addField(field12) ProtoDeclare10.setProtoInterface(ProtoInterface11) ProtoBody13 = x3dpsail.ProtoBody() Transform14 = x3dpsail.Transform() Transform14.setDEF("node") IS15 = x3dpsail.IS() connect16 = x3dpsail.connect() connect16.setNodeField("translation") connect16.setProtoField("translation") IS15.addConnect(connect16) Transform14.setIS(IS15) Shape17 = x3dpsail.Shape() Sphere18 = x3dpsail.Sphere() Sphere18.setRadius(0.1) Shape17.setGeometry(Sphere18) Appearance19 = x3dpsail.Appearance() Material20 = x3dpsail.Material() Material20.setDiffuseColor([1, 0, 0]) Appearance19.setMaterial(Material20) Shape17.setAppearance(Appearance19) Transform14.addChildren(Shape17) PositionInterpolator21 = x3dpsail.PositionInterpolator() PositionInterpolator21.setDEF("PI1") PositionInterpolator21.setKey([0, 1])
Scene7.addChildren(Viewpoint8) Background9 = x3dpsail.Background() Background9.setSkyColor([0.4, 0.4, 0.4]) Scene7.addChildren(Background9) Transform10 = x3dpsail.Transform() Transform10.setDEF("G1") Shape11 = x3dpsail.Shape() Appearance12 = x3dpsail.Appearance() Material13 = x3dpsail.Material() Material13.setDiffuseColor([0.7, 0.2, 0.2]) Appearance12.setMaterial(Material13) Shape11.setAppearance(Appearance12) Sphere14 = x3dpsail.Sphere() Sphere14.setRadius(0.1) Shape11.setGeometry(Sphere14) Transform10.addChildren(Shape11) PlaneSensor15 = x3dpsail.PlaneSensor() PlaneSensor15.setDescription("Grab to move") PlaneSensor15.setDEF("PS1") Transform10.addChildren(PlaneSensor15) ROUTE16 = x3dpsail.ROUTE() ROUTE16.setFromNode("PS1") ROUTE16.setFromField("translation_changed") ROUTE16.setToNode("G1") ROUTE16.setToField("set_translation")
x3dpsail.SFString( "https://coderextreme.net/X3DJSONLD/bubble.x3d")))) .setScene(x3dpsail.Scene().addChild(x3dpsail.NavigationInfo().setType( x3dpsail.MFString([ "EXAMINE" ]))).addChild(x3dpsail.Viewpoint().setPosition( x3dpsail.SFVec3f(0, 0, 4)).setOrientation( x3dpsail.SFRotation(1, 0, 0, 0)).setDescription( x3dpsail.SFString("Bubble in action") )).addChild(x3dpsail.ProtoDeclare().setName( x3dpsail.SFString("Bubble")).setProtoBody( x3dpsail.ProtoBody().addChild( x3dpsail.Transform().setDEF( x3dpsail.SFString("transform") ).addChild(x3dpsail.Shape().setGeometry( x3dpsail.Sphere().setRadius( x3dpsail.SFFloat(0.25))).setAppearance( x3dpsail.Appearance().setMaterial( x3dpsail.Material( ).setDiffuseColor( x3dpsail.SFColor( 1, 0, 0)).setTransparency( x3dpsail.SFFloat( 0.2))))). addChild(x3dpsail.Script().setDEF( x3dpsail.SFString("bounce") ).addField(x3dpsail.field().setName( x3dpsail.SFString("scale") ).setAccessType( x3dpsail.SFString("inputOutput")).setType( x3dpsail.SFString("SFVec3f")).setValue(
"https://coderextreme.net/X3DJSONLD/shaders/x3dom.vs" ]) ShaderPart37.setType("VERTEX") ComposedShader31.addParts(ShaderPart37) ShaderPart38 = x3dpsail.ShaderPart() ShaderPart38.setUrl( ["../shaders/mix.fs", "https://coderextreme.net/X3DJSONLD/shaders/mix.fs"]) ShaderPart38.setType("FRAGMENT") ComposedShader31.addParts(ShaderPart38) Appearance14.addShaders(ComposedShader31) Shape13.setAppearance(Appearance14) Sphere39 = x3dpsail.Sphere() Sphere39.setRadius(30) Shape13.setGeometry(Sphere39) Transform12.addChildren(Shape13) Script40 = x3dpsail.Script() Script40.setDEF("UrlSelector") Script40.setDirectOutput(True) field41 = x3dpsail.field() field41.setName("frontUrls") field41.setType("MFString") field41.setAccessType("initializeOnly") field41.setValue( "\"../resources/images/all_probes/beach_cross/beach_front.png\" \"../resources/images/all_probes/building_cross/building_front.png\" \"../resources/images/all_probes/campus_cross/campus_front.png\" \"../resources/images/all_probes/galileo_cross/galileo_front.png\" \"../resources/images/all_probes/grace_cross/grace_front.png\" \"../resources/images/all_probes/kitchen_cross/kitchen_front.png\" \"../resources/images/all_probes/rnl_cross/rnl_front.png\" \"../resources/images/all_probes/stpeters_cross/stpeters_front.png\" \"../resources/images/all_probes/uffizi_cross/uffizi_front.png\"" )
WorldInfo26 = x3dpsail.WorldInfo() WorldInfo26.setTitle("Hello world!") Scene25.addChildren(WorldInfo26) Group27 = x3dpsail.Group() Viewpoint28 = x3dpsail.Viewpoint() Viewpoint28.setDEF("ViewUpClose") Viewpoint28.setCenterOfRotation([0, -1, 0]) Viewpoint28.setDescription("Hello world!") Viewpoint28.setPosition([0, -1, 7]) Group27.addChildren(Viewpoint28) Transform29 = x3dpsail.Transform() Transform29.setRotation([0, 1, 0, 3]) Shape30 = x3dpsail.Shape() Sphere31 = x3dpsail.Sphere() Shape30.setGeometry(Sphere31) Appearance32 = x3dpsail.Appearance() Material33 = x3dpsail.Material() Material33.setDEF("MaterialLightBlue") Material33.setDiffuseColor([0.1, 0.5, 1]) Appearance32.setMaterial(Material33) ImageTexture34 = x3dpsail.ImageTexture() ImageTexture34.setDEF("ImageCloudlessEarth") ImageTexture34.setUrl([ "earth-topo.png", "earth-topo.jpg", "earth-topo-small.gif", "http://www.web3d.org/x3d/content/examples/Basic/earth-topo.png", "http://www.web3d.org/x3d/content/examples/Basic/earth-topo.jpg", "http://www.web3d.org/x3d/content/examples/Basic/earth-topo-small.gif"