cs_ITALIA
Messages postés
2169
Date d'inscription
vendredi 20 avril 2001
Statut
Membre
Dernière intervention
30 juin 2009
9
13 juil. 2004 à 13:47
Option Explicit
Dim X0 As Integer, Y0 As Integer ' centre de l'écran
Dim e As Single ' échelle
Dim t As Single, p As Single
Dim ct As Single ' COS t
Dim st As Single ' SIN t
Dim cp As Single ' COS p
Dim sp As Single ' SIN p
Dim x(1 To 8) As Single, y(1 To 8) As Single ' 8 sommet du cube
Const PI As Single = 3.141559
Private Sub Form_Load()
X0 = Qbe.ScaleWidth / 2
Y0 = Qbe.ScaleHeight / 2
e = Qbe.ScaleWidth / 5
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, Xx As Single, Yy As Single)
t = (Xx - X0) / X0 * PI
p = (Yy - Y0) / Y0 * PI
ct = Cos(t)
st = Sin(t)
cp = Cos(p)
sp = Sin(p)
x(1) = X0 + e * (st * cp + ct + st * sp)
x(2) = X0 + e * (st * cp + ct - st * sp)
x(3) = X0 + e * (st * cp - ct + st * sp)
x(4) = X0 + e * (st * cp - ct - st * sp)
x(5) = X0 + e * (-st * cp + ct + st * sp)
x(6) = X0 + e * (-st * cp + ct - st * sp)
x(7) = X0 + e * (-st * cp - ct + st * sp)
x(8) = X0 + e * (-st * cp - ct - st * sp)
y(1) = Y0 + e * (-sp + cp)
y(2) = Y0 + e * (-sp - cp)
y(3) = Y0 + e * (-sp + cp)
y(4) = Y0 + e * (-sp - cp)
y(5) = Y0 + e * (sp + cp)
y(6) = Y0 + e * (sp - cp)
y(7) = Y0 + e * (sp + cp)
y(8) = Y0 + e * (sp - cp)
Cls
Line (x(1), y(1))-(x(2), y(2))
Line (x(1), y(1))-(x(3), y(3))
Line (x(1), y(1))-(x(5), y(5))
Line (x(2), y(2))-(x(4), y(4))
Line (x(2), y(2))-(x(6), y(6))
Line (x(3), y(3))-(x(4), y(4))
Line (x(3), y(3))-(x(7), y(7))
Line (x(4), y(4))-(x(8), y(8))
Line (x(5), y(5))-(x(6), y(6))
Line (x(5), y(5))-(x(7), y(7))
Line (x(6), y(6))-(x(8), y(8))
Line (x(7), y(7))-(x(8), y(8))
End Sub
ca te va ??
It@li@