home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form OrthForm
- Appearance = 0 'Flat
- AutoRedraw = -1 'True
- BackColor = &H00C0C0C0&
- Caption = "Orthographic Projections"
- ClientHeight = 5895
- ClientLeft = 2100
- ClientTop = 810
- ClientWidth = 4530
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 1
- weight = 700
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- ForeColor = &H80000008&
- Height = 6585
- Left = 2040
- LinkTopic = "Form1"
- ScaleHeight = 5895
- ScaleWidth = 4530
- Top = 180
- Width = 4650
- Begin VB.PictureBox Pict
- AutoRedraw = -1 'True
- Height = 1935
- Index = 3
- Left = 1965
- ScaleHeight = -5.639
- ScaleLeft = -4
- ScaleMode = 0 'User
- ScaleTop = 4
- ScaleWidth = 5.639
- TabIndex = 3
- Top = 1965
- Width = 1935
- End
- Begin VB.PictureBox Pict
- AutoRedraw = -1 'True
- Height = 1935
- Index = 2
- Left = 0
- ScaleHeight = -5.639
- ScaleLeft = -2
- ScaleMode = 0 'User
- ScaleTop = 4
- ScaleWidth = 5.639
- TabIndex = 2
- Top = 3930
- Width = 1935
- End
- Begin VB.PictureBox Pict
- AutoRedraw = -1 'True
- Height = 1935
- Index = 1
- Left = 0
- ScaleHeight = -5.639
- ScaleLeft = -2
- ScaleMode = 0 'User
- ScaleTop = 2
- ScaleWidth = 5.639
- TabIndex = 1
- Top = 0
- Width = 1935
- End
- Begin VB.PictureBox Pict
- AutoRedraw = -1 'True
- Height = 1935
- Index = 0
- Left = 0
- ScaleHeight = -4
- ScaleLeft = -1.5
- ScaleMode = 0 'User
- ScaleTop = 2.5
- ScaleWidth = 4
- TabIndex = 0
- Top = 1965
- Width = 1935
- End
- Begin VB.Label Label1
- Caption = "Side"
- Height = 255
- Index = 3
- Left = 3960
- TabIndex = 6
- Top = 2760
- Width = 615
- End
- Begin VB.Label Label1
- Caption = "Front"
- Height = 255
- Index = 1
- Left = 2040
- TabIndex = 5
- Top = 4800
- Width = 735
- End
- Begin VB.Label Label1
- Caption = "Top"
- Height = 255
- Index = 0
- Left = 2040
- TabIndex = 4
- Top = 720
- Width = 615
- End
- Begin VB.Menu mnuFile
- Caption = "&File"
- Begin VB.Menu mnuFileExit
- Caption = "E&xit"
- End
- End
- Attribute VB_Name = "OrthForm"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- Option Explicit
- ' Location of viewing eye.
- Dim EyeR As Single
- Dim EyeTheta As Single
- Dim EyePhi As Single
- ' Location of focus point.
- Const FocusX = 0#
- Const FocusY = 0#
- Const FocusZ = 0#
- Dim Projector(1 To 4, 1 To 4) As Single
- Private Sub Form_Load()
- Dim M(1 To 4, 1 To 4) As Single
- ' Initialize the eye position.
- EyeR = 3
- EyeTheta = PI * 0.37
- EyePhi = PI * 0.1
- ' Create the data.
- CreateData
- ' Create the projection matrix.
- m3PProject Projector, m3Perspective, EyeR, EyePhi, EyeTheta, FocusX, FocusY, FocusZ, 0, 1, 0
- ' Draw the data.
- TransformAllData Projector
- DrawAllData Pict(0), ForeColor, True
- m3OrthoTop M
- TransformAllData M
- DrawAllData Pict(1), ForeColor, True
- m3OrthoFront M
- TransformAllData M
- DrawAllData Pict(2), ForeColor, True
- m3OrthoSide M
- TransformAllData M
- DrawAllData Pict(3), ForeColor, True
- End Sub
- ' ***********************************************
- ' Create the object to display.
- ' ***********************************************
- Sub CreateData()
- ' MakeSegment 0, 0, 0, 2, 0, 0 ' Hidden.
- MakeSegment 2, 0, 0, 2, 1, 0
- MakeSegment 2, 1, 0, 1, 1, 0
- MakeSegment 1, 1, 0, 1, 2, 0
- MakeSegment 1, 2, 0, 0, 2, 0
- ' MakeSegment 0, 0, 0, 0, 0, 2 ' Hidden.
- MakeSegment 0, 0, 2, 0, 1, 2
- MakeSegment 0, 1, 2, 0, 1, 1
- MakeSegment 0, 1, 1, 0, 2, 1
- MakeSegment 0, 2, 1, 0, 2, 0
- ' MakeSegment 0, 0, 0, 2, 0, 0 ' Hidden.
- MakeSegment 2, 0, 0, 2, 0, 1
- MakeSegment 2, 0, 1, 1, 0, 1
- MakeSegment 1, 0, 1, 1, 0, 2
- MakeSegment 1, 0, 2, 0, 0, 2
- MakeSegment 0, 1, 1, 2, 1, 1
- MakeSegment 1, 0, 1, 1, 2, 1
- MakeSegment 1, 1, 0, 1, 1, 2
- MakeSegment 2, 1, 0, 2, 1, 1
- MakeSegment 2, 1, 1, 2, 0, 1
- MakeSegment 0, 2, 1, 1, 2, 1
- MakeSegment 1, 2, 1, 1, 2, 0
- MakeSegment 0, 1, 2, 1, 1, 2
- MakeSegment 1, 1, 2, 1, 0, 2
- End Sub
- Private Sub mnuFileExit_Click()
- Unload Me
- End Sub
-