home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form Form1
- Caption = "15_2 SliderBox"
- ClientHeight = 5850
- ClientLeft = 1140
- ClientTop = 1425
- ClientWidth = 6090
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 700
- size = 12
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 6225
- Left = 1080
- LinkTopic = "Form1"
- ScaleHeight = 5850
- ScaleWidth = 6090
- Top = 1110
- Width = 6210
- Begin VB.Label Label1
- Caption = $"15_2SliderBox.frx":0000
- Height = 1575
- Left = 120
- TabIndex = 1
- Top = 120
- Width = 5895
- End
- Begin TgsVisual3SpaceLibCtl.V3Space V3Space1
- Height = 3855
- Left = 120
- TabIndex = 0
- Top = 1920
- Width = 5895
- _Version = 131072
- _ExtentX = 10398
- _ExtentY = 6800
- _StockProps = 0
- decorationOn = 0 'False
- viewingOn = 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
- 'Create 3 translate1Draggers and place them in space.
- Dim xDragSep, yDragSep, zDragSep As SoSeparator
- Set xDragSep = New SoSeparator
- Set yDragSep = New SoSeparator
- Set zDragSep = New SoSeparator
- Call root.addChild(xDragSep)
- Call root.addChild(yDragSep)
- Call root.addChild(zDragSep)
- 'Separators will each hold a different transform
- Dim xDragXf, yDragXf, zDragXf As SoTransform
- Set xDragXf = New SoTransform
- Set yDragXf = New SoTransform
- Set zDragXf = New SoTransform
- Call xDragXf.setFieldDataString("translation 0 -4 8")
- Call yDragXf.setFieldDataString("translation -8 0 8 rotation 0 0 1 1.57")
- Call zDragXf.setFieldDataString("translation -8 -4 0 rotation 0 1 0 -1.57")
- Call xDragSep.addChild(xDragXf)
- Call yDragSep.addChild(yDragXf)
- Call zDragSep.addChild(zDragXf)
- 'Add the draggers under the separators, after transforms
- Dim xDragger, yDragger, zDragger As SoTranslate1Dragger
- Set xDragger = New SoTranslate1Dragger
- Set yDragger = New SoTranslate1Dragger
- Set zDragger = New SoTranslate1Dragger
- Call xDragSep.addChild(xDragger)
- Call yDragSep.addChild(yDragger)
- Call zDragSep.addChild(zDragger)
- 'Create shape kit for the 3D text
- 'The text says 'Slide Cubes To Move Me'
- Dim textKit As SoShapeKit
- Set textKit = New SoShapeKit
- Call root.addChild(textKit)
- Dim myText3 As SoText3
- Set myText3 = New SoText3
- Call textKit.setPart(utlSbName("shape"), myText3)
- Call myText3.justification.setValue(SoText3_CENTER)
- Call myText3.Str.set1Value(0, "Slide Arrows")
- Call myText3.Str.set1Value(1, "To")
- Call myText3.Str.set1Value(2, "Move Me")
- Call textKit.setParam("font { size 2}")
- Call textKit.setParam("material { diffuseColor 1 1 0}")
- 'Create shape kit for surrounding box.
- 'It's an unpickable cube, sized as (16,8,16)
- Dim boxKit As SoShapeKit
- Set boxKit = New SoShapeKit
- Call root.addChild(boxKit)
- Dim myCube As SoCube
- Set myCube = New SoCube
- Call boxKit.setPart(utlSbName("shape"), myCube)
- Call boxKit.setParam("drawStyle { style LINES }")
- Call boxKit.setParam("pickStyle { style UNPICKABLE }")
- Call boxKit.setParam("material { emissiveColor 1 0 1 }")
- Call boxKit.setParam("shape { width 16 height 8 depth 16 }")
- 'Create the calculator to make a translation
- 'for the text. The x component of a translate1Dragger's
- 'translation field shows how far it moved in that
- 'direction. So our text's translation is:
- '(xDragTranslate[0],yDragTranslate[0],zDragTranslate[0])
- Static myCalc As SoCalculator
- Set myCalc = New SoCalculator
- Call myCalc.AU.connectFrom(xDragger.translation)
- Call myCalc.BU.connectFrom(yDragger.translation)
- Call myCalc.CU.connectFrom(zDragger.translation)
- Call myCalc.expression.setValue("oA = vec3f(A[0],B[0],C[0])")
- 'Connect the the translation in textKit from myCalc
- Dim textXf As SoTransform
- Set textXf = textKit.getPart(utlSbName("transform"), True)
- Call textXf.translation.connectFromEngine(myCalc.oAU)
- Call V3Space1.setSceneRoot(root)
- Call V3Space1.viewAll
- End Sub
-