hello folks... this thing is under construction...
there were few errors there... for example Vector and not Point should be used and to follow math further there should be operations on Vector by means on operators because that's what they are for.
whichever way....
Matrix4x4 * Vector3 would result in transforming a vector with matrix transformation and Matrix4x4 has member function setRotation (angle, direction.x, direction.y, direction.z); rotates around Direction vector by given amount of degrees.
Vector3D <float> v (x, y, z);
Matrix4x4 <float> m;
m.setRotation (angle, x, y, z);
Vector3D <float> result = m * v;
glVertex3fv (v.x. v.y, v.z); or even faster glVertex3fv (v.xyz);
or even cleaner.
Vec3f v (x, y, z);
Matrix4x4 m;
m.setRotation (angle, x, y, z);
Vec3f result = m * v;
glVertex3f (v.xyz);
would be same as
glRotatef (angle, x,y,z);
glVertex3f (x,y,z); // can't be faster if variables are separated
stuff is not ready yet... has to handle exceptions for
v.normalize(); // if initial vector v is null vector then this might lead to divide by zero
I hope you can find this usefull when designing those yourself... mine are not yet suited for codecogs because it contains a lot of weird keywords ( work in progress )... however it should become available very very soon
Login