home *** CD-ROM | disk | FTP | other *** search
/ Using Visual Basic 5 (Platinum Edition) / vb5.iso / ACTIVEX / VIS3SPAC / DATA.9 / examples / vb / 13_8Blinker / 13_8Blinker.frm (.txt) next >
Encoding:
Visual Basic Form  |  1996-11-30  |  2.9 KB  |  88 lines

  1. VERSION 4.00
  2. Begin VB.Form Form1 
  3.    Caption         =   "13_8Blinker"
  4.    ClientHeight    =   5670
  5.    ClientLeft      =   1140
  6.    ClientTop       =   1425
  7.    ClientWidth     =   5445
  8.    Height          =   6045
  9.    Left            =   1080
  10.    LinkTopic       =   "Form1"
  11.    ScaleHeight     =   5670
  12.    ScaleWidth      =   5445
  13.    Top             =   1110
  14.    Width           =   5565
  15.    Begin VB.Label Label1 
  16.       Caption         =   "This example uses an SoBlinker node to flash a sign on and off."
  17.       BeginProperty Font 
  18.          name            =   "MS Sans Serif"
  19.          charset         =   0
  20.          weight          =   700
  21.          size            =   12
  22.          underline       =   0   'False
  23.          italic          =   0   'False
  24.          strikethrough   =   0   'False
  25.       EndProperty
  26.       Height          =   735
  27.       Left            =   120
  28.       TabIndex        =   1
  29.       Top             =   120
  30.       Width           =   5295
  31.    End
  32.    Begin TgsVisual3SpaceLibCtl.V3Space V3Space1 
  33.       Height          =   4695
  34.       Left            =   0
  35.       TabIndex        =   0
  36.       Top             =   960
  37.       Width           =   5415
  38.       _Version        =   131072
  39.       _ExtentX        =   9551
  40.       _ExtentY        =   8281
  41.       _StockProps     =   0
  42.       decorationOn    =   0   'False
  43.    End
  44. Attribute VB_Name = "Form1"
  45. Attribute VB_Creatable = False
  46. Attribute VB_Exposed = False
  47. Private Sub Form_Initialize()
  48.     'Set up camera and light
  49.     Dim root As SoSeparator
  50.     Set root = New SoSeparator
  51.     Dim fileContents As Object
  52.     Set fileContents = utlReadFile(V3Space1.getRegistryDataPath() + "examples\data\eatAtJosies.iv", V3Space1.GetIDispatch())
  53.     If fileContents Is Nothing Then
  54.         Exit Sub
  55.     End If
  56.     Dim eatAt As Object
  57.     Set eatAt = fileContents.getByName("EatAt")
  58.     If eatAt Is Nothing Then
  59.         Exit Sub
  60.     End If
  61.     Dim josie As Object
  62.     Set josie = fileContents.getByName("Josies")
  63.     If josie Is Nothing Then
  64.         Exit Sub
  65.     End If
  66.     Dim frame As SoSeparator
  67.     Set frame = fileContents.getByName("Frame")
  68.     If frame Is Nothing Then
  69.         Exit Sub
  70.     End If
  71.     'Add the non-blinking part of the sign to the root
  72.     Call root.addChild(eatAt)
  73.     'Add the fast-blinking part to a blinker node
  74.     Dim fastBlinker As SoBlinker
  75.     Set fastBlinker = New SoBlinker
  76.     Call root.addChild(fastBlinker)
  77.     Call fastBlinker.speed.setValue(2) 'blinks 2 times a second
  78.     Call fastBlinker.addChild(josie)
  79.     'Add the slow-blinking part to another blinker node
  80.     Dim slowBlinker As SoBlinker
  81.     Set slowBlinker = New SoBlinker
  82.     Call root.addChild(slowBlinker)
  83.     Call slowBlinker.speed.setValue(0.5)  '2 secs per cycle; 1 on, 1 off
  84.     Call slowBlinker.addChild(frame)
  85.     Call V3Space1.setSceneRoot(root)
  86.     Call V3Space1.viewAll
  87. End Sub
  88.