ProtoBody79.addChildren(Transform80) ProtoDeclare71.setProtoBody(ProtoBody79) Scene7.addChildren(ProtoDeclare71) ProtoInstance95 = x3dpsail.ProtoInstance() ProtoInstance95.setName("twentyseven") fieldValue96 = x3dpsail.fieldValue() fieldValue96.setName("ttranslation") fieldValue96.setValue("0 0 0") ProtoInstance95.addFieldValue(fieldValue96) fieldValue97 = x3dpsail.fieldValue() fieldValue97.setName("myShape") Shape98 = x3dpsail.Shape() Box99 = x3dpsail.Box() Box99.setSize([1, 1, 1]) Shape98.setGeometry(Box99) Appearance100 = x3dpsail.Appearance() Material101 = x3dpsail.Material() Material101.setDiffuseColor([0, 1, 0]) Appearance100.setMaterial(Material101) Shape98.setAppearance(Appearance100) fieldValue97.addChildren(Shape98) ProtoInstance95.addFieldValue(fieldValue97)
x3dpsail.fieldValue().setName( x3dpsail.SFString("xtranslation")).setValue( x3dpsail.SFString("2 0 0")) ).setIS(x3dpsail.IS().addConnect( x3dpsail.connect().setNodeField( x3dpsail.SFString("myShape")).setProtoField( x3dpsail.SFString("myShape"))))). addChild(x3dpsail.ProtoInstance().setName( x3dpsail.SFString("anyShape")).addFieldValue( x3dpsail.fieldValue().setName( x3dpsail.SFString("xtranslation")).setValue( x3dpsail.SFString("-2 0 0")) ).setIS(x3dpsail.IS().addConnect( x3dpsail.connect().setNodeField( x3dpsail.SFString("myShape")).setProtoField( x3dpsail.SFString("myShape")))))))). addChild(x3dpsail.ProtoInstance().setName( x3dpsail.SFString("three")).addFieldValue( x3dpsail.fieldValue().setName( x3dpsail.SFString("ytranslation")).setValue( x3dpsail.SFString("0 0 0")) ).addFieldValue(x3dpsail.fieldValue().setName( x3dpsail.SFString("myShape")).addChild( x3dpsail.Shape().setGeometry(x3dpsail.Box().setSize( x3dpsail.SFVec3f(1, 1, 1))).setAppearance( x3dpsail.Appearance().setMaterial( x3dpsail.Material().setDiffuseColor( x3dpsail.SFColor(0, 1, 0))))))))) X3D0.toFileX3D("./future/./Box_RoundTrip.x3d")
.addMeta(x3dpsail.meta().setName(x3dpsail.SFString("modified")).setContent(x3dpsail.SFString("2 April 2017"))) .addMeta(x3dpsail.meta().setName(x3dpsail.SFString("reference")).setContent(x3dpsail.SFString("http://X3dGraphics.com"))) .addMeta(x3dpsail.meta().setName(x3dpsail.SFString("reference")).setContent(x3dpsail.SFString("http://www.web3d.org/x3d/content/examples/X3dResources.html"))) .addMeta(x3dpsail.meta().setName(x3dpsail.SFString("rights")).setContent(x3dpsail.SFString("Copyright 2006, Daly Realism and Don Brutzman"))) .addMeta(x3dpsail.meta().setName(x3dpsail.SFString("subject")).setContent(x3dpsail.SFString("X3D, PixelTexture"))) .addMeta(x3dpsail.meta().setName(x3dpsail.SFString("identifier")).setContent(x3dpsail.SFString("http://X3dGraphics.com/examples/X3dForWebAuthors/Chapter05AppearanceMaterialTextures/Table5_18PixelTexture"))) .addMeta(x3dpsail.meta().setName(x3dpsail.SFString("generator")).setContent(x3dpsail.SFString("X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit"))) .addMeta(x3dpsail.meta().setName(x3dpsail.SFString("license")).setContent(x3dpsail.SFString("../license.html")))) .setScene(x3dpsail.Scene() .addChild(x3dpsail.Background().setSkyColor(x3dpsail.MFColor([0,0,1]))) .addChild(x3dpsail.Transform().setDEF(x3dpsail.SFString("Checkerboard")).setTranslation(x3dpsail.SFVec3f(0,0,-10)) .addChild(x3dpsail.Shape() .setAppearance(x3dpsail.Appearance() .setTextureTransform(x3dpsail.TextureTransform().setScale(x3dpsail.SFVec2f(500,500))) .setTexture(x3dpsail.PixelTexture().setImage(x3dpsail.SFImage(2,2,3,15119869,16767927,16767927,15119869)))) .setGeometry(x3dpsail.Box().setSize(x3dpsail.SFVec3f(1000,1000,0.01))))) .addChild(x3dpsail.Viewpoint().setDescription(x3dpsail.SFString("View All")).setPosition(x3dpsail.SFVec3f(0,0,20))) .addChild(x3dpsail.Viewpoint().setDescription(x3dpsail.SFString("Empty Image")).setPosition(x3dpsail.SFVec3f(0,5,5))) .addChild(x3dpsail.Transform().setDEF(x3dpsail.SFString("EmptyImage")).setRotation(x3dpsail.SFRotation(1,1,0,1)).setTranslation(x3dpsail.SFVec3f(0,5,0)) .addChild(x3dpsail.Shape() .setAppearance(x3dpsail.Appearance() .setTexture(x3dpsail.PixelTexture())) .setGeometry(x3dpsail.Box().setDEF(x3dpsail.SFString("StandardBox"))))) .addChild(x3dpsail.Viewpoint().setDescription(x3dpsail.SFString("Black and white PixelTexture")).setPosition(x3dpsail.SFVec3f(-5,0,5))) .addChild(x3dpsail.Transform().setDEF(x3dpsail.SFString("BW")).setRotation(x3dpsail.SFRotation(1,1,0,1)).setTranslation(x3dpsail.SFVec3f(-5,0,0)) .addChild(x3dpsail.Shape() .setAppearance(x3dpsail.Appearance() .setTexture(x3dpsail.PixelTexture().setImage(x3dpsail.SFImage(1,2,1,255,0)))) .setGeometry(x3dpsail.Box().setUSE(x3dpsail.SFString("StandardBox"))))) .addChild(x3dpsail.Viewpoint().setDescription(x3dpsail.SFString("Black and white with Alpha PixelTexture")).setPosition(x3dpsail.SFVec3f(5,0,5))) .addChild(x3dpsail.Transform().setDEF(x3dpsail.SFString("AlphaBW")).setRotation(x3dpsail.SFRotation(1,1,0,1)).setTranslation(x3dpsail.SFVec3f(5,0,0))
))).setProtoBody( x3dpsail.ProtoBody().addChild(x3dpsail.Transform().setTranslation( x3dpsail.SFVec3f(0, 2, 0)).addChild(x3dpsail.Group().setIS( x3dpsail.IS().addConnect(x3dpsail.connect().setNodeField( x3dpsail.SFString("children")).setProtoField( x3dpsail.SFString("children")))))))).addChild( x3dpsail.ProtoInstance().setName( x3dpsail.SFString("ShiftGroupUp2m"))) #==================== .addChild(x3dpsail.Viewpoint().setDEF( x3dpsail.SFString("ExampleSingleElement")).setDescription( x3dpsail.SFString("Hello syntax") )).addChild(x3dpsail.Group().setDEF( x3dpsail.SFString("ExampleChildElement")).addChild( x3dpsail.Shape().setGeometry( x3dpsail.Box()).setAppearance( x3dpsail.Appearance().setMaterial( x3dpsail.Material().setDiffuseColor( x3dpsail.SFColor(0.6, 0.4, 0.2)))))). addChild(x3dpsail.Transform().setDEF( x3dpsail.SFString("TransformExampleUSE")).setRotation( x3dpsail.SFRotation(0, 1, 0, 0.78)).setTranslation( x3dpsail.SFVec3f(0, 2.5, 0)).addChild( x3dpsail.Group().setUSE( x3dpsail.SFString("ExampleChildElement")))). addChild(x3dpsail.Collision().setProxy( x3dpsail.Shape() #note that Collision proxy Shape is not rendered #alternative: Text string='\"He said, \\"Immel did it!\\"\"' .setGeometry(x3dpsail.Text().setString(
FontStyle51.setJustify(["MIDDLE", "BEGIN"]) Text50.setFontStyle(FontStyle51) Shape49.setGeometry(Text50) Appearance52 = x3dpsail.Appearance() Material53 = x3dpsail.Material() Material53.setDiffuseColor([0.8, 0.4, 0]) Appearance52.setMaterial(Material53) Shape49.setAppearance(Appearance52) Transform47.addChildren(Shape49) Shape54 = x3dpsail.Shape() Box55 = x3dpsail.Box() Box55.setSize([7, 1, 0.02]) Shape54.setGeometry(Box55) Appearance56 = x3dpsail.Appearance() Material57 = x3dpsail.Material() Material57.setTransparency(1) Appearance56.setMaterial(Material57) Shape54.setAppearance(Appearance56) Transform47.addChildren(Shape54) TouchSensor58 = x3dpsail.TouchSensor() TouchSensor58.setDEF("TextTouchSensor") TouchSensor58.setDescription("Click to begin animating viewpoint selections")
.addMeta(x3dpsail.meta().setName(x3dpsail.SFString("creator")).setContent(x3dpsail.SFString("John Carlson"))) .addMeta(x3dpsail.meta().setName(x3dpsail.SFString("generator")).setContent(x3dpsail.SFString("manual"))) .addMeta(x3dpsail.meta().setName(x3dpsail.SFString("identifier")).setContent(x3dpsail.SFString("https://coderextreme.net/X3DJSONLD/abox.x3d"))) .addMeta(x3dpsail.meta().setName(x3dpsail.SFString("description")).setContent(x3dpsail.SFString("a box")))) .setScene(x3dpsail.Scene() .addChild(x3dpsail.ProtoDeclare().setName(x3dpsail.SFString("anyShape")) .setProtoInterface(x3dpsail.ProtoInterface() .addField(x3dpsail.field().setName(x3dpsail.SFString("myShape")).setAccessType(x3dpsail.SFString("inputOutput")).setType(x3dpsail.SFString("MFNode")) .addChild(x3dpsail.Shape() .setGeometry(x3dpsail.Sphere())))) .setProtoBody(x3dpsail.ProtoBody() .addChild(x3dpsail.Transform() .setIS(x3dpsail.IS() .addConnect(x3dpsail.connect().setNodeField(x3dpsail.SFString("children")).setProtoField(x3dpsail.SFString("myShape"))))))) .addChild(x3dpsail.ProtoDeclare().setName(x3dpsail.SFString("one")) .setProtoInterface(x3dpsail.ProtoInterface() .addField(x3dpsail.field().setName(x3dpsail.SFString("myShape")).setAccessType(x3dpsail.SFString("inputOutput")).setType(x3dpsail.SFString("MFNode")) .addChild(x3dpsail.Shape() .setGeometry(x3dpsail.Cylinder())))) .setProtoBody(x3dpsail.ProtoBody() .addChild(x3dpsail.Transform() .addChild(x3dpsail.ProtoInstance().setName(x3dpsail.SFString("anyShape")) .setIS(x3dpsail.IS() .addConnect(x3dpsail.connect().setNodeField(x3dpsail.SFString("myShape")).setProtoField(x3dpsail.SFString("myShape")))))))) .addChild(x3dpsail.ProtoInstance().setName(x3dpsail.SFString("one")) .addFieldValue(x3dpsail.fieldValue().setName(x3dpsail.SFString("myShape")) .addChild(x3dpsail.Shape() .setGeometry(x3dpsail.Box().setSize(x3dpsail.SFVec3f(0.125,0.125,0.125)))))))) X3D0.toFileX3D("./future/./asmallbox_RoundTrip.x3d")
.addMeta(x3dpsail.meta().setName(x3dpsail.SFString("translated")).setContent(x3dpsail.SFString("21 January 2001"))) .addMeta(x3dpsail.meta().setName(x3dpsail.SFString("modified")).setContent(x3dpsail.SFString("16 January 2011"))) .addMeta(x3dpsail.meta().setName(x3dpsail.SFString("description")).setContent(x3dpsail.SFString("Test browser ability to map a RGB plus alpha opacity to geometry. A checkerboard of four colored squares: lower left (red), lower right (transparent), uppser left (transparent) and upper right (red) map onto the faces of all geometry. For the sphere, the texture should cover the entire surface, and wrap counterclockwise from the back of the sphere. For the cone, the texture should wrap counterclockwise (from above) starting at the back of the cone. A circle cutout of the texture is applied right side up to the base of the cone when the cone is tilted toward the -z axis. For the cylinder, the texture should wrap counterclockwise (from above) starting at the back of the cylinder. A circle cutout of the texture is applied right side up to the top and bottom caps of the cylinder. For the box, the texture should be applied right side up in its entirety to each face of the box."))) .addMeta(x3dpsail.meta().setName(x3dpsail.SFString("identifier")).setContent(x3dpsail.SFString("http://www.web3d.org/x3d/content/examples/ConformanceNist/Appearance/PixelTexture/rgb_alpha.x3d"))) .addMeta(x3dpsail.meta().setName(x3dpsail.SFString("generator")).setContent(x3dpsail.SFString("Vrml97ToX3dNist, http://ovrt.nist.gov/v2_x3d.html"))) .addMeta(x3dpsail.meta().setName(x3dpsail.SFString("generator")).setContent(x3dpsail.SFString("X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit"))) .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()))))) #The following advanced animation sequence uses nodes covered in Chapters 7, 8 and 9. #It does not need to be studied in this chapter. .addChild(x3dpsail.Transform().setTranslation(x3dpsail.SFVec3f(0,-3,8)) #notice this next Viewpoint has been transformed with the text, so its position is relative. it is called view5 in the Script. .addChild(x3dpsail.Viewpoint().setDEF(x3dpsail.SFString("ClickToAnimateView")).setDescription(x3dpsail.SFString("Select animation sequence")).setPosition(x3dpsail.SFVec3f(0,0,7))) .addChild(x3dpsail.Shape() .setGeometry(x3dpsail.Text().setString(x3dpsail.MFString(["Click here to animate"])) .setFontStyle(x3dpsail.FontStyle().setJustify(x3dpsail.MFString(["MIDDLE","BEGIN"])))) .setAppearance(x3dpsail.Appearance() .setMaterial(x3dpsail.Material().setDiffuseColor(x3dpsail.SFColor(0.8,0.4,0))))) .addChild(x3dpsail.Shape() .setGeometry(x3dpsail.Box().setSize(x3dpsail.SFVec3f(7,1,0.02))) .setAppearance(x3dpsail.Appearance() .setMaterial(x3dpsail.Material().setTransparency(x3dpsail.SFFloat(1))))) .addChild(x3dpsail.TouchSensor().setDEF(x3dpsail.SFString("TextTouchSensor")).setDescription(x3dpsail.SFString("Click to begin animating viewpoint selections"))) .addChild(x3dpsail.TimeSensor().setDEF(x3dpsail.SFString("Clock")).setCycleInterval(x3dpsail.SFTime(10))) .addChild(x3dpsail.ROUTE().setFromField(x3dpsail.SFString("touchTime")).setFromNode(x3dpsail.SFString("TextTouchSensor")).setToField(x3dpsail.SFString("set_startTime")).setToNode(x3dpsail.SFString("Clock"))) .addChild(x3dpsail.IntegerSequencer().setDEF(x3dpsail.SFString("TimingSequencer")).setKey(x3dpsail.MFFloat([0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,1])).setKeyValue(x3dpsail.MFInt32([0,1,2,3,4,5,6,7,8,10]))) .addChild(x3dpsail.ROUTE().setFromField(x3dpsail.SFString("fraction_changed")).setFromNode(x3dpsail.SFString("Clock")).setToField(x3dpsail.SFString("set_fraction")).setToNode(x3dpsail.SFString("TimingSequencer"))) .addChild(x3dpsail.Script().setDEF(x3dpsail.SFString("BindingSequencerEngine")) .addField(x3dpsail.field().setName(x3dpsail.SFString("set_timeEvent")).setAccessType(x3dpsail.SFString("inputOnly")).setType(x3dpsail.SFString("SFInt32"))) .addField(x3dpsail.field().setName(x3dpsail.SFString("bindView1")).setAccessType(x3dpsail.SFString("outputOnly")).setType(x3dpsail.SFString("SFBool"))) .addField(x3dpsail.field().setName(x3dpsail.SFString("bindView2")).setAccessType(x3dpsail.SFString("outputOnly")).setType(x3dpsail.SFString("SFBool"))) .addField(x3dpsail.field().setName(x3dpsail.SFString("bindView3")).setAccessType(x3dpsail.SFString("outputOnly")).setType(x3dpsail.SFString("SFBool"))) .addField(x3dpsail.field().setName(x3dpsail.SFString("bindView4")).setAccessType(x3dpsail.SFString("outputOnly")).setType(x3dpsail.SFString("SFBool"))) .addField(x3dpsail.field().setName(x3dpsail.SFString("bindView5")).setAccessType(x3dpsail.SFString("outputOnly")).setType(x3dpsail.SFString("SFBool"))) .addField(x3dpsail.field().setName(x3dpsail.SFString("view1Bound")).setAccessType(x3dpsail.SFString("inputOnly")).setType(x3dpsail.SFString("SFBool")))
x3dpsail.SFString("myShape")) ))).addChild(x3dpsail.ProtoInstance().setName( x3dpsail.SFString("nine")).addFieldValue( x3dpsail.fieldValue().setName( x3dpsail.SFString("ztranslation")).setValue( x3dpsail.SFString("0 0 2")) ).setIS(x3dpsail.IS().addConnect( x3dpsail.connect().setNodeField( x3dpsail.SFString("myShape")).setProtoField( x3dpsail.SFString("myShape"))))). addChild(x3dpsail.ProtoInstance().setName( x3dpsail.SFString("nine")).addFieldValue( x3dpsail.fieldValue().setName( x3dpsail.SFString("ztranslation")).setValue( x3dpsail.SFString("0 0 -2")) ).setIS(x3dpsail.IS().addConnect( x3dpsail.connect().setNodeField( x3dpsail.SFString("myShape")).setProtoField( x3dpsail.SFString("myShape")))))))). addChild(x3dpsail.ProtoInstance().setName( x3dpsail.SFString("twentyseven")).addFieldValue( x3dpsail.fieldValue().setName( x3dpsail.SFString("ttranslation")).setValue( x3dpsail.SFString("0 0 0"))).addFieldValue( x3dpsail.fieldValue().setName( x3dpsail.SFString("myShape")).addChild( x3dpsail.Box().setSize( x3dpsail.SFVec3f(1, 1, 1))))))) X3D0.toFileX3D("./future/./rubikOnFire_RoundTrip.x3d")
ProtoBody31.addChildren(Transform32) ProtoDeclare23.setProtoBody(ProtoBody31) Scene7.addChildren(ProtoDeclare23) ProtoInstance47 = x3dpsail.ProtoInstance() ProtoInstance47.setName("three") fieldValue48 = x3dpsail.fieldValue() fieldValue48.setName("ytranslation") fieldValue48.setValue("0 0 0") ProtoInstance47.addFieldValue(fieldValue48) fieldValue49 = x3dpsail.fieldValue() fieldValue49.setName("myShape") Shape50 = x3dpsail.Shape() Box51 = x3dpsail.Box() Box51.setSize([1, 1, 1]) Shape50.setGeometry(Box51) Appearance52 = x3dpsail.Appearance() Material53 = x3dpsail.Material() Material53.setDiffuseColor([0, 1, 0]) Appearance52.setMaterial(Material53) Shape50.setAppearance(Appearance52) fieldValue49.addChildren(Shape50) ProtoInstance47.addFieldValue(fieldValue49)
ProtoInstance83.setIS(IS85) Transform72.addChildren(ProtoInstance83) ProtoBody71.addChildren(Transform72) ProtoDeclare66.setProtoBody(ProtoBody71) Scene7.addChildren(ProtoDeclare66) ProtoInstance87 = x3dpsail.ProtoInstance() ProtoInstance87.setName("twentyseven") fieldValue88 = x3dpsail.fieldValue() fieldValue88.setName("ttranslation") fieldValue88.setValue("0 0 0") ProtoInstance87.addFieldValue(fieldValue88) fieldValue89 = x3dpsail.fieldValue() fieldValue89.setName("myShape") Box90 = x3dpsail.Box() Box90.setSize([1, 1, 1]) fieldValue89.addChildren(Box90) ProtoInstance87.addFieldValue(fieldValue89) Scene7.addChildren(ProtoInstance87) X3D0.setScene(Scene7) X3D0.toFileX3D("././rubikOnFire_RoundTrip.x3d")
Transform16 = x3dpsail.Transform() Transform16.setDEF("Checkerboard") Transform16.setTranslation([0, 0, -10]) Shape17 = x3dpsail.Shape() Appearance18 = x3dpsail.Appearance() TextureTransform19 = x3dpsail.TextureTransform() TextureTransform19.setScale([500, 500]) Appearance18.setTextureTransform(TextureTransform19) PixelTexture20 = x3dpsail.PixelTexture() PixelTexture20.setImage([2, 2, 3, 15119869, 16767927, 16767927, 15119869]) Appearance18.setTexture(PixelTexture20) Shape17.setAppearance(Appearance18) Box21 = x3dpsail.Box() Box21.setSize([1000, 1000, 0.01]) Shape17.setGeometry(Box21) Transform16.addChildren(Shape17) Scene14.addChildren(Transform16) Viewpoint22 = x3dpsail.Viewpoint() Viewpoint22.setDescription("View All") Viewpoint22.setPosition([0, 0, 20]) Scene14.addChildren(Viewpoint22) Viewpoint23 = x3dpsail.Viewpoint() Viewpoint23.setDescription("Empty Image") Viewpoint23.setPosition([0, 5, 5])
x3dpsail.Shape().setGeometry(x3dpsail.Sphere()))) ).setProtoBody(x3dpsail.ProtoBody().addChild( x3dpsail.Transform().setIS( x3dpsail.IS().addConnect(x3dpsail.connect().setNodeField( x3dpsail.SFString("children")).setProtoField( x3dpsail.SFString("myShape")))) ))).addChild(x3dpsail.ProtoDeclare().setName( x3dpsail.SFString("one")).setProtoInterface( x3dpsail.ProtoInterface().addField(x3dpsail.field().setName( x3dpsail.SFString("myShape")).setAccessType( x3dpsail.SFString("inputOutput")).setType( x3dpsail.SFString("MFNode")).addChild( x3dpsail.Shape().setGeometry( x3dpsail.Cylinder()))) ).setProtoBody(x3dpsail.ProtoBody().addChild( x3dpsail.Transform().addChild(x3dpsail.ProtoInstance().setName( x3dpsail.SFString("anyShape")).setIS( x3dpsail.IS().addConnect( x3dpsail.connect().setNodeField( x3dpsail.SFString("myShape")).setProtoField( x3dpsail.SFString("myShape")))))))). addChild(x3dpsail.ProtoInstance().setName( x3dpsail.SFString("one")).addFieldValue( x3dpsail.fieldValue().setName( x3dpsail.SFString("myShape")).addChild( x3dpsail.Shape().setGeometry( x3dpsail.Box().setSize( x3dpsail.SFVec3f(140, 140, 140)))))))) X3D0.toFileX3D("./future/./abox_RoundTrip.x3d")
Viewpoint17 = x3dpsail.Viewpoint() Viewpoint17.setDescription("Table 5.18 SFImage component examples") Viewpoint17.setPosition([0, 0, 14]) Scene15.addChildren(Viewpoint17) Transform18 = x3dpsail.Transform() Transform18.setTranslation([-6, 0, 0]) Shape19 = x3dpsail.Shape() Appearance20 = x3dpsail.Appearance() PixelTexture21 = x3dpsail.PixelTexture() PixelTexture21.setDEF("ZeroComponents") Appearance20.setTexture(PixelTexture21) Shape19.setAppearance(Appearance20) Box22 = x3dpsail.Box() Shape19.setGeometry(Box22) Transform18.addChildren(Shape19) Transform23 = x3dpsail.Transform() Transform23.setTranslation([0, -2, 0]) Shape24 = x3dpsail.Shape() Text25 = x3dpsail.Text() Text25.setString(["0"]) FontStyle26 = x3dpsail.FontStyle() FontStyle26.setDEF("CenterJustify") FontStyle26.setJustify(["MIDDLE", "MIDDLE"]) Text25.setFontStyle(FontStyle26)
Scene17.addChildren(Transform188) Transform190 = x3dpsail.Transform() Transform190.setDEF("FuelTankTransformLeft") Transform190.setRotation([-1, 0, 0, 1.57]) Transform190.setScale([1.5, 1.5, 1.5]) Transform190.setTranslation([-5, -2.85, 5.5]) Inline191 = x3dpsail.Inline() Inline191.setUSE("FuelTank") Transform190.addChildren(Inline191) Scene17.addChildren(Transform190) Transform192 = x3dpsail.Transform() Transform192.setDEF("InlineCoverOfPlaneTansform") Shape193 = x3dpsail.Shape() Box194 = x3dpsail.Box() Box194.setSize([4.15, 0.1, 20]) Shape193.setGeometry(Box194) Appearance195 = x3dpsail.Appearance() Material196 = x3dpsail.Material() Material196.setDiffuseColor([0.25, 0.25, 0.25]) Appearance195.setMaterial(Material196) Shape193.setAppearance(Appearance195) Transform192.addChildren(Shape193) Scene17.addChildren(Transform192) Transform197 = x3dpsail.Transform()
Group22 = x3dpsail.Group() Transform23 = x3dpsail.Transform() Transform23.setTranslation([6.14221,0.0694613,-0.000999451]) Shape24 = x3dpsail.Shape() Appearance25 = x3dpsail.Appearance() Material26 = x3dpsail.Material() Appearance25.setMaterial(Material26) PixelTexture27 = x3dpsail.PixelTexture() PixelTexture27.setDEF("RgbOpacityCheckerboard") PixelTexture27.setImage([2,2,4,-16776961,-65536,-65536,-16776961]) Appearance25.setTexture(PixelTexture27) Shape24.setAppearance(Appearance25) Box28 = x3dpsail.Box() Shape24.setGeometry(Box28) Transform23.addChildren(Shape24) 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")
IS25.addConnect(connect26) ProtoInstance24.setIS(IS25) Transform23.addChildren(ProtoInstance24) ProtoBody22.addChildren(Transform23) ProtoDeclare17.setProtoBody(ProtoBody22) Scene7.addChildren(ProtoDeclare17) ProtoInstance27 = x3dpsail.ProtoInstance() ProtoInstance27.setName("one") fieldValue28 = x3dpsail.fieldValue() fieldValue28.setName("myShape") Shape29 = x3dpsail.Shape() Box30 = x3dpsail.Box() Box30.setSize([140,140,140]) Shape29.setGeometry(Box30) fieldValue28.addChildren(Shape29) ProtoInstance27.addFieldValue(fieldValue28) Scene7.addChildren(ProtoInstance27) X3D0.setScene(Scene7) X3D0.toFileX3D("././abox_RoundTrip.x3d")
Scene17.addChildren(ProtoDeclare36) ProtoInstance45 = x3dpsail.ProtoInstance() ProtoInstance45.setName("ShiftGroupUp2m") Scene17.addChildren(ProtoInstance45) #==================== Viewpoint46 = x3dpsail.Viewpoint() Viewpoint46.setDEF("ExampleSingleElement") Viewpoint46.setDescription("Hello syntax") Scene17.addChildren(Viewpoint46) Group47 = x3dpsail.Group() Group47.setDEF("ExampleChildElement") Shape48 = x3dpsail.Shape() Box49 = x3dpsail.Box() Shape48.setGeometry(Box49) Appearance50 = x3dpsail.Appearance() Material51 = x3dpsail.Material() Material51.setDiffuseColor([0.6, 0.4, 0.2]) Appearance50.setMaterial(Material51) Shape48.setAppearance(Appearance50) Group47.addChildren(Shape48) Scene17.addChildren(Group47) Transform52 = x3dpsail.Transform() Transform52.setDEF("TransformExampleUSE")