home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form Form1
- Caption = "13_3 Time Counter"
- ClientHeight = 5865
- ClientLeft = 1140
- ClientTop = 1425
- ClientWidth = 8775
- Height = 6240
- Left = 1080
- LinkTopic = "Form1"
- ScaleHeight = 5865
- ScaleWidth = 8775
- Top = 1110
- Width = 8895
- Begin VB.Label Label1
- Caption = $"13_3TimeCounter.frx":0000
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 400
- size = 12
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 975
- Left = 120
- TabIndex = 1
- Top = 120
- Width = 8535
- End
- Begin TgsVisual3SpaceLibCtl.V3Space V3Space1
- Height = 4695
- Left = 0
- TabIndex = 0
- Top = 1200
- Width = 8775
- _Version = 131072
- _ExtentX = 15478
- _ExtentY = 8281
- _StockProps = 0
- decorationOn = 0 'False
- End
- Attribute VB_Name = "Form1"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- Private Sub Form_Initialize()
- Dim root As SoSeparator
- Set root = New SoSeparator
- 'Set up transformations
- Dim jumpTranslation As SoTranslation
- Set jumpTranslation = New SoTranslation
- Call root.addChild(jumpTranslation)
- Dim initialTransform As SoTransform
- Set initialTransform = New SoTransform
- Call initialTransform.translation.setValue(-20#, 0#, 0#)
- Call initialTransform.scaleFactor.setValue(40#, 40#, 40#)
- Dim vec3f As SbVec3f
- Set vec3f = New SbVec3f
- Call vec3f.setValue(1, 0, 0)
- Dim rot As SbRotation
- Set rot = New SbRotation
- Call rot.setValue(vec3f, 3.1415 / 2#)
- Call initialTransform.rotation.setValue(rot)
- Call root.addChild(initialTransform)
- Dim myInput As SoInput
- Set myInput = New SoInput
- Dim idisp As Object
- Set idisp = V3Space1.GetIDispatch
- Dim manObject As Object
- Set manObject = myInput.readAllUrl(V3Space1.getRegistryDataPath() + "\examples\data\jumpyMan.iv", idisp)
- If manObject Is Nothing Then
- GoTo cleanup
- End If
- Call root.addChild(manObject)
- 'Create two counters, and connect to X and Y translations.
- 'The Y counter is small and high frequency.
- 'The X counter is large and low frequency.
- 'This results in small jumps across the screen,
- 'left to right, again and again and again and ....
- Dim jumpHeightCounter As SoTimeCounter
- Set jumpHeightCounter = New SoTimeCounter
- Dim jumpWidthCounter As SoTimeCounter
- Set jumpWidthCounter = New SoTimeCounter
- Dim jump As SoComposeVec3f
- Set jump = New SoComposeVec3f
- Call jumpHeightCounter.Max.setValue(6)
- Call jumpHeightCounter.frequency.setValue(1.5)
- Call jumpWidthCounter.Max.setValue(40)
- Call jumpWidthCounter.frequency.setValue(0.15)
- Call jump.X.connectFromEngine(jumpWidthCounter.output)
- Call jump.Y.connectFromEngine(jumpHeightCounter.output)
- Call jumpTranslation.translation.connectFromEngine(jump.vector)
- Call V3Space1.setSceneRoot(root)
- Call V3Space1.viewAll
- Dim camera As Object
- Set camera = V3Space1.getCurrentCamera
- Call camera.position.setValue(-8#, -7#, 50)
- cleanup:
- Set root = Nothing
- Set jumpTranslation = Nothing
- Set intialTransform = Nothing
- Set vec3f = Nothing
- Set rot = Nothing
- Set myInput = Nothing
- Set idisp = Nothing
- Set manObject = Nothing
- Set jumpHeightCounter = Nothing
- Set jumpWidthCounter = Nothing
- Set jump = Nothing
- Set camera = Nothing
- End Sub
-