View Single Post
  #5 (permalink)  
Old 06-17-2008, 03:46 PM
Eckos Eckos is offline
Novice
Join Date: Jun 2008
Posts: 2
iTrader: (0)
Eckos is on a distinguished road
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.

__________________

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!

Last edited by Eckos : 06-17-2008 at 03:48 PM.
Reply With Quote