home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form Form1
- Caption = "06_02 Simple 3D Text"
- ClientHeight = 4920
- ClientLeft = 915
- ClientTop = 1230
- ClientWidth = 5775
- Height = 5295
- Left = 855
- LinkTopic = "Form1"
- ScaleHeight = 4920
- ScaleWidth = 5775
- Top = 915
- Width = 5895
- Begin TgsVisual3SpaceLibCtl.V3Space V3Space1
- Height = 4932
- Left = 0
- TabIndex = 0
- Top = 0
- Width = 5772
- _Version = 131072
- _ExtentX = 10181
- _ExtentY = 8700
- _StockProps = 0
- End
- Attribute VB_Name = "Form1"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- Private Sub Form_Initialize()
- Dim root As SoGroup
- Set root = New SoGroup
- 'Choose a font
- Dim myFont As SoFont
- Set myFont = New SoFont
- Call myFont.Name.setValue("Times New Roman;Regular")
- Call myFont.Size.setValue(0.2)
- Call root.addChild(myFont)
- 'We'll color the front of the text white, and the sides
- 'dark grey. So use a materialBinding of PER_PART and
- 'two diffuseColor values in the material node.
- Dim myMaterial As SoMaterial
- Set myMaterial = New SoMaterial
- Dim myBinding As SoMaterialBinding
- Set myBinding = New SoMaterialBinding
- Call myMaterial.diffuseColor.set1RGBValue(0, 1#, 1#, 1#)
- Call myMaterial.diffuseColor.set1RGBValue(1, 0.1, 0.1, 0.1)
- Call myMaterial.diffuseColor.set1RGBValue(2, 1, 1, 1)
- 'TODO VB dosn't support OLE enum Types
- Call myBinding.Value.setValue(3)
- Call root.addChild(myMaterial)
- Call root.addChild(myBinding)
- 'Create the globe
- Dim sphereSep As SoSeparator
- Set sphereSep = New SoSeparator
- Dim myTexture2 As SoTexture2
- Set myTexture2 = New SoTexture2
- Dim sphereComplexity As SoComplexity
- Set sphereComplexity = New SoComplexity
- Call sphereComplexity.Value.setValue(0.55)
- Call root.addChild(sphereSep)
- Call sphereSep.addChild(myTexture2)
- Call sphereSep.addChild(sphereComplexity)
- Dim mySphere As SoSphere
- Set mySphere = New SoSphere
- Call sphereSep.addChild(mySphere)
- Call myTexture2.filename.setValue(V3Space1.getRegistryDataPath() + "\examples\data\globe.rgb")
- 'Add Text3 for AFRICA, transformed to proper location.
- Dim africaSep As SoSeparator
- Set africaSep = New SoSeparator
- Dim africaTransform As SoTransform
- Set africaTransform = New SoTransform
- Dim africaText As SoText3
- Set africaText = New SoText3
- Dim axis As SbVec3f
- Set axis = New SbVec3f
- Call axis.setValue(0, 1, 0)
- Call africaTransform.rotation.setValueAxis(axis, 0.4)
- Call africaTransform.translation.setValue(0.25, 0#, 1.25)
- Call africaText.parts.setValue(&H7&) ' = SoText3::ALL;
- Call africaText.Str.setValue("AFRICA")
- Call root.addChild(africaSep)
- Call africaSep.addChild(africaTransform)
- Call africaSep.addChild(africaText)
- 'Add Text3 for ASIA, transformed to proper location.
- Dim asiaSep As SoSeparator
- Set asiaSep = New SoSeparator
- Dim asiaTransform As SoTransform
- Set asiaTransform = New SoTransform
- Dim asiaText As SoText3
- Set asiaText = New SoText3
- Call asiaTransform.rotation.setValueAxis(axis, 1.5)
- Call asiaTransform.translation.setValue(0.8, 0.6, 0.5)
- Call asiaText.parts.setValue(&H7&) 'SoText3::ALL;
- Call asiaText.Str.setValue("ASIA")
- Call root.addChild(asiaSep)
- Call asiaSep.addChild(asiaTransform)
- Call asiaSep.addChild(asiaText)
- Call V3Space1.setSceneRoot(root)
- Call V3Space1.viewAll
- 'Clean up
- Set root = Nothing
- Set sceneRoot = Nothing
- Set myFont = Nothing
- Set africaText = Nothing
- Set africaSep = Nothing
- Set africaTransform = Nothing
- Set asiaText = Nothing
- Set asiaSep = Nothing
- Set asiaTransform = Nothing
- Set axis = Nothing
- Set mySphere = Nothing
- Set myTexture2 = Nothing
- End Sub
-