Skip to main content

soft3d

A 3d software rendering experiment - texture mapped, "lit" polygons, with translation, rotation, and texture scrolling


patrick mullen
(saluk)
Eventually I need to incorporate some 3d effects into one of my projects, but the 3d I need is fairly low poly and only used sparingly. It doesn't seem worth the effort to convert the entire huge system to opengl, as I will lose compatibility. So I thought, why not just render 3d in software.

So far this is just an experiment, but it almost has everything I need. I have optimized for speed as much as I think I can.

Controls:

* arrow keys - move 4-sided box around the screen
* a/z - zoom in and out - don't zoom in too far it may crash
* r,t,y - rotate the box on it's axis

Features:
* surfarray rendering for fast pixels
* 3d math only done on triangle corners
* texture mapped triangles, triangulated quads
* depth buffer for hidden surface removal
* pixel clipping

Links

Home Page
http://code.google.com/p/pygame-soft3d/

Releases

soft3d 0 — 20 Oct, 2010

Pygame.org account Comments

  • pixdigit 2015-03-11 21:42:03

    I got from 30 to 100 fps
    (without psyco....)

    patrick mullen 2017-03-31 19:05:28.355461

    I would love to see how you improved it!