peter
02-03-2014, 19:22
Hello,
Pyramide without texture.
Uses "ui","math"
#INCLUDE "gdip.inc"
OpenWindow 400, 360
SetSmoothMode 2
Long ox=200
Long oy=180
Long t=100
Long beta=30
Long alpha, ax, ay, bx, by, cx, cy, dx, dy
While IsWindow(hwnd) And KeyDown(27)=0
ClsColor ARGB(255,255,245,240)
ax = t*Cos(DegToRad(alpha))
ay = Sin(DegToRad(beta)) * t * Sin(DegToRad(alpha))
bx = Mod(t*Cos(DegToRad((alpha + 90))),360)
by = Mod(Sin(DegToRad(beta)) * t*Sin(DegToRad((alpha+90))),360)
cx = Mod(t*Cos(DegToRad((alpha + 180))),360)
cy = Mod(Sin(DegToRad(beta)) * t*Sin(DegToRad((alpha+180))),360)
dx = Mod(t*Cos(DegToRad((alpha + 270))),360)
dy = Mod(Sin(DegToRad(beta)) * t * Sin(DegToRad((alpha + 270))),360)
DrawLine(ox, oy-120, ox+ax, oy-ay,2,&HFF000000)
DrawLine(ox, oy-120, ox+bx, oy-by,2,&HFF000000)
DrawLine(ox, oy-120, ox+cx, oy-cy,2,&HFF000000)
DrawLine(ox, oy-120, ox+dx, oy-dy,2,&HFF000000)
DrawLine(ox+ax,oy-ay,ox+bx, oy-by,2,&HFF000000)
DrawLine(ox+bx,oy-by,ox+cx, oy-cy,2,&HFF000000)
DrawLine(ox+cx,oy-cy,ox+dx, oy-dy,2,&HFF000000)
DrawLine(ox+dx,oy-dy,ox+ax, oy-ay,2,&HFF000000)
Canvas_Redraw
Sleep 10
alpha +=1
Wend
Canvas_Window End
Pyramide without texture.
Uses "ui","math"
#INCLUDE "gdip.inc"
OpenWindow 400, 360
SetSmoothMode 2
Long ox=200
Long oy=180
Long t=100
Long beta=30
Long alpha, ax, ay, bx, by, cx, cy, dx, dy
While IsWindow(hwnd) And KeyDown(27)=0
ClsColor ARGB(255,255,245,240)
ax = t*Cos(DegToRad(alpha))
ay = Sin(DegToRad(beta)) * t * Sin(DegToRad(alpha))
bx = Mod(t*Cos(DegToRad((alpha + 90))),360)
by = Mod(Sin(DegToRad(beta)) * t*Sin(DegToRad((alpha+90))),360)
cx = Mod(t*Cos(DegToRad((alpha + 180))),360)
cy = Mod(Sin(DegToRad(beta)) * t*Sin(DegToRad((alpha+180))),360)
dx = Mod(t*Cos(DegToRad((alpha + 270))),360)
dy = Mod(Sin(DegToRad(beta)) * t * Sin(DegToRad((alpha + 270))),360)
DrawLine(ox, oy-120, ox+ax, oy-ay,2,&HFF000000)
DrawLine(ox, oy-120, ox+bx, oy-by,2,&HFF000000)
DrawLine(ox, oy-120, ox+cx, oy-cy,2,&HFF000000)
DrawLine(ox, oy-120, ox+dx, oy-dy,2,&HFF000000)
DrawLine(ox+ax,oy-ay,ox+bx, oy-by,2,&HFF000000)
DrawLine(ox+bx,oy-by,ox+cx, oy-cy,2,&HFF000000)
DrawLine(ox+cx,oy-cy,ox+dx, oy-dy,2,&HFF000000)
DrawLine(ox+dx,oy-dy,ox+ax, oy-ay,2,&HFF000000)
Canvas_Redraw
Sleep 10
alpha +=1
Wend
Canvas_Window End