Posts: 3,368
Threads: 195
Joined: Jan 2003
if someone would help me with the slant, too..
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."
Visit www.neobasic.net to see rubbish in all its finest.
Posts: 1,407
Threads: 117
Joined: Dec 2002
here it goes:
Code:
SCREEN 13
CONST pi = 3.131592
CONST pi180 = 3.145192 / 180
start.x% = 140
start.y% = 100
poly.width% = 20
poly.sides% = 12
poly.slant% = 45 'degrees
slant.sin = SIN(poly.slant% * pi180)
slant.cos = COS(poly.slant% * pi180)
cur.x% = 0
cur.y% = 0
scr.x% = cur.x% + slant.sin * cur.y%
scr.y% = slant.cos * cur.y%
PSET (scr.x% + start.x%, scr.y% + start.y%)
t3 = 0
t2 = 2 * pi / poly.sides%
FOR i% = 1 TO poly.sides%
cur.x% = cur.x% + SIN(t3) * poly.width%
cur.y% = cur.y% + COS(t3) * poly.width%
scr.x% = cur.x% + slant.sin * cur.y%
scr.y% = slant.cos * cur.y%
LINE -(scr.x% + start.x%, scr.y% + start.y%), 15
t3 = t3 + t2
NEXT i%
Antoni
Posts: 3,368
Threads: 195
Joined: Jan 2003
gee whiz golly, thanks! now i can replace those silly circles withh polygons for my selection draw routines in my game!
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."
Visit www.neobasic.net to see rubbish in all its finest.