delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/04/02/12:18:52

From: ellman AT xs4all DOT nl ()
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Z-bufering
Date: 2 Apr 1997 11:55:10 GMT
Organization: XS4ALL
Lines: 32
Message-ID: <5htheu$cf0$1@news0.xs4all.nl>
References: <33414D32 DOT 147D AT geocities DOT com>
NNTP-Posting-Host: xs1.xs4all.nl
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

In article <33414D32 DOT 147D AT geocities DOT com>,
Henri Ossi  <henriossi AT geocities DOT com> wrote:
>
>Where can I find a source code for Z-buffering under Allegro?
>It isn't fun to draw every 3D object on the screen.
>Thanks for the answers.

You'd have to re-write Allegro's 3D polygon drawing routines so that they
calculate the Z value for each pixel they plot, and compare them with the value
in the Z buffer for that point.

I am thinking of having a go at this myself, but I'm thinking of implementing
1/z buffer because 1/z values can be quickly calculated from the equasion of a
plane where Ax+By+Cz=D.

See the Zed3D tutorial for more information.
It can be FTP'd from x2ftp.oulu.fi in pub/msdos/programming/docs/zed3d095.zip

AE.

PS. I've just written some code to draw a sphere lit from a single lightsource,
but it's too slow, and I think there may be a way better than the one I've
used. I will use this code to experiment with Z buffering before I have a go at
adding it to Allegro's polygons. Is anyone interested? Also, does anyone have
any ideas on texture-mapping spheres?

--
Andrei Ellman - URL: http://www.xs4all.nl/~ellman/ae-a - ae1 AT york DOT ac DOT uk
"All I wanna do is have some fun     :-)     || ae-a AT minster DOT york DOT ac DOT uk
 I've got the feeling I'm not the only one"  || mailto:ellman AT xs4all DOT nl
     -- Sheryl Crow      :-)    ||       It's what you make of it.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019