예제 #1
0
Transform19 = x3dpsail.Transform()
Transform19.setTranslation([0, 1.08, 0])
Billboard20 = x3dpsail.Billboard()
Shape21 = x3dpsail.Shape()
Appearance22 = x3dpsail.Appearance()
Appearance22.setDEF("LABEL_APPEARANCE")
Material23 = x3dpsail.Material()
Material23.setDiffuseColor([1, 1, 0.3])
Material23.setEmissiveColor([0.33, 0.33, 0.1])

Appearance22.setMaterial(Material23)

Shape21.setAppearance(Appearance22)
Text24 = x3dpsail.Text()
Text24.setString(["Y"])
FontStyle25 = x3dpsail.FontStyle()
FontStyle25.setDEF("LABEL_FONT")
FontStyle25.setFamily(["SANS"])
FontStyle25.setJustify(["MIDDLE", "MIDDLE"])
FontStyle25.setSize(0.2)

Text24.setFontStyle(FontStyle25)

Shape21.setGeometry(Text24)

Billboard20.addChildren(Shape21)

Transform19.addChildren(Billboard20)

Group9.addChildren(Transform19)
예제 #2
0
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()
Text22.setString(["Node"])
FontStyle23 = x3dpsail.FontStyle()
FontStyle23.setJustify(["MIDDLE", "MIDDLE"])
FontStyle23.setSize(5)

Text22.setFontStyle(FontStyle23)

Shape21.setGeometry(Text22)
Appearance24 = x3dpsail.Appearance()
Material25 = x3dpsail.Material()
Material25.setDiffuseColor([0, 0, 1])

Appearance24.setMaterial(Material25)

Shape21.setAppearance(Appearance24)

Transform20.addChildren(Shape21)
예제 #3
0
        .addMeta(x3dpsail.meta().setName(x3dpsail.SFString("subject")).setContent(x3dpsail.SFString("X3D book, X3D graphics, X3D-Edit, http://www.x3dGraphics.com")))
        .addMeta(x3dpsail.meta().setName(x3dpsail.SFString("identifier")).setContent(x3dpsail.SFString("http://X3dGraphics.com/examples/X3dForWebAuthors/Chapter04ViewingNavigation/BindingOperations.x3d")))
        .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.Viewpoint().setDEF(x3dpsail.SFString("View1")).setCenterOfRotation(x3dpsail.SFVec3f(-6,0,0)).setDescription(x3dpsail.SFString("Viewpoint 1")).setPosition(x3dpsail.SFVec3f(-6,0,5)))
        .addChild(x3dpsail.Viewpoint().setDEF(x3dpsail.SFString("View2")).setCenterOfRotation(x3dpsail.SFVec3f(-2,0,0)).setDescription(x3dpsail.SFString("Viewpoint 2")).setPosition(x3dpsail.SFVec3f(-2,0,5)))
        .addChild(x3dpsail.Viewpoint().setDEF(x3dpsail.SFString("View3")).setCenterOfRotation(x3dpsail.SFVec3f(2,0,0)).setDescription(x3dpsail.SFString("Viewpoint 3")).setPosition(x3dpsail.SFVec3f(2,0,5)))
        .addChild(x3dpsail.Viewpoint().setDEF(x3dpsail.SFString("View4")).setCenterOfRotation(x3dpsail.SFVec3f(6,0,0)).setDescription(x3dpsail.SFString("Viewpoint 4")).setPosition(x3dpsail.SFVec3f(6,0,5)))
        #Script initialization ought to first bind view5 below.

        .addChild(x3dpsail.Group()
          .addChild(x3dpsail.Transform().setDEF(x3dpsail.SFString("Text1")).setTranslation(x3dpsail.SFVec3f(-6,0,0))
            .addChild(x3dpsail.Shape()
              .setGeometry(x3dpsail.Text().setString(x3dpsail.MFString(["View","# 1"]))
                .setFontStyle(x3dpsail.FontStyle().setDEF(x3dpsail.SFString("CenterJustify")).setJustify(x3dpsail.MFString(["MIDDLE","MIDDLE"]))))
              .setAppearance(x3dpsail.Appearance()
                .setMaterial(x3dpsail.Material().setDiffuseColor(x3dpsail.SFColor(1,0,0))))))
          .addChild(x3dpsail.Transform().setDEF(x3dpsail.SFString("Text2")).setTranslation(x3dpsail.SFVec3f(-2,0,0))
            .addChild(x3dpsail.Shape()
              .setGeometry(x3dpsail.Text().setString(x3dpsail.MFString(["View","# 2"]))
                .setFontStyle(x3dpsail.FontStyle().setUSE(x3dpsail.SFString("CenterJustify"))))
              .setAppearance(x3dpsail.Appearance()
                .setMaterial(x3dpsail.Material().setDiffuseColor(x3dpsail.SFColor(0,1,0))))))
          .addChild(x3dpsail.Transform().setDEF(x3dpsail.SFString("Text3")).setTranslation(x3dpsail.SFVec3f(2,0,0))
            .addChild(x3dpsail.Shape()
              .setGeometry(x3dpsail.Text().setString(x3dpsail.MFString(["View","# 3"]))
                .setFontStyle(x3dpsail.FontStyle().setUSE(x3dpsail.SFString("CenterJustify"))))
              .setAppearance(x3dpsail.Appearance()
                .setMaterial(x3dpsail.Material().setDiffuseColor(x3dpsail.SFColor(0,0,1))))))
          .addChild(x3dpsail.Transform().setDEF(x3dpsail.SFString("Text4")).setTranslation(x3dpsail.SFVec3f(6,0,0))
예제 #4
0
Shape17.setGeometry(Sphere18)
Appearance19 = x3dpsail.Appearance()
Material20 = x3dpsail.Material()
Material20.setDiffuseColor([1,0,0])

Appearance19.setMaterial(Material20)

Shape17.setAppearance(Appearance19)

Transform14.addChildren(Shape17)
Transform21 = x3dpsail.Transform()
Transform21.setTranslation([1,0,0])
Shape22 = x3dpsail.Shape()
Text23 = x3dpsail.Text()
Text23.setString(["Node"])
FontStyle24 = x3dpsail.FontStyle()
FontStyle24.setJustify(["MIDDLE","MIDDLE"])
FontStyle24.setSize(5)

Text23.setFontStyle(FontStyle24)

Shape22.setGeometry(Text23)
Appearance25 = x3dpsail.Appearance()
Material26 = x3dpsail.Material()
Material26.setDiffuseColor([0,0,1])

Appearance25.setMaterial(Material26)

Shape22.setAppearance(Appearance25)

Transform21.addChildren(Shape22)
ProtoInstance63.setName("EmissiveMaterial")
fieldValue64 = x3dpsail.fieldValue()
fieldValue64.setName("onlyColor")
fieldValue64.setValue("0.2 0.6 0.6")

ProtoInstance63.addFieldValue(fieldValue64)

Appearance62.setMaterial(ProtoInstance63)

Shape61.setAppearance(Appearance62)
Text65 = x3dpsail.Text()
Text65.setString([
    "X3D Header Prototype syntax examples",
    "(view console for EXTERNPROTO output)"
])
FontStyle66 = x3dpsail.FontStyle()
FontStyle66.setJustify(["MIDDLE", "MIDDLE"])
FontStyle66.setSize(0.6)

Text65.setFontStyle(FontStyle66)

Shape61.setGeometry(Text65)

Transform60.addChildren(Shape61)

Scene17.addChildren(Transform60)
ProtoInstance67 = x3dpsail.ProtoInstance()
ProtoInstance67.setName("ViewPositionOrientation")
fieldValue68 = x3dpsail.fieldValue()
fieldValue68.setName("enabled")
fieldValue68.setValue("true")
예제 #6
0
        )).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"
            ])))))).addChild(x3dpsail.Transform().setTranslation(
                x3dpsail.SFVec3f(0, -2, 0)).addChild(
                    x3dpsail.Shape().setGeometry(x3dpsail.Text().setDEF(
                        x3dpsail.SFString("TextMessage")).setString(
                            x3dpsail.MFString([
                                "Hello", "world!"
                            ])).setFontStyle(x3dpsail.FontStyle().setJustify(
                                x3dpsail.MFString(["MIDDLE", "MIDDLE"])))).
                    setAppearance(x3dpsail.Appearance().setMaterial(
                        x3dpsail.Material().setUSE(
                            x3dpsail.SFString("MaterialLightBlue")))))))))

X3D0.toFileX3D("HelloWorld_RoundTrip.x3d")
예제 #7
0
Scene17 = x3dpsail.Scene()
Viewpoint18 = x3dpsail.Viewpoint()
Viewpoint18.setDEF("EntryView")
Viewpoint18.setDescription("Hello MFString syntax")

Scene17.addChildren(Viewpoint18)
Background19 = x3dpsail.Background()
Background19.setSkyColor([0.6, 1, 0.8])

Scene17.addChildren(Background19)
Shape20 = x3dpsail.Shape()
Text21 = x3dpsail.Text()
Text21.setString(["One, Two, Three", "", "He said, \"Immel did it!\""])
#alternative XML encoding: Text string='\"One, Two, Three\" \"\" \"He said, \\"Immel did it!\\"\"'
#alternative Java source: .setString(new String [] {\"One, Two, Three\", \"\", \"He said, \\\"\"Immel did it!\\\"\"\"})
FontStyle22 = x3dpsail.FontStyle()
FontStyle22.setJustify(["MIDDLE", "MIDDLE"])
FontStyle22.setStyle("BOLD")

Text21.setFontStyle(FontStyle22)

Shape20.setGeometry(Text21)
Appearance23 = x3dpsail.Appearance()
Material24 = x3dpsail.Material()
Material24.setDiffuseColor([0.6, 0.4, 0.2])

Appearance23.setMaterial(Material24)

Shape20.setAppearance(Appearance23)

Scene17.addChildren(Shape20)
예제 #8
0
Scene28.addChildren(Background30)
Transform31 = x3dpsail.Transform()
Transform31.setScale([0.4, 0.4, 0.4])
Transform31.setTranslation([0, 1, 0])
TouchSensor32 = x3dpsail.TouchSensor()
TouchSensor32.setDEF("RandomTextClickedSensor")
TouchSensor32.setDescription("Select to see a new strategy")

Transform31.addChildren(TouchSensor32)
Shape33 = x3dpsail.Shape()
Text34 = x3dpsail.Text()
Text34.setString([
    "Oblique Strategies", "", "(Over One Hundred Worthwhile Dilemmas)", "",
    "by Brian Eno and Peter Schmidt"
])
FontStyle35 = x3dpsail.FontStyle()
FontStyle35.setDEF("MessageFont")
FontStyle35.setFamily(["SANS"])
FontStyle35.setJustify(["MIDDLE", "MIDDLE"])
FontStyle35.setStyle("BOLD")

Text34.setFontStyle(FontStyle35)

Shape33.setGeometry(Text34)
Appearance36 = x3dpsail.Appearance()
Material37 = x3dpsail.Material()
Material37.setDiffuseColor([1, 1, 1])

Appearance36.setMaterial(Material37)

Shape33.setAppearance(Appearance36)
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)

Shape24.setGeometry(Text25)
Appearance27 = x3dpsail.Appearance()
Appearance27.setDEF("TextMaterial")
Material28 = x3dpsail.Material()
Material28.setDiffuseColor([1, 1, 1])

Appearance27.setMaterial(Material28)

Shape24.setAppearance(Appearance27)
        .SFString(
            "http://www.web3d.org/x3d/content/examples/Basic/X3dSpecifications/StringArrayEncodingExamples.x3d"
        ))).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.Viewpoint(
    ).setDEF(x3dpsail.SFString("EntryView")).setDescription(
        x3dpsail.SFString("Hello MFString syntax"))).addChild(
            x3dpsail.Background().setSkyColor(x3dpsail.MFColor([
                0.6,
                1, 0.8
            ]))).addChild(x3dpsail.Shape().setGeometry(
                x3dpsail.Text().setString(
                    x3dpsail.MFString(
                        ["One, Two, Three", "", "He said, \"Immel did it!\""]))
                #alternative XML encoding: Text string='\"One, Two, Three\" \"\" \"He said, \\"Immel did it!\\"\"'

                #alternative Java source: .setString(new String [] {\"One, Two, Three\", \"\", \"He said, \\\"\"Immel did it!\\\"\"\"})
                .setFontStyle(x3dpsail.FontStyle().setJustify(
                    x3dpsail.MFString(["MIDDLE", "MIDDLE"])).setStyle(
                        x3dpsail.SFString("BOLD")))).setAppearance(
                            x3dpsail.Appearance().setMaterial(
                                x3dpsail.Material().setDiffuseColor(
                                    x3dpsail.SFColor(0.6, 0.4, 0.2)))))))

X3D0.toFileX3D("./future/./StringArrayEncodingExamples_RoundTrip.x3d")
        .addChild(
            x3dpsail.ProtoInstance().setName(
                x3dpsail.SFString("HeadsUpDisplay")).setDEF(
                    x3dpsail.SFString("HeadsUpDisplayInstance"))
            #example: upper left-hand corner of screen (x=-2, y=1) and set back z=-5 from user view
            .addFieldValue(x3dpsail.fieldValue().setName(
                x3dpsail.SFString("screenOffset")).setValue(
                    x3dpsail.SFString("-0.75 1 -5"))).
            addFieldValue(x3dpsail.fieldValue().setName(
                x3dpsail.SFString("children")).addChild(
                    x3dpsail.Shape().setGeometry(x3dpsail.Text().setString(
                        x3dpsail.MFString([
                            "HUD text stays fixed",
                            "while user navigates"
                        ])).setFontStyle(x3dpsail.FontStyle().setJustify(
                            x3dpsail.MFString(["MIDDLE", "MIDDLE"])).setSize(
                                x3dpsail.SFFloat(0.3)))).setAppearance(
                                    x3dpsail.Appearance().setMaterial(
                                        x3dpsail.Material().setDiffuseColor(
                                            x3dpsail.SFColor(
                                                0.894118, 0.819608, 1))))))).
        addChild(x3dpsail.Inline().setUrl(
            x3dpsail.MFString([
                "../HelloWorld.x3d",
                "http://X3dGraphics.com/examples/X3dForWebAuthors/HelloWorld.x3d",
                "../HelloWorld.wrl",
                "http://X3dGraphics.com/examples/X3dForWebAuthors/HelloWorld.wrl"
            ])))))

X3D0.toFileX3D("./future/./HeadsUpDisplayExample_RoundTrip.x3d")
예제 #12
0
#apostrophe ' is ' and needs to be escaped in single-quote delimiters used for string='value' attribute
#ampersand & is & and needs to be escaped
#quotation \" is " and isn't needed if single-quote delimiters used for string='value' attribute
#quotation \" can be used within an X3D string if escaped with backslash \\ as \\\"\"
#backslash \\ is used as escape character for \" (and itself) in X3D
#character entities are listed in HTML specification and are good for any XML
Text17 = x3dpsail.Text()
Text17.setDEF("DefaultText")
Text17.setString([
    "Character entity substitutions:", "empty string \"\" skips a line:", "",
    "apostrophe ' is '", "ampersand & is &",
    "quote mark \" is "", "backslash \\\\ is X3D escape character",
    "double backslash \\\\\\\\ is X3D backslash \\\\ character",
    "Pi Π is Π XML character entity"
])
FontStyle18 = x3dpsail.FontStyle()
FontStyle18.setDEF("CenteredFontStyle")
FontStyle18.setJustify(["MIDDLE", "MIDDLE"])

Text17.setFontStyle(FontStyle18)

Shape16.setGeometry(Text17)
Appearance19 = x3dpsail.Appearance()
Material20 = x3dpsail.Material()
Material20.setDEF("DefaultMaterial")
Material20.setDiffuseColor([0.2, 0.2, 0.2])

Appearance19.setMaterial(Material20)

Shape16.setAppearance(Appearance19)
예제 #13
0
meta6.setContent("test \\n text")

head1.addMeta(meta6)
meta7 = x3dpsail.meta()
meta7.setName("generator")
meta7.setContent("Vim, X3D-Edit, https://savage.nps.edu/X3D-Edit")

head1.addMeta(meta7)

X3D0.setHead(head1)
Scene8 = x3dpsail.Scene()
Transform9 = x3dpsail.Transform()
Shape10 = x3dpsail.Shape()
Text11 = x3dpsail.Text()
Text11.setString(["Node\"\"\""])
FontStyle12 = x3dpsail.FontStyle()

Text11.setFontStyle(FontStyle12)

Shape10.setGeometry(Text11)
Appearance13 = x3dpsail.Appearance()
Material14 = x3dpsail.Material()

Appearance13.setMaterial(Material14)

Shape10.setAppearance(Appearance13)

Transform9.addChildren(Shape10)
Shape15 = x3dpsail.Shape()
Text16 = x3dpsail.Text()
Text16.setString(["Node2", "\\\\", "\\\\\\\\", "Node2"])
예제 #14
0
Viewpoint21 = x3dpsail.Viewpoint()
Viewpoint21.setDEF("View4")
Viewpoint21.setCenterOfRotation([6, 0, 0])
Viewpoint21.setDescription("Viewpoint 4")
Viewpoint21.setPosition([6, 0, 5])

Scene17.addChildren(Viewpoint21)
#Script initialization ought to first bind view5 below.
Group22 = x3dpsail.Group()
Transform23 = x3dpsail.Transform()
Transform23.setDEF("Text1")
Transform23.setTranslation([-6, 0, 0])
Shape24 = x3dpsail.Shape()
Text25 = x3dpsail.Text()
Text25.setString(["View", "# 1"])
FontStyle26 = x3dpsail.FontStyle()
FontStyle26.setDEF("CenterJustify")
FontStyle26.setJustify(["MIDDLE", "MIDDLE"])

Text25.setFontStyle(FontStyle26)

Shape24.setGeometry(Text25)
Appearance27 = x3dpsail.Appearance()
Material28 = x3dpsail.Material()
Material28.setDiffuseColor([1, 0, 0])

Appearance27.setMaterial(Material28)

Shape24.setAppearance(Appearance27)

Transform23.addChildren(Shape24)
예제 #15
0
                                     x3dpsail.SFString("text.x3d"))).
     addMeta(x3dpsail.meta().setName(
         x3dpsail.SFString("identifier")).setContent(
             x3dpsail.SFString(
                 "https://coderextreme.net/X3DJSONLD/text.x3d"))).addMeta(
                     x3dpsail.meta().setName(
                         x3dpsail.SFString("description")).setContent(
                             x3dpsail.SFString("test \\n text"))).
     addMeta(x3dpsail.meta().setName(
         x3dpsail.SFString("generator")).setContent(
             x3dpsail.SFString(
                 "Vim, X3D-Edit, https://savage.nps.edu/X3D-Edit")))
 ).setScene(x3dpsail.Scene().addChild(x3dpsail.Transform().addChild(
     x3dpsail.Shape().setGeometry(x3dpsail.Text().setString(
         x3dpsail.MFString(["Node\"\"\""])).setFontStyle(
             x3dpsail.FontStyle())).setAppearance(
                 x3dpsail.Appearance().setMaterial(x3dpsail.Material()))
 ).addChild(x3dpsail.Shape().setGeometry(x3dpsail.Text().setString(
     x3dpsail.MFString([
         "Node2", "\\\\",
         "\\\\\\\\", "Node2"
     ])).setFontStyle(x3dpsail.FontStyle())).setAppearance(
         x3dpsail.Appearance().setMaterial(x3dpsail.Material()))).addChild(
             x3dpsail.Shape().setGeometry(x3dpsail.Text().setString(
                 x3dpsail.MFString([
                     "Node3 \\\\\\\\ \\\\ ", "Node3\"\"\""
                 ])).setFontStyle(x3dpsail.FontStyle())).setAppearance(
                     x3dpsail.Appearance().setMaterial(x3dpsail.Material()))
         ).addChild(x3dpsail.Script().addField(x3dpsail.field().setName(
             x3dpsail.SFString("frontUrls")).setType(
                 x3dpsail.SFString("MFString")).setAccessType(
예제 #16
0
     x3dpsail.SFString("transform")).setIS(x3dpsail.IS().addConnect(
         x3dpsail.connect().setNodeField(
             x3dpsail.SFString("translation")).setProtoField(
                 x3dpsail.SFString("position"))
     )).addChild(
         x3dpsail.Shape().setGeometry(
             x3dpsail.Sphere()).setAppearance(
                 x3dpsail.Appearance().setMaterial(
                     x3dpsail.Material().setDiffuseColor(
                         x3dpsail.SFColor(1, 0, 0))))
     ).addChild(x3dpsail.Transform().setTranslation(
         x3dpsail.SFVec3f(1, 0, 0)).addChild(
             x3dpsail.Shape().setGeometry(x3dpsail.Text().setString(
                 x3dpsail.MFString(["Node"])).setFontStyle(
                     x3dpsail.FontStyle().setJustify(
                         x3dpsail.MFString(["MIDDLE",
                                            "MIDDLE"])).setSize(
                                                x3dpsail.SFFloat(5))
                 )).setAppearance(x3dpsail.Appearance().setMaterial(
                     x3dpsail.Material().setDiffuseColor(
                         x3dpsail.SFColor(0, 0, 1))))))).
 addChild(x3dpsail.PositionInterpolator().setDEF(
     x3dpsail.SFString("NodePosition")).setKey(
         x3dpsail.MFFloat([0, 1])).setKeyValue(
             x3dpsail.MFVec3f([0, 0, 0, 0, 5, 0
                               ]))).
 addChild(x3dpsail.Script().setDEF(
     x3dpsail.SFString("MoveBall")).addField(
         x3dpsail.field().setName(
             x3dpsail.SFString("translation")).setAccessType(
                 x3dpsail.SFString("inputOutput")).setType(
                     x3dpsail.SFString("SFVec3f")).setValue(
예제 #17
0
#ProtoDeclare is the \"cookie cutter\" template, ProtoInstance creates an actual occurrence
ProtoInstance23 = x3dpsail.ProtoInstance()
ProtoInstance23.setName("HeadsUpDisplay")
ProtoInstance23.setDEF("HeadsUpDisplayInstance")
#example: upper left-hand corner of screen (x=-2, y=1) and set back z=-5 from user view
fieldValue24 = x3dpsail.fieldValue()
fieldValue24.setName("screenOffset")
fieldValue24.setValue("-0.75 1 -5")

ProtoInstance23.addFieldValue(fieldValue24)
fieldValue25 = x3dpsail.fieldValue()
fieldValue25.setName("children")
Shape26 = x3dpsail.Shape()
Text27 = x3dpsail.Text()
Text27.setString(["HUD text stays fixed", "while user navigates"])
FontStyle28 = x3dpsail.FontStyle()
FontStyle28.setJustify(["MIDDLE", "MIDDLE"])
FontStyle28.setSize(0.3)

Text27.setFontStyle(FontStyle28)

Shape26.setGeometry(Text27)
Appearance29 = x3dpsail.Appearance()
Material30 = x3dpsail.Material()
Material30.setDiffuseColor([0.894118, 0.819608, 1])

Appearance29.setMaterial(Material30)

Shape26.setAppearance(Appearance29)

fieldValue25.addChildren(Shape26)
예제 #18
0
])

Appearance32.setTexture(ImageTexture34)

Shape30.setAppearance(Appearance32)

Transform29.addChildren(Shape30)

Group27.addChildren(Transform29)
Transform35 = x3dpsail.Transform()
Transform35.setTranslation([0, -2, 0])
Shape36 = x3dpsail.Shape()
Text37 = x3dpsail.Text()
Text37.setDEF("TextMessage")
Text37.setString(["Hello", "world!"])
FontStyle38 = x3dpsail.FontStyle()
FontStyle38.setJustify(["MIDDLE", "MIDDLE"])

Text37.setFontStyle(FontStyle38)

Shape36.setGeometry(Text37)
Appearance39 = x3dpsail.Appearance()
Material40 = x3dpsail.Material()
Material40.setUSE("MaterialLightBlue")

Appearance39.setMaterial(Material40)

Shape36.setAppearance(Appearance39)

Transform35.addChildren(Shape36)
예제 #19
0
head1.addMeta(meta10)
meta11 = x3dpsail.meta()
meta11.setName("license")
meta11.setContent("../license.html")

head1.addMeta(meta11)

X3D0.setHead(head1)
Scene12 = x3dpsail.Scene()
Transform13 = x3dpsail.Transform()
Transform13.setTranslation([0, 2, 0])
Shape14 = x3dpsail.Shape()
Text15 = x3dpsail.Text()
Text15.setString(["Compare special character escaping"])
FontStyle16 = x3dpsail.FontStyle()
FontStyle16.setDEF("testFontStyle")
FontStyle16.setJustify(["MIDDLE", "MIDDLE"])
FontStyle16.setSize(0.8)

Text15.setFontStyle(FontStyle16)

Shape14.setGeometry(Text15)
Appearance17 = x3dpsail.Appearance()
Appearance17.setDEF("LightBlueAppearance")
Material18 = x3dpsail.Material()
Material18.setDiffuseColor([0.1, 0.7, 0.7])

Appearance17.setMaterial(Material18)

Shape14.setAppearance(Appearance17)