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

  1. VERSION 4.00
  2. Begin VB.Form Form1 
  3.    Caption         =   "13_3 Time Counter"
  4.    ClientHeight    =   5865
  5.    ClientLeft      =   1140
  6.    ClientTop       =   1425
  7.    ClientWidth     =   8775
  8.    Height          =   6240
  9.    Left            =   1080
  10.    LinkTopic       =   "Form1"
  11.    ScaleHeight     =   5865
  12.    ScaleWidth      =   8775
  13.    Top             =   1110
  14.    Width           =   8895
  15.    Begin VB.Label Label1 
  16.       Caption         =   $"13_3TimeCounter.frx":0000
  17.       BeginProperty Font 
  18.          name            =   "MS Sans Serif"
  19.          charset         =   0
  20.          weight          =   400
  21.          size            =   12
  22.          underline       =   0   'False
  23.          italic          =   0   'False
  24.          strikethrough   =   0   'False
  25.       EndProperty
  26.       Height          =   975
  27.       Left            =   120
  28.       TabIndex        =   1
  29.       Top             =   120
  30.       Width           =   8535
  31.    End
  32.    Begin TgsVisual3SpaceLibCtl.V3Space V3Space1 
  33.       Height          =   4695
  34.       Left            =   0
  35.       TabIndex        =   0
  36.       Top             =   1200
  37.       Width           =   8775
  38.       _Version        =   131072
  39.       _ExtentX        =   15478
  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.   Dim root As SoSeparator
  49.   Set root = New SoSeparator
  50.     'Set up transformations
  51.     Dim jumpTranslation As SoTranslation
  52.     Set jumpTranslation = New SoTranslation
  53.     Call root.addChild(jumpTranslation)
  54.     Dim initialTransform As SoTransform
  55.     Set initialTransform = New SoTransform
  56.     Call initialTransform.translation.setValue(-20#, 0#, 0#)
  57.     Call initialTransform.scaleFactor.setValue(40#, 40#, 40#)
  58.     Dim vec3f As SbVec3f
  59.     Set vec3f = New SbVec3f
  60.     Call vec3f.setValue(1, 0, 0)
  61.     Dim rot As SbRotation
  62.     Set rot = New SbRotation
  63.     Call rot.setValue(vec3f, 3.1415 / 2#)
  64.     Call initialTransform.rotation.setValue(rot)
  65.     Call root.addChild(initialTransform)
  66.     Dim myInput As SoInput
  67.     Set myInput = New SoInput
  68.     Dim idisp As Object
  69.     Set idisp = V3Space1.GetIDispatch
  70.     Dim manObject As Object
  71.     Set manObject = myInput.readAllUrl(V3Space1.getRegistryDataPath() + "\examples\data\jumpyMan.iv", idisp)
  72.     If manObject Is Nothing Then
  73.         GoTo cleanup
  74.     End If
  75.     Call root.addChild(manObject)
  76.     'Create two counters, and connect to X and Y translations.
  77.     'The Y counter is small and high frequency.
  78.     'The X counter is large and low frequency.
  79.     'This results in small jumps across the screen,
  80.     'left to right, again and again and again and ....
  81.     Dim jumpHeightCounter As SoTimeCounter
  82.     Set jumpHeightCounter = New SoTimeCounter
  83.     Dim jumpWidthCounter As SoTimeCounter
  84.     Set jumpWidthCounter = New SoTimeCounter
  85.     Dim jump As SoComposeVec3f
  86.     Set jump = New SoComposeVec3f
  87.     Call jumpHeightCounter.Max.setValue(6)
  88.     Call jumpHeightCounter.frequency.setValue(1.5)
  89.     Call jumpWidthCounter.Max.setValue(40)
  90.     Call jumpWidthCounter.frequency.setValue(0.15)
  91.     Call jump.X.connectFromEngine(jumpWidthCounter.output)
  92.     Call jump.Y.connectFromEngine(jumpHeightCounter.output)
  93.     Call jumpTranslation.translation.connectFromEngine(jump.vector)
  94.     Call V3Space1.setSceneRoot(root)
  95.     Call V3Space1.viewAll
  96.     Dim camera As Object
  97.     Set camera = V3Space1.getCurrentCamera
  98.     Call camera.position.setValue(-8#, -7#, 50)
  99. cleanup:
  100.     Set root = Nothing
  101.     Set jumpTranslation = Nothing
  102.     Set intialTransform = Nothing
  103.     Set vec3f = Nothing
  104.     Set rot = Nothing
  105.     Set myInput = Nothing
  106.     Set idisp = Nothing
  107.     Set manObject = Nothing
  108.     Set jumpHeightCounter = Nothing
  109.     Set jumpWidthCounter = Nothing
  110.     Set jump = Nothing
  111.     Set camera = Nothing
  112. End Sub
  113.