I''m doing it on Image Based Rendering - the art of using an image with depth information to generate arbitrary new views of the objects in the image.
The reason I''m still doing lots of vector math, is because I wanted to compare it to a technique called "Voxel Texturing", which was the subject of my master''s thesis. ( I still have it laying around somewhere in PDF format. )
The problem with it was, that it''s not perspective correct. Now I''m working on "Displacement Mapping", kindof an evolution of the ideas I had for Voxel Texturing, only more powerful, perspective correct, and with the potential for commodity hardware acceleration, because it can use a standard polygon pipeline.
Ps: Here''s the final fast version of my vector class. If anyone wants to test the speed, go right ahead! If you can beat it I''d like to know how of course.
class CVector3f{public: // Fast ctors inline CVector3f( ) : x(0), y(0), z(0) {}; inline CVector3f( float nx, float ny, float nz) : x(nx), y(ny), z(nz) {}; // Fast copy ctor inline CVector3f( const CVector3f &v ) : x(v.x), y(v.y), z(v.z) {}; inline CVector3f operator+( const CVector3f &v1 ) const { return CVector3f( x + v1.x, y + v1.y, z + v1.z ); } inline CVector3f operator-( const CVector3f &v1 ) const { return CVector3f( x - v1.x, y - v1.y, z - v1.z ); } inline CVector3f operator*( const float scale ) const { return CVector3f( x * scale, y * scale, z * scale ); } inline CVector3f& operator=( const CVector3f &v ) { x = v.x; y = v.y; z = v.z; return *this; } inline CVector3f& operator+=( const CVector3f &v ) { x += v.x; y += v.y; z += v.z; return *this; } inline CVector3f& operator*=( const float scale ) { x *= scale; y *= scale; z *= scale; return *this; } inline void Displace( const CVector3f &v1, const CVector3f &v2, const float scale ) { x = v1.x + scale * v2.x; y = v1.y + scale * v2.y; z = v1.z + scale * v2.z; } float x; float y; float z;};
#pragma DWIM // Do What I Mean!
~ Mad Keith ~