home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form Form1
- Caption = "11_2ReadString"
- ClientHeight = 4935
- ClientLeft = 1140
- ClientTop = 1425
- ClientWidth = 5010
- Height = 5310
- Left = 1080
- LinkTopic = "Form1"
- ScaleHeight = 4935
- ScaleWidth = 5010
- Top = 1110
- Width = 5130
- Begin VB.Label Label1
- Caption = "Example of creating a scene graph by reading from a string."
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 700
- size = 12
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 735
- Left = 120
- TabIndex = 1
- Top = 120
- Width = 4695
- End
- Begin TgsVisual3SpaceLibCtl.V3Space V3Space1
- Height = 3975
- Left = 120
- TabIndex = 0
- Top = 960
- Width = 4815
- _Version = 131072
- _ExtentX = 8493
- _ExtentY = 7011
- _StockProps = 0
- decorationOn = 0 'False
- End
- Attribute VB_Name = "Form1"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- Private Sub Form_Initialize()
- 'static char *dodecahedron =
- Dim dodecahedron As String
- dodecahedron = "Separator {"
- dodecahedron = dodecahedron + " Normal {"
- dodecahedron = dodecahedron + " vector ["
- dodecahedron = dodecahedron + " 0.553341 0 0.832955, 0.832955 0.553341 0,"
- dodecahedron = dodecahedron + " 0.832955 -0.553341 0, 0 -0.832955 0.553341,"
- dodecahedron = dodecahedron + " -0.553341 0 0.832955, 0 0.832955 0.553341,"
- dodecahedron = dodecahedron + " 0 0.832955 -0.553341, -0.832955 0.553341 0,"
- dodecahedron = dodecahedron + " -0.832955 -0.553341 0, 0 -0.832955 -0.553341,"
- dodecahedron = dodecahedron + " 0.553341 0 -0.832955, -0.553341 0 -0.832955,"
- dodecahedron = dodecahedron + " ]"
- dodecahedron = dodecahedron + " }"
- dodecahedron = dodecahedron + " NormalBinding { value PER_FACE }"
- dodecahedron = dodecahedron + " Material {"
- dodecahedron = dodecahedron + " diffuseColor ["
- dodecahedron = dodecahedron + " 1 0 0, 0 1 0, 0 0 1, 0 1 1,"
- dodecahedron = dodecahedron + " 1 0 1, .5 1 0, .5 0 1, .5 1 1,"
- dodecahedron = dodecahedron + " 1 .3 .7, .3 1 .7, .3 .7 1, .5 .5 .8"
- dodecahedron = dodecahedron + " ]"
- dodecahedron = dodecahedron + " }"
- dodecahedron = dodecahedron + " MaterialBinding { value PER_FACE }"
- dodecahedron = dodecahedron + " Coordinate3 {"
- dodecahedron = dodecahedron + " point ["
- dodecahedron = dodecahedron + " 1.7265 0 0.618, 1 1 1,"
- dodecahedron = dodecahedron + " 0 0.618 1.7265, 0 -0.618 1.7265,"
- dodecahedron = dodecahedron + " 1 -1 1, -1 -1 1,"
- dodecahedron = dodecahedron + " -0.618 -1.7265 0, 0.618 -1.7265 0,"
- dodecahedron = dodecahedron + " 1 -1 -1, 1.7265 0 -0.618,"
- dodecahedron = dodecahedron + " 1 1 -1, 0.618 1.7265 0,"
- dodecahedron = dodecahedron + " -0.618 1.7265 0, -1 1 1,"
- dodecahedron = dodecahedron + " -1.7265 0 0.618, -1.7265 0 -0.618,"
- dodecahedron = dodecahedron + " -1 -1 -1, 0 -0.618 -1.7265,"
- dodecahedron = dodecahedron + " 0 0.618 -1.7265, -1 1 -1"
- dodecahedron = dodecahedron + " ]"
- dodecahedron = dodecahedron + " }"
- dodecahedron = dodecahedron + " IndexedFaceSet {"
- dodecahedron = dodecahedron + " coordIndex ["
- dodecahedron = dodecahedron + " 1, 2, 3, 4, 0, -1, 0, 9, 10, 11, 1, -1,"
- dodecahedron = dodecahedron + " 4, 7, 8, 9, 0, -1, 3, 5, 6, 7, 4, -1,"
- dodecahedron = dodecahedron + " 2, 13, 14, 5, 3, -1, 1, 11, 12, 13, 2, -1,"
- dodecahedron = dodecahedron + " 10, 18, 19, 12, 11, -1, 19, 15, 14, 13, 12, -1,"
- dodecahedron = dodecahedron + " 15, 16, 6, 5, 14, -1, 8, 7, 6, 16, 17, -1,"
- dodecahedron = dodecahedron + " 9, 8, 17, 18, 10, -1, 18, 17, 16, 15, 19, -1,"
- dodecahedron = dodecahedron + " ]"
- dodecahedron = dodecahedron + " }"
- dodecahedron = dodecahedron + "}"
- 'Read from the string.
- Dim myInput As SoInput
- Set myInput = New SoInput
- Call myInput.setBuffer(dodecahedron)
- Dim result As SoSeparator
- Set result = myInput.readAll()
- Call V3Space1.setSceneRoot(result)
- Call V3Space1.viewAll
- End Sub
-