Graphics 800,600 SetBlend alphablend SetAlpha 0.3 SetOrigin 400,300 Global z:Float = 1.0 Global dz:Float = 0.2 While Not AppTerminate() Cls Global x2:Float = 0.0 Global y2:Float = 0.0 Global y:Float = 0.0 DrawLine -2, 0, 2, 0 DrawLine 0 , - 2 , 0 , 2 SetScale z,z For Local x:Float = -100.0 To 100.0 Step 1.0 y =( x ^ 2.0 )/ 5.0 'SetScale 50.0 , 50.0 SetColor 255 , 0 , 0 DrawOval x*z - 2*z , y*z - 2*z ,4 , 4 SetColor 0, 255, 0 DrawOval x2*z - 1.0*z , y2*z - 1.0*z , 2 , 2 SetColor 255,255,255 DrawLine x , y , x2 , y2 x2 = x y2 = y Next Flip If z > 40.0 Then dz:* - 1 Else If z < 1.0 Then dz:* - 1 EndIf z:+dz Wend
Try this at scale 1,1 it draws a nice curve from line segments and green circles on the start point and red on the end points.
But once the scale goes up instead of zooming in on the line and circles, the circles and lines drift off.
What am I doing wrong?