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

  1. VERSION 4.00
  2. Begin VB.Form Form1 
  3.    Caption         =   "13_2 Elapsed Time"
  4.    ClientHeight    =   4485
  5.    ClientLeft      =   1140
  6.    ClientTop       =   1425
  7.    ClientWidth     =   8070
  8.    Height          =   4860
  9.    Left            =   1080
  10.    LinkTopic       =   "Form1"
  11.    ScaleHeight     =   4485
  12.    ScaleWidth      =   8070
  13.    Top             =   1110
  14.    Width           =   8190
  15.    Begin VB.Label Label1 
  16.       Caption         =   $"13_2ElapsedTime.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          =   735
  27.       Left            =   120
  28.       TabIndex        =   1
  29.       Top             =   120
  30.       Width           =   7935
  31.    End
  32.    Begin TgsVisual3SpaceLibCtl.V3Space V3Space1 
  33.       Height          =   3495
  34.       Left            =   0
  35.       TabIndex        =   0
  36.       Top             =   960
  37.       Width           =   8055
  38.       _Version        =   131072
  39.       _ExtentX        =   14208
  40.       _ExtentY        =   6165
  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 slideTranslation As SoTranslation
  52.     Set slideTranslation = New SoTranslation
  53.     Call root.addChild(slideTranslation)
  54.     Dim initialTransform As SoTransform
  55.     Set initialTransform = New SoTransform
  56.     Call initialTransform.translation.setValue(-17#, 0#, 0#)
  57.     Call initialTransform.scaleFactor.setValue(10#, 10#, 10#)
  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 figureObject As Object
  71.     Set figureObject = myInput.readAllUrl(V3Space1.getRegistryDataPath() + "\examples\data\jumpyMan.iv", idisp)
  72.     If figureObject Is Nothing Then
  73.         GoTo cleanup
  74.     End If
  75.     Call root.addChild(figureObject)
  76.     Dim myCamera As Object
  77.     Set myCamera = V3Space1.getCurrentCamera()
  78.     Call myCamera.position.setValue(-2#, -2#, 20#)
  79.     Call V3Space1.setSceneRoot(root)
  80.     'Make the X translation value change over time.
  81.     Dim myCounter As SoElapsedTime
  82.     Set myCounter = New SoElapsedTime
  83.     Dim slideDistance As SoComposeVec3f
  84.     Set slideDistance = New SoComposeVec3f
  85.         
  86.     Call slideDistance.X.connectFromEngine(myCounter.timeout)
  87.     Call slideTranslation.translation.connectFromEngine(slideDistance.vector)
  88. cleanup:
  89.     Set root = Nothing
  90.     Set myCamera = Nothing
  91.     Set slideTranslation = Nothing
  92.     Set initialTransform = Nothing
  93.     Set vec3f = Nothing
  94.     Set rot = Nothing
  95.     Set myInput = Nothing
  96.     Set figureObject = Nothing
  97.     Set myCounter = Nothing
  98.     Set slideDistance = Nothing
  99. End Sub
  100.