Writing a software renderer

Started by
1 comment, last by Ravyne 10 years, 2 months ago

Hi All,

I have managed to draw pixels, lines, triangles, then solid triangles, and I copied and pasted a code for texturing a triangle, I would like also to someone guide me on how to do it and understand it fully.

What are the next steps, is it possible to draw a cube in 2D and write a camera, world transformations right now and ignoring the Z ?

For example, I would like to load a .plg model and ignore the .z ?

Advertisement

i dont really suggest to copy codes to do your renderer, you should fully understand and have control over the whole process instead.

So, you're just drawing in 2D now, correct? Without a z-buffer?

You could go in several directions:

You could write some blitting functions to draw textured 2D rectangles (for things like tiles, sprites, UI).

You could write a 2D transformation pipeline, so that you could do 2D sprite games with mode-7-like effects (rotation, zoom, scales, shears) or vector-style games.

You could write a 3D transformation pipeline, so that you could do simple 3D games that can use back-face culling and the painter's algorithm instead of a z-buffer.

You could write a 3D transformation pipeline with zbuffering, and then implement perspective-correct texturing to do relatively unfettered 3D rendering.

Specifically, the thing you want to do isn't doable in the way you suggest in any really useful form (just throwing away z) -- what you want to do is project the 3D representation of the cube onto the 2D screen -- that's what a 3D transformation pipeline (often just called the 3D graphics pipeline, or graphics pipeline, or 3D pipeline) does.

throw table_exception("(? ???)? ? ???");

This topic is closed to new replies.

Advertisement