|
In lugnet.cad.dev, Jeremy H. Sproat writes:
> Hey all,
>
> In trying to implement a LDraw renderer I've been scouring the web looking
> for raster-painting algorithms. While I've found plenty of line-drawing
> algorithms (the Bresenham seems to be pretty nice) I haven't found squat for
> drawing a filled triangle or quad.
>
> I've pretty much figured out how to draw a triangle in 2d based on the
> Bresenham line-drawing algorithm, but I'm frankly stumped when it comes to
> the z-buffer. What I *do* have is absolutely riddled with floating-point
> divides, and doesn't quite work anyway (having incorrectly determined the
> z-slope of the triangle in order to determine the z-depth at an arbitrary
> point).
>
> Does anyone have an algorithm they'd be willing to share?
>
> Alternatively, is there a specific keyword I should search for that would
> help me find what I need in Google or AltaVista?
>
> Cheers,
> - jsproat
I may be missing your point/problem but...
Think you may need to go bi-linear in your Z calcs. Yes this makes
a Suppos'dly one pixel lookup method a two+ per pixel but if you are
already using a scan line method you have the precalculated values
right at hand. Problem shows up in shadow edges and in some wierd
triangles that have mutual or harmonic pixel positions. Is much the
same with texture calculations and pixel-texl-edge intersections.
Only other way out of the problem is more bits of depth
or more pixels per render-cell/pixel. Ugh!
Check out this site for leads in your quest
http://astronomy.swin.edu.au/pbourke
Best
DaveG
|
|
Message is in Reply To:
| | Drawing triangles in a Z buffer
|
| Hey all, In trying to implement a LDraw renderer I've been scouring the web looking for raster-painting algorithms. While I've found plenty of line-drawing algorithms (the Bresenham seems to be pretty nice) I haven't found squat for drawing a filled (...) (23 years ago, 13-Feb-02, to lugnet.cad.dev, lugnet.off-topic.geek)
|
6 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|