Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > STr34kZ (aka. EOR lines)
2005-02-15 15:46
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....
 
2005-02-17 09:36
Krill

Registered: Apr 2002
Posts: 2940
yes, i do that as well.
2005-02-17 10:01
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.
2005-02-17 10:38
Cruzer

Registered: Dec 2001
Posts: 1048
oldest trick in the book ;)
2005-02-17 10:54
Oswald

Registered: Apr 2002
Posts: 5076
graham ?! how do you do that ?
2005-02-17 12:19
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.
2005-02-17 12:33
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
2005-02-17 12:38
Oswald

Registered: Apr 2002
Posts: 5076
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... (?!?!)
2005-02-17 13:37
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.
2005-02-17 19:17
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".
2005-02-20 15:47
Cybernator

Registered: Jun 2002
Posts: 154
Some blah-blah about Z-sorting now. :) The 3 boxes work perfectly, but look what happens with my aircraft. http://www.geocities.com/lazeristoski/aircraft.zip
The jpg screenshot shows you how the wings are connected to the fuselage. As you can see the sorter doesn't work as it's supposed to. The aircraft is divided into several objects: fuselage (the box), cockpit, left wing, and right wing. This is because an object is assumed to have no overlapping faces. (of course front faces overlap back faces, but I'm talking about overlapping of a front face with another front face).

I calculate the centers of each object like this:

center.x=center.y=center.z=0;
for (i=0; i<nr_vertices; i++)
{
...center.x+=vertex.x;
...center.y+=vertex.y;
...center.z+=vertex.z;
}
center.x/=nr_vertices;
center.y/=nr_vertices;
center.z/=nr_vertices;

Now I do the following:
- rotate the aircraft
- before I project the points, I sort the objects according to the Z coord of the rotated centers

This is what I read in a tutorial (the PXD series, I think). But obviously this is not correct. All the tutorials I've found about Z-sorting deal with different sorting algorithms (bubble vs radix vs quick), but none of them tells _what_ to sort.

Any tips?
Previous - 1 | 2 | 3 - Next
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
REBEL 1/HF
MCM/ONSLAUGHT
Guinea_pig/Moonshine
Board Rider/Commodor..
iAN CooG/HVSC
Fred/Channel 4
t0m3000/HF^BOOM!^IBX
R1SC
psych
Exploding Fi../Techn..
Jazzcat/Onslaught
zscs
Guests online: 92
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Mojo  (9.6)
6 Uncensored  (9.6)
7 Wonderland XIV  (9.6)
8 Comaland 100%  (9.6)
9 No Bounds  (9.6)
10 Unboxed  (9.6)
Top onefile Demos
1 Layers  (9.6)
2 Party Elk 2  (9.6)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.6)
5 Rainbow Connection  (9.5)
6 It's More Fun to Com..  (9.5)
7 Morph  (9.5)
8 Dawnfall V1.1  (9.5)
9 Onscreen 5k  (9.5)
10 Daah, Those Acid Pil..  (9.5)
Top Groups
1 Booze Design  (9.3)
2 Oxyron  (9.3)
3 Nostalgia  (9.3)
4 Censor Design  (9.3)
5 Performers  (9.3)
Top NTSC-Fixers
1 Pudwerx  (10)
2 Booze  (9.7)
3 Stormbringer  (9.7)
4 Fungus  (9.6)
5 Grim Reaper  (9.3)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.039 sec.