home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form Form1
- ClientHeight = 4860
- ClientLeft = 1140
- ClientTop = 1425
- ClientWidth = 6330
- Height = 5235
- Left = 1080
- LinkTopic = "Form1"
- ScaleHeight = 4860
- ScaleWidth = 6330
- Top = 1110
- Width = 6450
- Begin VB.Label fName
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 400
- size = 12
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 375
- Left = 360
- TabIndex = 2
- Top = 720
- Width = 5895
- End
- Begin VB.Label Label1
- Caption = "Example of reading a scene from a file."
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 700
- size = 12
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 375
- Left = 360
- TabIndex = 1
- Top = 120
- Width = 5775
- End
- Begin TgsVisual3SpaceLibCtl.V3Space V3Space1
- Height = 3495
- Left = 0
- TabIndex = 0
- Top = 1320
- Width = 6255
- _Version = 131072
- _ExtentX = 11033
- _ExtentY = 6165
- _StockProps = 0
- decorationOn = 0 'False
- End
- Attribute VB_Name = "Form1"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- Private Sub Form_Load()
- 'Read the file
- Dim scene As Object
- Set scene = readFile(V3Space1.getRegistryDataPath() + "\examples\data\bookshelf.iv")
- If Not (scene Is Nothing) Then
- Call V3Space1.setSceneRoot(scene)
- Call V3Space1.viewAll
- End If
- End Sub
- Public Function readFile(fileName As String) As Object
- 'Open the input file
- Dim mySceneInput As SoInput
- Set mySceneInput = New SoInput
- Dim myGraph As Object
- Set myGraph = mySceneInput.readAllUrl(fileName, V3Space1.GetIDispatch())
- If (myGraph Is Nothing) Then
- MsgBox "Unable to locate file: " + fileName
- fName.Caption = ""
- Else
- fName.Caption = fileName
- End If
- Set readFile = myGraph
- End Function
-