Dead Hackers Society
Other BBSes »
 
 
Demoscene  Coding  CT60  Buy/sell

Atari coding BBS
 
Re: Triangle clipping?
Posted by: mikro May,19.2005-14:50 

hmm, if you have implemented SH for x/y I don't see any problem for gouraud/uv/anything. Remember, it's interpolation! ;-)

halfing method: forget it, too slow, it uses recursion iirc?

no edgebuffer: dont' worry, it's easy. I know, nearly everyone uses it (even on dsp - No, Earx ... hi guys! ;-) but I did it without buffers (on dsp, too). there isn't anything to worry about: you've got 3 vertices (x,y,i), right? So, you will have some buffer where you store this stuff... something like:

buffer[0] = y1
buffer[1] = x1
buffer[2] = i1
buffer[3] = y2
:
:
buffer[..] = i3

so... and your clipping routine will go trough this buffer and will take always two vertices (v1 = (x1,y1) bundle) and compare against screen:

clip(v1,v2)
clip(v2,v3)
clip(v3,v1)

(i hope i remember it right, it's looong time ago I've seen my dsp sources..) After each "clip" call you have to update this buffer with clipped values, ofcourse. And that's all, after all clipping you will have same buffer with clipped vertices. So as you can see, no difference between edge-buffer and no-edge-buffer method.. Just study how SH works and that it is..

and about efficienty: SH it's quite efficient... remember it checks against four boundaries each vertex, yes, but that's a question of one compare & one bit set... the clipping itself is provided on "needs-to-be-clipped" vertices, only.. believe, it's the most efficient and the easiest one to implement ;-)







[All messages in this thread]    [Start new thread]

Topic Posted by  Date 
Triangle clipping? Symmetry of TNG May,19.2005-13:09
  Re: Triangle clipping? deez May,19.2005-13:33
    Re: Triangle clipping? Symmetry May,19.2005-14:10
      Re: Triangle clipping? earx May,19.2005-14:35
      Re: Triangle clipping? mikro May,19.2005-14:50
      Re: Triangle clipping? deez May,19.2005-15:51
        Re: Triangle clipping? ray May,19.2005-17:07
          Re: Triangle clipping? Symmetry May,19.2005-19:05
            Re: Triangle clipping? sqward May,19.2005-23:19
              Re: Triangle clipping? earx May,20.2005-10:22
                Re: Triangle clipping? ray May,20.2005-11:41
                  Re: Triangle clipping? earx May,20.2005-12:13
                  Re: Triangle clipping? Symmetry May,24.2005-21:11
                Re: Triangle clipping? mikro May,20.2005-21:01
                  Re: Triangle clipping? earx May,21.2005-00:25
                Re: Triangle clipping? sqward May,21.2005-11:21
              Re: Triangle clipping? parapete May,20.2005-21:26
                Re: Triangle clipping? earx May,21.2005-00:43
                Re: Triangle clipping? sqward May,21.2005-11:17
                Re: Triangle clipping? Gizmo May,22.2005-18:09
                  Re: Triangle clipping? Symmetry of TNG May,24.2005-20:05


Reply to this message
Name:
Topic:
Anti-troll code:

Message:

What's the anti-troll code?
That's your personal code to be able to add comments and messages on the dhs.nu site.
Don't have a code or forgot it? Fix it here.
© 1994-2024 Dead Hackers Society Contact: Anders Eriksson