| |
Cybernator
Registered: Jun 2002 Posts: 154 |
STr34kZ (aka. EOR lines)
Streaks, not freaks. :)
Does anyone have any idea how to _completely_ avoid the streaks in EOR fillers. SLJ in his tutorial mentioned that ---*--- intersections will fail. I wanted a complete 3D scene to be EOR filled at once. After some experimenting I came up with a technique to handle obscured objects, objects partially or wholly on the top of another, and it works ok (as long as the filling of a single object is successful). Pick up yer jaws, this doesn't work at realtime. :) Because of this, implementing of an algorithm to handle these intersections will not be a trouble, but I can't think of anything.
Lines are drawn from left to right and the last pixel is not drawn for horizontal lines (where dx>dy). For vertical lines, I don't draw the endpoints, and I only draw the last pixel of each vertical chunk (the way SLJ's routine works).
One interesting thing with the object where this happens is that if you watch it from the other side, there're no streaks.
Check out: http://www.geocities.com/lazeristoski/eor.zip
Use left/right arrows to change frames, F to toggle filling.
Btw, clipping against the upper border is handled as well, though you won't see that from the animations I have included.
Ah yes, make sure you have DirectX 7 or later installed. :P
(addon: just drag one of the .eor files onto the Exorizer.exe)
|
|
... 19 posts hidden. Click here to view all posts.... |
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
my filledvectors use a routine which eliminates lines that 'normally' would be drawn more than once... simply checks which lines would be drawn more than once, and precalculates what the resulting color would be after that, and then only one line is drawn in the resulting color.. or no line if the color would be the bitpair 00. Guess other coders routines does this too ? |
| |
Krill
Registered: Apr 2002 Posts: 2980 |
yes, i do that as well. |
| |
Graham Account closed
Registered: Dec 2002 Posts: 990 |
in my routines there is no such things as "lines drawn more than once" so i do not have to eliminate them. |
| |
Cruzer
Registered: Dec 2001 Posts: 1048 |
oldest trick in the book ;) |
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
graham ?! how do you do that ? |
| |
JackAsser
Registered: Jun 2002 Posts: 2014 |
1. Perform backface removal.
2. Set all edge colors to 0.
3. For each face take face-color and eor the color with the color of each corresponding edge.
4. Draw all the edges using EOR.
5. EOR-fill.
Kind of, sort of... :D
ps. only works for convex objects naturaly. |
| |
Cruzer
Registered: Dec 2001 Posts: 1048 |
guess the code could look something like this, if the facevisibles were either $00 or $ff for true/false...
lda #facecolor0
and facevisible0
sta tmp
lda #facecolor1
and facevisible1
eor tmp
sta linecolor
|
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
Quote: in my routines there is no such things as "lines drawn more than once" so i do not have to eliminate them.
jackasser, cruzer: you write how to actually eliminite, but graham says he doesnt has to... (?!?!) |
| |
Cruzer
Registered: Dec 2001 Posts: 1048 |
i guess you don't have to eliminate double lines in realtime if the lines are "born" knowing that they always have to consider two faces' colors and visibility to get their own line color. |
| |
Graham Account closed
Registered: Dec 2002 Posts: 990 |
@Oswald:
something like JackA said. i do not think of the lines as "edges of a polygon" but rather "polygons are neighbours of the lines". |
Previous - 1 | 2 | 3 - Next |