home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form Form1
- Caption = "04_02 Lights"
- ClientHeight = 4695
- ClientLeft = 915
- ClientTop = 1230
- ClientWidth = 4560
- Height = 5070
- Left = 855
- LinkTopic = "Form1"
- ScaleHeight = 4695
- ScaleWidth = 4560
- Top = 915
- Width = 4680
- Begin TgsVisual3SpaceLibCtl.V3Space V3Space1
- Height = 4692
- Left = 0
- TabIndex = 0
- Top = 0
- Width = 4572
- _Version = 131072
- _ExtentX = 8065
- _ExtentY = 8276
- _StockProps = 0
- 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
- 'Add a directional light
- Dim myDirLight As SoDirectionalLight
- Set myDirLight = New SoDirectionalLight
- Call myDirLight.direction.setValue(0, -1, -1)
- Call myDirLight.Color.setValue(1#, 0#, 0#)
- Call root.addChild(myDirLight)
- 'Put the shuttle and the light below a transform separator.
- 'A transform separator pushes and pops the transformation
- 'just like a separator node, but other aspects of the state
- 'are not pushed and popped. So the shuttle's translation
- 'will affect only the light. But the light will shine on
- 'the rest of the scene.
- Dim myTransformSeparator As SoTransformSeparator
- Set myTransformSeparator = New SoTransformSeparator
- Call root.addChild(myTransformSeparator)
- 'A shuttle node translates back and forth between the two
- 'fields translation0 and translation1.
- 'This moves the light.
- Dim myShuttle As SoShuttle
- Set myShuttle = New SoShuttle
- Call myTransformSeparator.addChild(myShuttle)
- Call myShuttle.translation0.setValue(-2, -1, 3)
- Call myShuttle.translation1.setValue(1, 2, -3)
- 'Add the point light below the transformSeparator
- Dim myPointLight As SoPointLight
- Set myPointLight = New SoPointLight
- Call myTransformSeparator.addChild(myPointLight)
- Call myPointLight.Color.setValue(0, 1, 0)
- Dim myCone As SoCone
- Set myCone = New SoCone
- Call root.addChild(myCone)
- Call V3Space1.setSceneRoot(root)
- Call V3Space1.viewAll
- Call V3Space1.setHeadlight(False)
- Call V3Space1.setDecorations(False)
- 'Clean Up
- Set myDirLight = Nothing
- Set myTransformSeparator = Nothing
- Set myShuttle = Nothing
- Set myPointLight = Nothing
- Set myCone = Nothing
- Set sceneRoot = Nothing
- Set root = Nothing
- End Sub
-