Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Weird Effect with Drawfillpolygon
Index -> Programming, Turing -> Turing Submissions
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Paul




PostPosted: 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! Laughing 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 Laughing
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, maxx-100)
randint (y(a), 100, maxy-100)
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
Sponsor
sponsor
rhomer




PostPosted: 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




PostPosted: Wed Jun 02, 2004 12:15 pm   Post subject: (No subject)

it looks even sweeter when you use
code:

incx(a):=Rand.Int(-5,5)
incy(a):=Rand.Int(-5,5)

instead Wink
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Paul




PostPosted: 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, maxx-100)
randint (y(a), 100, maxy-100)
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




PostPosted: 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




PostPosted: 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




PostPosted: 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.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 7 Posts ]
Jump to:   


Style:  
Search: