Category Archives: Graphics

A raytracer in python – part 3: samplers

In the previous post, we explored a very basic way of plotting images: shooting a ray from the center of every pixel, and plot the color of the object we hit. The result is a rather flat, very jagged image Border jagging arises from the fact that we are sampling with a discrete grid (our [...]

A raytracer in python – part 2: rendering multiple objects

A quick addition needed to the raytracer is providing freedom to add more objects to the rendering scene. In Part 1, the design was such that only one object, a sphere, could be drawn. The new code allows much more flexibility. I added a Plane object, introduced assignment of colors to the objects, divided the [...]

A raytracer in python – part 1: basic functionality

Some time ago I visited Sydney, and I made a tragic mistake: I entered the University bookshop. Why a mistake, you say? I am book maniac. As soon as I enter a book shop (live or on web) I end up spending up to a thousands euro every time. This time, it was not the [...]

Cairo PostScript rendering

I am trying to render vector graphics with alpha blending. Too bad, PostScript, even Level 3, does not support alpha blending. This means that if you want to draw two objects (say, circles) in PostScript and you want to make them look as they are alpha blended you have to do “some” trick. An example: [...]