, Visual C#


- 12


' "":

Dim sw_2 As StreamWriter = _

New StreamWriter("D:\MyDocs\MyTest3D_Graphics_2.txt")

' myArrayVB_2(i, j) -

' WriteLine:

For i = 0 To N_x_2

For j = 0 To N_y_2

sw_2.WriteLine(myArrayVB_2(i, j))

Next

Next

sw_2.Close()

' g pen:

g.Dispose() : pen.Dispose()

M_End:

' DrawSolid

' ,

' N_Graphics 1:

N_Graphics = N_Graphics + 1

End Sub

 

' :

Public Sub MatrixIdentity(ByRef M(,) As Single)

Dim i As Integer : Dim j As Integer

For i = 1 To 4

For j = 1 To 4

If i = j Then

M(i, j) = 1

Else

M(i, j) = 0

End If

Next

Next

End Sub

' (3-D transformation matrix)

' z x,y

' ()

' c (0, 0, Distance):

Public Sub MatrixPerspectiveXZ(ByRef M(,) As Single, _

ByVal Distance As Single)

MatrixIdentity(M)

If Distance <> 0 Then M(3, 4) = -1 / Distance

End Sub

' (3-D transformation matrix)

' :

' (cx, cy, cz),

' (fx, fy, fx),

' UP <ux, yx, uz>,

' (type_of_projection):

'PerspectiveProjection ParallelProjection:

Public Sub MatrixTransformation(ByRef M(,) As Single, _

ByVal type_of_projection As Integer, _