Skip to content

cppjames/rendeer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

alt text

Rendeer

A basic 3D renderer made in Python, using the library Pillow.

alt text

Note: This application is currently in development. It has bugs and imperfections.

Getting started

These instructions will guide you through the installation and usage of Rendeer.

Requirements

This project was made using Python 3.6. You need to go to the official Python website and install Python 3.6 or a newer version. You also need the Pillow and the tqdm library, which you can install with the command:

pip install pillow tqdm

Usage

You should be able to run the program by simply opening rendeer.py. It will probably take up to a minute for the mesh to be rendered.

If you want to import a mesh from an .obj file, you now can! Simply open wavefront_importer.py and specify the path to the .obj file.

Note: Please triangulate your mesh before importing it unless you want it to look like this

If, for example, you want to import a mesh called tree.obj which is in the same folder as wavefront_importer.py, you would need to type

tree.obj

If it's in a folder called "Trees" that's in the same folder as wavefront_importer.py, you would need to type

Trees\tree.obj

Note: The four files (rendeer.py, meshes.py, settings.py, intersection.py and wavefront_importer.py) have to be all in the same directory for everything to work properly.

The data from the .obj file will be saved in a file called meshes.py. You can now run the renderer and it will display your mesh in an image. You might have to move/rotate your mesh in order to display it as you like.

Contributors

  • Special thanks to tweakimp for doing a lot of optimization and making the rendering time significantly shorter.

Changelog

What's new in 4.0.0?

  • ALAN (Animation Language) has been added: you can now create animations with ease! (no pun intended)

v3.0.0

Biggest update yet! Here are some key features:

  • You can now set the resolution so you can go Ultra HD (default resolution is 100)
  • calculating hard vertex normals is now up to 1000 times faster
  • Gouraud shading! Now your meshes are as smooth as they can get
  • many parts of the code have been rewritten, others are just gone

v2.3.0

  • shading modes! choose between flat diffuse, unlit and wireframe!
  • progress bars! stop staring into the void for a minute straight, now you can watch the program doing things
  • variables that the user should modify are in a separate file now (settings.py)
  • fixed problem with the mesh being too bright where light doesn't touch it

v2.2.0

  • now it has a Wavefront importer for your 3D models
  • it sorts faces by distance so it can now render them in the (almost) correct order.
  • it can now calculate hard vertex normals
  • I've fixed some of the 0x0BADC0DE.

About

A simple 3D rasterizer made from scratch in Python.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages