Partial Template Specialization is Pattern Matching

When I was first introduced to the concept of template meta programming (TMP) I thought it was black magic! Well, it is, and remains so, until you see things from the correct perspective. 

Coming from an imperative programming background I have the (bad?) habit of understanding functions as a sequence of operations, this is great, until it holds you back and doesn’t work anymore. Template meta programming in C++ is all about doing computations at compile time, before the program run. Read more

Implementing An Octree Raycasting Algorithm

In the previous article I talked about how to implement a basic octree data structure to use in different applications. In this article I will introduce my full implementation for an important octree ray casting technique.

Ray casting in general is used to describe any algorithm that includes finding the intersection between a ray (directed line) and any geometric entities. In our context we will use ray casting exclusively to describe octree traversal. In other words, finding the intersection between a ray and octree, results in finding all the sub-nodes in the octree that are intersected by the ray. Read more

Constructing an Octree Datastructure

Lately, I have been working hard on my 3D engine Storm3D. One of the features that I am spending a lot of time on, is developing a generic and efficient octree data structure, that will serve multiple purposes from collision detection to voxel based rendering. Here I will introduce the basic algorithm for building an octree and some of the obstacles that you might face.
Read more