I'm trying to draw the outline of a square--a vector graphics square in other words--scaled and rotated around its center point. This is easy to do with DrawPoly, except it results in a filled polygon, not an outline.
It seems so easy, with SetOrigin, SetScale, and SetRotation, but I end up with each line rotated around its start point, not the entire square rotated. Here's my code:
(BTW, I may be a beginner with BlitzMax, but I'm comfortable writing this sort of code in OpenGL.)
It seems so easy, with SetOrigin, SetScale, and SetRotation, but I end up with each line rotated around its start point, not the entire square rotated. Here's my code:
Graphics 1280,1024,32,60 HideMouse While Not KeyHit(KEY_ESCAPE) Cls SetColor 255,255,0 SetOrigin 1280/2,1024/2 SetRotation 0 SetScale 1,1 DrawLine -64,-64,64,-64 DrawLine 64,-64,64,64 DrawLine 64,64,-64,64 DrawLine -64,64,-64,-64 Flip WendThis looks fine, until you change SetRotation to something other than zero (10, for example). Then it's obvious that each line is rotated around its start point.
(BTW, I may be a beginner with BlitzMax, but I'm comfortable writing this sort of code in OpenGL.)