blog revived in 3D
April 13, 2011
Woa! It was quite a long time ago since I posted anything. I even forgot I had a blog. Well, time to start…
I got my hands dirty with Python & OpenGL (PyOpenGL) and started reading The Red Book. It’s now much easier to write fancy programs. What took days, now takes minutes. Back in the days you actually had to roll your own graphics library. It went something like this:
- Write a routine to display a point (pixel). It’s not difficult at all, but first you have to map 3D coordinates onto the 2D display. Then you can display it on the screen (preferably by directly addressing the video memory).
- by using your awesome point routine, you can draw a line pixel-by-pixel
- Ok, triangles next. All objects are made up of triangles, you know that, right? Even spheres.
- Still there? Good. Now we can create rectangles, cubes, spheres and so on. You have to build them up by using triangles. Sometimes it can be rather tedious.
We used to write it in Assembly, which further complicated things (especially x86 Assembly, which was a pain at that time (memory segmentation, too few registers, to name a few annoyances)). But anyway after writing these pretty basic things we have our shiny new library. It’s time to start working on funny stuff like animation, texture mapping, hidden surface elimination, transformations (scaling, translation etc.), lighting, shading… The list goes on. It’s a lot of work and maths (vectors, matrices, linear algebra etc.). And we’re still not cross-platform.
Well, that’s it for a start.