| If your using C++. Just create a class like this
class Vec3
{
union
{
float xyz;
struct
{
float x, y, z;
};
};
MATH_INLINE void glNormal3d(Vec3& p1, Vec3& p2)
{
Vec3 v = Vec3(x, y, z);
Vec3 v1 = p1 - v;
Vec3 v2 = p2 - p1;
Vec3 normal = Vec3(v1.cross(v2));
normal.normalise();
normal.printVec3();
glNormal3dv(normal.ptr());
}
};
EDIT: Sorry theres no way to delete the post. Just noticed its 3 months old.
Last edited by Eckos : 06-17-2008 at 03:48 PM.
|