Skip to content

Instantly share code, notes, and snippets.

View markoshorro's full-sized avatar
🏡
Focusing

Markos Horro markoshorro

🏡
Focusing
View GitHub Profile
@markoshorro
markoshorro / raytracing.py
Created January 28, 2017 19:46 — forked from rossant/raytracing.py
Very simple ray tracing engine in (almost) pure Python. Depends on NumPy and Matplotlib. Diffuse and specular lighting, simple shadows, reflections, no refraction. Purely sequential algorithm, slow execution.
import numpy as np
import matplotlib.pyplot as plt
w = 400
h = 300
def normalize(x):
x /= np.linalg.norm(x)
return x