Weird Effect with Drawfillpolygon
Author 
Message 
Paul

Posted: Tue Jun 01, 2004 9:10 pm Post subject: Weird Effect with Drawfillpolygon 


Hm... believe it or not, I just learned the command drawfillpolygon today! I messed with it, and here's what I got, try entering 100 to see the effect I mean. Smaller numbers aren't that outstanding
Note: try using numbers like 50, 100 or 200 or 300, but 500 will probably end up crashing ur environment.
recommended over 25 though lol
I think it gives it an almost 3D look, but more like glassy transparent.
code: 
setscreen ("graphics: max;max;offscreenonly")
var number: int
put "How many sides?"
get number
colorback (black)
cls
var x : array 1 .. number of int
var y : array 1 .. number of int
var incx: array 1..number of int
var incy: array 1..number of int
for a: 1..number
randint (x(a), 100, maxx100)
randint (y(a), 100, maxy100)
incx(a):=3
incy(a):=3
end for
loop
for a: 1..number
x(a)+=incx(a)
y(a)+=incy(a)
end for
drawfillpolygon (x, y, number, 12)
View.Update
cls
for a: 1..number
if y(a)>=maxy or y(a) <= 0 then
incy(a):=incy(a)
end if
if x(a)<=0 or x(a)>=maxx then
incx(a):=incx(a)
end if
end for
end loop







Sponsor Sponsor



rhomer

Posted: Wed Jun 02, 2004 9:57 am Post subject: (No subject) 


That's pretty sweet, especially when you put a number in the low hundreds...






Tony





Paul

Posted: Wed Jun 02, 2004 1:06 pm Post subject: (No subject) 


for those of you who don't know:
code: 
setscreen ("graphics: max;max;offscreenonly")
var number: int
put "How many sides?"
get number
colorback (black)
cls
var x : array 1 .. number of int
var y : array 1 .. number of int
var incx: array 1..number of int
var incy: array 1..number of int
for a: 1..number
randint (x(a), 100, maxx100)
randint (y(a), 100, maxy100)
incx(a):=Rand.Int(5,5)
incy(a):=Rand.Int(5,5)
end for
loop
for a: 1..number
x(a)+=incx(a)
y(a)+=incy(a)
end for
drawfillpolygon (x, y, number, 12)
View.Update
cls
for a: 1..number
if y(a)>=maxy or y(a) <= 0 then
incy(a):=incy(a)
end if
if x(a)<=0 or x(a)>=maxx then
incx(a):=incx(a)
end if
end for
end loop







we64

Posted: Wed Jun 02, 2004 7:44 pm Post subject: (No subject) 


I don't see any difference.... it is pretty cool for either one... looks 3D...






SuperGenius

Posted: Thu Jun 03, 2004 4:03 pm Post subject: (No subject) 


very interesting... I wish that our class had learned drawfill polygon.... anyways i was able to get 499 without crashing. I almost had a seizure though.






Paul

Posted: Thu Jun 03, 2004 4:22 pm Post subject: (No subject) 


well shantz skipped it during graphics because we didn't know arrays... then I just remebered it existed when someone asked for a triangle.







