|
![](/i/fill.gif) |
Josh English <eng### [at] spiritone com> wrote:
: Yeah,to program a scan line as you described, I would take a group of polygons in
: 3space, convert them to a new 3space based on the camera definition, then project it
: onto an "image plane" and get some 2d coordinates. A lot of hard work and hours of
: debugging for a small thing.
Don't forget implementing a z-buffer for hidden-surface removal (sorting
the polygons in depth-order is not always enough).
You'll also need to implement either a gouraud-shading (quite poor-looking)
or a phong-shading (much better) algorithm to shade your polygons. Else they
will just look flat and cartoony.
And if you want even the simplest textures, you'll have to use perspective
correction if you want them right.
In raytracing all those things are achieved with a lot less effort
(besides getting reflection and refraction at almost no extra cost).
--
char*i="b[7FK@`3NB6>B:b3O6>:B:b3O6><`3:;8:6f733:>::b?7B>:>^B>C73;S1";
main(_,c,m){for(m=32;c=*i++-49;c&m?puts(""):m)for(_=(
c/4)&7;putchar(m),_--?m:(_=(1<<(c&3))-1,(m^=3)&3););} /*- Warp -*/
Post a reply to this message
|
![](/i/fill.gif) |