Hi all,
I'm having trouble grasping these two commands. Can someone explain to me how they work?
I've been trying to create a rotating triangle, but after rotation the lines are not drawn correctly. Note: I want to be able to draw the triangle where ever i want.
I'm having trouble grasping these two commands. Can someone explain to me how they work?
I've been trying to create a rotating triangle, but after rotation the lines are not drawn correctly. Note: I want to be able to draw the triangle where ever i want.
Strict Graphics 640,480,0 Local a:tObject = New tObject ListAddLast a.sourcelines, tLine.Create( 200,200,100,100 ) ListAddLast a.sourcelines, tLine.Create( 100,100,300,100 ) ListAddLast a.sourcelines, tLine.Create( 300,100,200,200 ) a.Draw() Flip WaitKey() End Type tObject Field sourcelines:tList Field angle:Float Field scale:Float Method New() sourcelines = CreateList() End Method Method Draw() SetOrigin 100,100 SetScale 1,1 SetRotation 45 ' SetHandle 100,100 For Local l:tLine = EachIn sourcelines DrawLine l.x1,l.y1, l.x2,l.y2 Next End Method End Type Type tLine Field x1:Float, y1:Float Field x2:Float, y2:Float Function Create:tLine( x1:Float,y1:Float, x2:Float,y2:Float ) Local l:tLine = New tLine l.x1 = x1 l.x2 = x2 l.y1 = y1 l.y2 = y2 Return l End Function End Type