3 ms·
> Despite that, it also happens to be the simplest way to render 3D images. I'm not sure I would claim that -- with a line drawing routine in hand (a for loop)
by santaclaus 10y ago
> Despite that, it also happens to be the simplest way to render 3D images.
I'm not sure I would claim that -- with a line drawing routine in hand (a for loop), you can have 3D perspective renderings of objects with a few matrix vector multiplies.
- tbabb 10y agoLine drawing algorithms can be surprisingly tricky. I don't think what you describe would be easier than a basic raytracer, which would be about a page of code, and the most complex math involved is the quadratic formula.
- clarry 10y agoSurprisingly tricky being something around two or three dozen lines of C for filling a triangle (with some constraints), after it's been transformed appropriately. But that is not the only way. You can iterate over a plane and test whether the coordinates are within a triangle. It ends up being very similar to the code you'd have for ray tracing a triangle.