PDA

View Full Version : Smoothing



peter
26-02-2014, 13:51
Hi,

smoothing is a nice effect, without smoothing everything is not so nice.

example: smoothing, xrays-coloured


Uses "ui"
#INCLUDE "gdip.inc"

OpenWindow 640, 480
Randomize

Long x, y

SetSmoothMode 2
While IsWindow(hwnd) And GetAsyncKeyState(27)=0
ClsColor &HFF000000
For y=0 To Height Step 20
For x=0 To Width Step 20
DrawLine x,y,240,69,1,ARGB 255,Rnd(64,255),Rnd(64,255),Rnd(64,255)
Next
Next
Canvas_Redraw
Sleep 10
Wend
ShutDown
Canvas_Window End hwnd

peter
26-02-2014, 13:52
cone3D.


Uses "ui","math"
#INCLUDE "gdip.inc"
OpenWindow 400, 400

Single x, y, h
Long alpha, beta

Long ox = Width /2
Long oy = Height/2

SetSmoothMode 2
While IsWindow(hwnd) And GetAsyncKeyState(27)=0
ClsColor &HFFFFFFFF
For alpha=0 To 360 Step 8
x = 100*Cos(DegToRad(alpha))
y = Sin(DegToRad(alpha))*Sin(DegToRad(beta)) * 80
h = 100*Cos(DegToRad(beta))
DrawLine ox,oy,ox+x, oy-(y-h),2, ARGB( 255,40,Rnd(32,255),Rnd(32,255) )
Next
Canvas_Redraw
Sleep 10
beta +=2
Wend
Canvas_Window End