Path: cantaloupe.srv.cs.cmu.edu!rochester!udel!bogus.sura.net!news-feed-1.peachnet.edu!gatech!howland.reston.ans.net!zaphod.mps.ohio-state.edu!caen!batcomputer!munnari.oz.au!bruce.cs.monash.edu.au!monu6!escargot!edna.cc.swin.edu.au!saturn!alan
From: alan@saturn.cs.swin.OZ.AU (Alan Christiansen)
Newsgroups: comp.graphics
Subject: Re: Fast polygon routine needed
Date: 26 Apr 1993 15:24:08 GMT
Organization: Swinburne University of Technology
Lines: 49
Message-ID: <1rguqoINNrc@edna.cc.swin.edu.au>
References: <1993Apr17.192947.11230@sophia.smith.edu> <C5nF8t.Gsq@news.cso.uiuc.edu> <7306@pdxgate.UUCP> <C5tA9C.4u7@news.cso.uiuc.edu>
NNTP-Posting-Host: saturn.cs.swin.oz.au
Keywords: polygon, needed

osprey@ux4.cso.uiuc.edu (Lucas Adamski) writes:

>In article <7306@pdxgate.UUCP> idr@rigel.cs.pdx.edu (Ian D Romanick) writes:
>>What kind of polygons?  Shaded?  Texturemapped?  Hm?  More comes into play with
>>fast routines than just "polygons".  It would be nice to know exaclty what
>>system (VGA is a start, but what processor?) and a few of the specifics of the
>>implementation.  You need to give  more info if you want to get any answers! :P

>I don't want texture mapped, cause if I did I'd asked for them. :)  Just
>a simple and fast routine to do filled polygons.  As for the processor, it'd
>be for a minimum of a 286... maybe 386 if I can't find a good one for 286s.
>Ideally, I want a polyn function that can clip to a user-defined viewport,
>and write to an arbitrary location in memory.  Of course the chances of

Ok It is for a game that is 3d and you have listed the characteristics 
that you are looking for. I think you may have left out a few 
important parameters. 
The polygons are all convex. 
They have less than N sides. (you are drawing meshes walls doors etc.)

I believe that the algorithms you can get that will only draw convex
polygons can be much more efficient than those that can draw
concave / self intersecting polygons. 
This efficiency can largely be attributed to the fact that 
simple convex polygons only have a left and a right edge on each scan line.
Complex (figure 8 type polygons) can be a bit trickier.

The less than N sides specification especially if it is a very small 
number like 3 or 4 allow othe optimisations to be made.

Thus for a high speed game application I think you are looking for
code that exploits and is hence limited to drawing simple convex
polygons.  

>finding something like that are pretty remote, so I guess I'd need the source
>with it.  Oh, and I guess it would need to be in ASM otherwise it'd be too
>slow.  I've seen some polygon routines in C, and they've all been waaay too
>slow.  Its for a 3D vector graphics program.  I've been hunting high and low

It may have been that they were very general purpose algorithms.
If you limit yourself to 3 or four sided simple convex polygons
I think you might be suprised how fast a c algorithm with a 
asm block move to fill each scan line might actually be.


>for a polyn function in ASM, and I can't find one anywhere that I can use.
>I've found one or two polyn functions, but my ASM is pretty bad, so I won't
>even try to rewrite them. :)
>		//Lucas.
