home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form Form1
- Appearance = 0 'Flat
- BackColor = &H00C0C0C0&
- BorderStyle = 1 'Fixed Single
- Caption = "First Impression Rotation Demo"
- ClientHeight = 5820
- ClientLeft = 1185
- ClientTop = 1575
- ClientWidth = 8265
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 700
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- ForeColor = &H80000008&
- Height = 6285
- Icon = "ROTATE.frx":0000
- Left = 1095
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 5820
- ScaleWidth = 8265
- Top = 1200
- Width = 8445
- Begin VB.Frame Frame2
- Caption = " Options "
- Height = 1215
- Left = 5580
- TabIndex = 4
- Top = 3900
- Width = 2535
- Begin VB.TextBox txtRotationDelta
- Height = 285
- Left = 300
- TabIndex = 7
- Text = "2"
- Top = 360
- Width = 375
- End
- Begin VB.CheckBox chkChangeElevation
- Caption = "Change Elevation"
- Height = 255
- Left = 480
- TabIndex = 5
- Top = 780
- Value = 1 'Checked
- Width = 1875
- End
- Begin VB.Label Label4
- Caption = "Rotation Delta"
- Height = 195
- Left = 780
- TabIndex = 6
- Top = 420
- Width = 1335
- End
- End
- Begin VB.CommandButton cmdStart
- Appearance = 0 'Flat
- BackColor = &H80000005&
- Caption = "Start Rotation"
- Height = 375
- Left = 5640
- TabIndex = 0
- Top = 5280
- Width = 2415
- End
- Begin VCIFiLib.VtChart VtChart1
- Height = 5595
- Left = 120
- TabIndex = 3
- Top = 120
- Width = 5235
- _version = 65536
- _extentx = 9234
- _extenty = 9869
- _stockprops = 96
- borderstyle = 1
- filename = "ROTATE.frx":030A
- End
- Begin VB.Label Label3
- Alignment = 2 'Center
- Caption = "Press Escape to stop."
- BeginProperty Font
- name = "Arial"
- charset = 0
- weight = 700
- size = 9.75
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- ForeColor = &H000000C0&
- Height = 255
- Left = 5580
- TabIndex = 2
- Top = 2820
- Visible = 0 'False
- Width = 2535
- End
- Begin VB.Label Label2
- Alignment = 2 'Center
- Caption = "First Impression Real-Time Rotation"
- BeginProperty Font
- name = "Times New Roman"
- charset = 0
- weight = 700
- size = 24
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 2235
- Left = 5520
- TabIndex = 1
- Top = 120
- Width = 2655
- End
- Attribute VB_Name = "Form1"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- Option Explicit
- Dim StillGoing%
- Private Sub chkChangeElevation_Click()
- cmdStart.SetFocus
- End Sub
- Private Sub cmdStart_KeyDown(KeyCode As Integer, Shift As Integer)
- If KeyCode = 27 Then
- StillGoing = False
- Else
- KeyCode = 0
- End If
- End Sub
- Private Sub cmdStart_Click()
- Dim elevation!, rotation!, rot!, rotationDegrees!
- Dim theView As Object
- ' Put chart in Blit mode
- VtChart1.DrawMode = VtChDrawModeBlit
- ' Store a pointer to the view to minimize
- ' traversing the object hierarchy
- ' Get the rotation amount
- rotationDegrees = Val(txtRotationDelta.Text)
- If rotationDegrees < 1 Or rotationDegrees > 90 Then
- MsgBox "Rotation must be between 1 and 90 degrees."
- Exit Sub
- End If
- ' Keep going as long as this flag is True
- StillGoing = True
- Label3.Visible = True
- cmdStart.SetFocus
- ' Rotate the chart
- rotation = 0
- Do While StillGoing
- If chkChangeElevation = 1 Then
- rot = rotation Mod 180
- elevation = IIf(rot <= 90, rot, 90 - (rot - 90))
- Else
- elevation = 30
- End If
-
- VtChart1.Plot.View3d.Set rotation, elevation
-
- DoEvents ' Allow for the Escape key to get through
-
- ' Rotate through 360 degrees
- rotation = rotation + rotationDegrees
- If rotation >= 360 Then rotation = 0
- Loop
- Form1.Label3.Visible = False
- End Sub
- Private Sub Form_KeyPress(KeyAscii As Integer)
- Dim RDegrees As Integer
- If KeyAscii = 13 Then
- RDegrees = Val(txtRotationDelta.Text)
- If RDegrees < 1 Or RDegrees > 90 Then
- MsgBox "Rotation must be between 1 and 90 degrees."
- End If
- KeyAscii = 0
- End If
- End Sub
- Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
- End Sub
- Private Sub txtRotationDelta_KeyDown(KeyCode As Integer, Shift As Integer)
- If StillGoing Then
- cmdStart.SetFocus
- End If
- End Sub
-