home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form Form1
- Caption = "07_03TextureFunction"
- ClientHeight = 5505
- ClientLeft = 1140
- ClientTop = 1425
- ClientWidth = 6690
- Height = 5880
- Left = 1080
- LinkTopic = "Form1"
- ScaleHeight = 5505
- ScaleWidth = 6690
- Top = 1110
- Width = 6810
- Begin TgsVisual3SpaceLibCtl.V3Space V3Space1
- Height = 5535
- Left = -120
- TabIndex = 0
- Top = 0
- Width = 6855
- _Version = 131072
- _ExtentX = 12091
- _ExtentY = 9763
- _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
- 'Choose a texture.
- Dim faceTexture As SoTexture2
- Set faceTexture = New SoTexture2
- Call root.addChild(faceTexture)
- Call faceTexture.filename.setValue(V3Space1.getRegistryDataPath() + "\examples\data\sillyFace.rgb")
- 'Make the diffuse color pure white
- Dim myMaterial As SoMaterial
- Set myMaterial = New SoMaterial
- Call myMaterial.diffuseColor.setValue(1, 1, 1)
- Call root.addChild(myMaterial)
- 'This texture2Transform centers the texture about (0,0,0)
- Dim myTexXf As SoTexture2Transform
- Set myTexXf = New SoTexture2Transform
- Call myTexXf.translation.setValue(0.5, 0.5)
- Call root.addChild(myTexXf)
- 'Define a texture coordinate plane node. This one will
- 'repeat with a frequency of two times per unit length.
- 'Add a sphere for it to affect.
- Dim texPlane1 As SoTextureCoordinatePlane
- Set texPlane1 = New SoTextureCoordinatePlane
- Call texPlane1.directionS.setValue(2, 0, 0)
- Call texPlane1.directionT.setValue(0, 2, 0)
- Call root.addChild(texPlane1)
- Dim sphere As SoSphere
- Set sphere = New SoSphere
- Call root.addChild(sphere)
- 'A translation node for spacing the three spheres.
- Dim myTranslation As SoTranslation
- Set myTranslation = New SoTranslation
- Call myTranslation.translation.setValue(2.5, 0, 0)
- 'Create a second sphere with a repeat frequency of 1.
- Dim texPlane2 As SoTextureCoordinatePlane
- Set texPlane2 = New SoTextureCoordinatePlane
- Call texPlane2.directionS.setValue(1, 0, 0)
- Call texPlane2.directionT.setValue(0, 1, 0)
- Call root.addChild(myTranslation)
- Call root.addChild(texPlane2)
- Call root.addChild(sphere)
- 'The third sphere has a repeat frequency of .5
- Dim texPlane3 As SoTextureCoordinatePlane
- Set texPlane3 = New SoTextureCoordinatePlane
- Call texPlane3.directionS.setValue(0.5, 0, 0)
- Call texPlane3.directionT.setValue(0, 0.5, 0)
- Call root.addChild(myTranslation)
- Call root.addChild(texPlane3)
- Call root.addChild(sphere)
- Call V3Space1.setSceneRoot(root)
- Call V3Space1.viewAll
- Set root = Nothing
- Set faceTexture = Nothing
- Set myMaterial = Nothing
- Set myTexXf = Nothing
- Set texPlane1 = Nothing
- Set sphere = Nothing
- Set myTranslation = Nothing
- Set myTexPlane2 = Nothing
- Set texPlane3 = Nothing
-
- End Sub
-