Computer Science Canada Polygon per-pixel control |
Author: | RaPsCaLLioN [ Tue Mar 29, 2005 11:44 am ] |
Post subject: | Polygon per-pixel control |
Might not look that impressive but OMG it was hard. Every time u run it generates a new random polygon. Each polygon is broken down to the pixel. And to prove; I randomly genearted a colour (1, 10) for display and added a delay so you can see each pixel drawn. I did this in 137 lines. It's not 100%. You'll occasionally see a break in the middle but I'll have that fixed soon. I'm this much closer now to true texture mapping. |
Author: | jamonathin [ Tue Mar 29, 2005 2:33 pm ] |
Post subject: | |
Pretty neat program. I know it would take away from the cool color effects but drawing lines would be faster, other than that, gj ![]() |
Author: | Flikerator [ Tue Mar 29, 2005 3:10 pm ] |
Post subject: | |
I would comment on it but I don't have anything to open .rar files :/[/code] |
Author: | [Gandalf] [ Tue Mar 29, 2005 5:15 pm ] |
Post subject: | |
Pretty cool, I can see how it took some time ![]() To open .rar files get WinRar - almost exactly the same as WinZip, WinAce. |
Author: | jamonathin [ Tue Mar 29, 2005 5:15 pm ] |
Post subject: | |
WinRar. Look it up on google or somthing or go to http://www.download.com/WinRAR/3000-2250_4-10350955.html?tag=lst-0-1 |
Author: | Mr. T [ Tue Mar 29, 2005 6:03 pm ] |
Post subject: | |
too lazy ![]() |
Author: | Mazer [ Tue Mar 29, 2005 6:27 pm ] |
Post subject: | |
It is an exe. And as it was compiled for Turing, it's a very big exe. rar is a very common compression format for Windows (and oh hey, you can get it for Linux as well) so if you can't be bothered to use it I don't know what you're doing. |
Author: | RaPsCaLLioN [ Tue Mar 29, 2005 6:32 pm ] |
Post subject: | |
There ya go. Added .ZIP |
Author: | GlobeTrotter [ Tue Mar 29, 2005 7:52 pm ] |
Post subject: | |
How fast is it w/o the delay? |
Author: | RaPsCaLLioN [ Tue Mar 29, 2005 8:14 pm ] |
Post subject: | |
I just updated it. Click mouse to refresh. I took out the delay so... well for me it's as fast as I can click. Also no more errors (white lines). Try it out again. |
Author: | Naveg [ Wed Mar 30, 2005 12:12 am ] |
Post subject: | |
thats pretty cool, wonder what kind of awesome stuff can be done with that |
Author: | GlobeTrotter [ Wed Mar 30, 2005 5:22 pm ] | ||
Post subject: | |||
I tried to code it, to see if I could, and I managed to get a very similar effect. The only real difference between mine and yours is that mine is a lot slower, even without a delay. Could you maybe post your source so I can compare?
|
Author: | RaPsCaLLioN [ Wed Mar 30, 2005 10:37 pm ] |
Post subject: | |
I'd rather not post source just yet. But... mine does not use any 'if' statements contained in loops. Nor does it use any multiplication and only 6 divides per polygon. The only thing is my method is not self-contained. The two procedures that I used are both relying on an outside array. I need to fix this before I can progress. Could you please explain what the 3 functions you created are calculating? |
Author: | GlobeTrotter [ Wed Mar 30, 2005 11:40 pm ] |
Post subject: | |
The first two are pretty useless. They just give the max or the min of three inputted numbers since turing's min function and max function only work w/ two numbers. I basically do a for statement, checking every pixel in a box around the triangle, to see if that pixel is inside the triangle. It is kind of inefficient. The third function is to calculate the area of a triangle, given three points. By checking if the sum of the three triangles formed between the given pixel, and the corners, adds up to the area of the triangle, I can know if the pixel is indside the triangle. If it is, it draws the pixel. |
Author: | zylum [ Fri Apr 01, 2005 9:24 pm ] | ||
Post subject: | |||
here's my attempt.. pretty fast, i think its the same way RaPsCaLLioN did his...
-57 lines and sometimes it draws a couple of polygons in a single mouse click (yes that fast). although some of the larger ones take a bit more time. |
Author: | RaPsCaLLioN [ Fri Apr 01, 2005 9:36 pm ] | ||
Post subject: | |||
That is pretty fast. Mine's a tad quicker because your running 11 divides per polygon. And if you do this to your code...
We can see some flaws. |
Author: | Drakain Zeil [ Wed Apr 06, 2005 6:14 am ] |
Post subject: | |
Polygon resources. http://claymore.engineer.gvsu.edu/~jackh/eod/software/software-108.html http://www.math.montana.edu/Rweb/Rhelp/polygon.html |
: |