Üye Kayıt Üye Giriş

Üç Boyutlu Çizim Yapmak


 Üç Boyutlu Çizim Yapmak


Private Sub DrawPart()
R = HScroll2.Value
X = HScroll1.Value
Y = VScroll1.Value

Angle1 = DTOR(R)
Angle2 = DTOR(Y)
Angle3 = DTOR(X)
Text1.Text = "A1= " & Format(X, "0.00000")
Text2.Text = "A2= " & Format(Y, "0.00000")
Text3.Text = "R1= " & Format(R, "0.00000")

Pic1.Cls

d1x = -20: d1y = -20: d1z = 20
d2x = -20: d2y = 20: d2z = 20
d3x = 20: d3y = 20: d3z = 20
d4x = 20: d4y = -20: d4z = 20
d5x = -40: d5y = -40: d5z = -40
d6x = -40: d6y = 40: d6z = -40
d7x = 40: d7y = 40: d7z = -40
d8x = 40: d8y = -40: d8z = -40


XROT = (d1x * Cos(Angle1)) - (d1y * Sin(Angle1))
YROT = (d1x * Sin(Angle1)) + (d1y * Cos(Angle1))
ZROT = d1z
XROT1 = XROT
YROT1 = (YROT * Cos(Angle2)) - (ZROT * Sin(Angle2))
ZROT1 = (YROT * Sin(Angle2)) + (ZROT * Cos(Angle2))
p1x = (XROT1 * Cos(Angle3)) - (ZROT1 * Sin(Angle3))
p1y = YROT1
p1z = (XROT1 * Sin(Angle3)) + (ZROT1 * Cos(Angle3))


XROT = (d2x * Cos(Angle1)) - (d2y * Sin(Angle1))
YROT = (d2x * Sin(Angle1)) + (d2y * Cos(Angle1))
ZROT = d2z
XROT1 = XROT
YROT1 = (YROT * Cos(Angle2)) - (ZROT * Sin(Angle2))
ZROT1 = (YROT * Sin(Angle2)) + (ZROT * Cos(Angle2))
p2x = (XROT1 * Cos(Angle3)) - (ZROT1 * Sin(Angle3))
p2y = YROT1
p2z = (XROT1 * Sin(Angle3)) + (ZROT1 * Cos(Angle3))

XROT = (d3x * Cos(Angle1)) - (d3y * Sin(Angle1))
YROT = (d3x * Sin(Angle1)) + (d3y * Cos(Angle1))
ZROT = d3z
XROT1 = XROT
YROT1 = (YROT * Cos(Angle2)) - (ZROT * Sin(Angle2))
ZROT1 = (YROT * Sin(Angle2)) + (ZROT * Cos(Angle2))
p3x = (XROT1 * Cos(Angle3)) - (ZROT1 * Sin(Angle3))
p3y = YROT1
p3z = (XROT1 * Sin(Angle3)) + (ZROT1 * Cos(Angle3))

XROT = (d4x * Cos(Angle1)) - (d4y * Sin(Angle1))
YROT = (d4x * Sin(Angle1)) + (d4y * Cos(Angle1))
ZROT = d4z
XROT1 = XROT
YROT1 = (YROT * Cos(Angle2)) - (ZROT * Sin(Angle2))
ZROT1 = (YROT * Sin(Angle2)) + (ZROT * Cos(Angle2))
p4x = (XROT1 * Cos(Angle3)) - (ZROT1 * Sin(Angle3))
p4y = YROT1
p4z = (XROT1 * Sin(Angle3)) + (ZROT1 * Cos(Angle3))

XROT = (d5x * Cos(Angle1)) - (d5y * Sin(Angle1))
YROT = (d5x * Sin(Angle1)) + (d5y * Cos(Angle1))
ZROT = d5z
XROT1 = XROT
YROT1 = (YROT * Cos(Angle2)) - (ZROT * Sin(Angle2))
ZROT1 = (YROT * Sin(Angle2)) + (ZROT * Cos(Angle2))
p5x = (XROT1 * Cos(Angle3)) - (ZROT1 * Sin(Angle3))
p5y = YROT1
p5z = (XROT1 * Sin(Angle3)) + (ZROT1 * Cos(Angle3))

XROT = (d6x * Cos(Angle1)) - (d6y * Sin(Angle1))
YROT = (d6x * Sin(Angle1)) + (d6y * Cos(Angle1))
ZROT = d6z
XROT1 = XROT
YROT1 = (YROT * Cos(Angle2)) - (ZROT * Sin(Angle2))
ZROT1 = (YROT * Sin(Angle2)) + (ZROT * Cos(Angle2))
p6x = (XROT1 * Cos(Angle3)) - (ZROT1 * Sin(Angle3))
p6y = YROT1
p6z = (XROT1 * Sin(Angle3)) + (ZROT1 * Cos(Angle3))

XROT = (d7x * Cos(Angle1)) - (d7y * Sin(Angle1))
YROT = (d7x * Sin(Angle1)) + (d7y * Cos(Angle1))
ZROT = d7z
XROT1 = XROT
YROT1 = (YROT * Cos(Angle2)) - (ZROT * Sin(Angle2))
ZROT1 = (YROT * Sin(Angle2)) + (ZROT * Cos(Angle2))
p7x = (XROT1 * Cos(Angle3)) - (ZROT1 * Sin(Angle3))
p7y = YROT1
p7z = (XROT1 * Sin(Angle3)) + (ZROT1 * Cos(Angle3))

XROT = (d8x * Cos(Angle1)) - (d8y * Sin(Angle1))
YROT = (d8x * Sin(Angle1)) + (d8y * Cos(Angle1))
ZROT = d8z
XROT1 = XROT
YROT1 = (YROT * Cos(Angle2)) - (ZROT * Sin(Angle2))
ZROT1 = (YROT * Sin(Angle2)) + (ZROT * Cos(Angle2))
p8x = (XROT1 * Cos(Angle3)) - (ZROT1 * Sin(Angle3))
p8y = YROT1
p8z = (XROT1 * Sin(Angle3)) + (ZROT1 * Cos(Angle3))


Pic1.Line (p1x, p1y)-(p2x, p2y), RGB(255, 0, 0)
Pic1.Line (p2x, p2y)-(p3x, p3y), RGB(255, 0, 0)
Pic1.Line (p3x, p3y)-(p4x, p4y), RGB(255, 0, 0)
Pic1.Line (p4x, p4y)-(p1x, p1y), RGB(255, 0, 0)

Pic1.Line (p5x, p5y)-(p6x, p6y), RGB(0, 255, 0)
Pic1.Line (p6x, p6y)-(p7x, p7y), RGB(0, 255, 0)
Pic1.Line (p7x, p7y)-(p8x, p8y), RGB(0, 255, 0)
Pic1.Line (p8x, p8y)-(p5x, p5y), RGB(0, 255, 0)

Pic1.Line (p1x, p1y)-(p5x, p5y), RGB(0, 0, 255)
Pic1.Line (p2x, p2y)-(p6x, p6y), RGB(0, 0, 255)
Pic1.Line (p3x, p3y)-(p7x, p7y), RGB(0, 0, 255)
Pic1.Line (p4x, p4y)-(p8x, p8y), RGB(0, 0, 255)

Pic1.Line (p1x, p1y)-(0, 0), RGB(255, 0, 0)
Pic1.Line (p2x, p2y)-(0, 0), RGB(255, 0, 0)
Pic1.Line (p3x, p3y)-(0, 0), RGB(255, 0, 0)
Pic1.Line (p4x, p4y)-(0, 0), RGB(255, 0, 0)
Pic1.Line (p5x, p5y)-(0, 0), RGB(0, 255, 0)
Pic1.Line (p6x, p6y)-(0, 0), RGB(0, 255, 0)
Pic1.Line (p7x, p7y)-(0, 0), RGB(0, 255, 0)
Pic1.Line (p8x, p8y)-(0, 0), RGB(0, 255, 0)

Pic1.Line (0, 0)-(X, Y)

DoEvents

End Sub

Private Function DTOR(X)
DTOR = X * (3.1415 / 180)
End Function

Private Sub HScroll1_Change()
DrawPart
End Sub

Private Sub HScroll1_Scroll()
DrawPart
End Sub


Private Sub HScroll2_Change()
DrawPart
End Sub

Private Sub HScroll2_Scroll()
DrawPart
End Sub


Private Sub Pic1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
If X > 90 Then X = 90
If X < -90 Then X = -90
If Y > 90 Then Y = 90
If Y < -90 Then Y = -90
HScroll1.Value = X
VScroll1.Value = Y
End If
If Button = 2 Then
If X > 90 Then X = 90
If X < -90 Then X = -90
HScroll2.Value = X
End If
End Sub

Private Sub VScroll1_Change()
DrawPart
End Sub

Private Sub VScroll1_Scroll()
DrawPart
End Sub

Bilgisayar Dershanesi Ders Sahibi;
Bilgisayar Dershanesi

Yorumlar

Yorum Yapabilmek İçin Üye Girişi Yapmanız Gerekmektedir.

ETİKETLER