home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form Form1
- Caption = "13_8Blinker"
- ClientHeight = 5670
- ClientLeft = 1140
- ClientTop = 1425
- ClientWidth = 5445
- Height = 6045
- Left = 1080
- LinkTopic = "Form1"
- ScaleHeight = 5670
- ScaleWidth = 5445
- Top = 1110
- Width = 5565
- Begin VB.Label Label1
- Caption = "This example uses an SoBlinker node to flash a sign on and off."
- 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 = 5295
- End
- Begin TgsVisual3SpaceLibCtl.V3Space V3Space1
- Height = 4695
- Left = 0
- TabIndex = 0
- Top = 960
- Width = 5415
- _Version = 131072
- _ExtentX = 9551
- _ExtentY = 8281
- _StockProps = 0
- decorationOn = 0 'False
- End
- Attribute VB_Name = "Form1"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- Private Sub Form_Initialize()
- 'Set up camera and light
- Dim root As SoSeparator
- Set root = New SoSeparator
- Dim fileContents As Object
- Set fileContents = utlReadFile(V3Space1.getRegistryDataPath() + "examples\data\eatAtJosies.iv", V3Space1.GetIDispatch())
- If fileContents Is Nothing Then
- Exit Sub
- End If
- Dim eatAt As Object
- Set eatAt = fileContents.getByName("EatAt")
- If eatAt Is Nothing Then
- Exit Sub
- End If
- Dim josie As Object
- Set josie = fileContents.getByName("Josies")
- If josie Is Nothing Then
- Exit Sub
- End If
- Dim frame As SoSeparator
- Set frame = fileContents.getByName("Frame")
- If frame Is Nothing Then
- Exit Sub
- End If
- 'Add the non-blinking part of the sign to the root
- Call root.addChild(eatAt)
- 'Add the fast-blinking part to a blinker node
- Dim fastBlinker As SoBlinker
- Set fastBlinker = New SoBlinker
- Call root.addChild(fastBlinker)
- Call fastBlinker.speed.setValue(2) 'blinks 2 times a second
- Call fastBlinker.addChild(josie)
- 'Add the slow-blinking part to another blinker node
- Dim slowBlinker As SoBlinker
- Set slowBlinker = New SoBlinker
- Call root.addChild(slowBlinker)
- Call slowBlinker.speed.setValue(0.5) '2 secs per cycle; 1 on, 1 off
- Call slowBlinker.addChild(frame)
- Call V3Space1.setSceneRoot(root)
- Call V3Space1.viewAll
- End Sub
-