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. Continue reading “Partial Template Specialization is Pattern Matching”

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. Continue reading “Implementing An Octree Raycasting Algorithm”

Building A Multipurpose Octree Datastructre

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 be used for multiple purposes that varies from collision detection to voxel based rendering. Here I will introduce the basic algorithm for building the octree and some of the obstacles that you might face.
Continue reading “Building A Multipurpose Octree Datastructre”

The C++ Effect – Part 2

Hello again! Because I found the first article to be useful for many people (more than I expected) I decided to write the 2nd one before my original plans were going. If you didn’t read the first article it might be a good idea to take a look now. In this article I will also focus on the lesser known features of the language with more emphasis on C++11 Continue reading “The C++ Effect – Part 2”

Understanding C++ Function Binders

Ever heard of function binders before? Well, function binders are one of lesser known useful functions of the C++ standard library. Function binders started early in the design of the standard template library (stl), they enabled developers to use function objects with a specific signature as a Continue reading “Understanding C++ Function Binders”

What is Lazy Evaluation ?

One of the most fundamental features that modern languages embraced requires that any expression will be resolved immediately before being assigned to a variable. In an imperative language this feature guarantees that the code execution matches the order of the code, this simply gives the programmer Continue reading “What is Lazy Evaluation ?”

A Generic Solution for Handling OpenGL 3.1 Uniform Variables

Starting from OpenGL 3.0,  a deprecation mechanism was introduced. Certain features were marked as deprecated, While still accessible in OpenGL 3.0 by requesting a full context, OpenGL 3.1 fully removed all the deprecated features. the most important deprecated feature was the fixed-pipeline Continue reading “A Generic Solution for Handling OpenGL 3.1 Uniform Variables”