## OGL.H in OPENGLZOOM.zip

``````
#ifndef _OGL_ZOOMPERESPECTIVE_
#define _OGL_ZOOMPERESPECTIVE_
//
class Vector3F
{
public:
Vector3F(float x=0.0f,float y=0.0f,float z=0.0f)   {  Set(x,y,z); }
Vector3F(const Vector3F& point)                    {  Set(point.m_v[0],point.m_v[1],point.m_v[2]); }
//
void  Set(float x,float y,float z)                 {  m_v[0]=x; m_v[1]=y;   m_v[2]=z; }
//
float       operator []( int i) const              {  return m_v[i]; }
float&      operator []( int i)                    {  return m_v[i]; }
//
Vector3F&   operator +=(const Vector3F& v)         {  m_v[0]+=v.m_v[0];  m_v[1]+=v.m_v[1];  m_v[2]+=v.m_v[2];  return *this;  }
Vector3F&   operator -=(const Vector3F& v)         {  m_v[0]-=v.m_v[0];  m_v[1]-=v.m_v[1];  m_v[2]-=v.m_v[2];  return *this;  }
Vector3F&   operator *=(const float d)             {  m_v[0]*=d;  m_v[1]*=d;  m_v[2]*=d;  return *this;  }
//
float       Dot(const Vector3F& v)        const    {  return (m_v[0]*v.m_v[0]+m_v[1]*v.m_v[1]+m_v[2]*v.m_v[2]);   }
void        Vector(const Vector3F& b,
Vector3F &c)     const    {  c.m_v[0]= m_v[1] * b.m_v[2] - m_v[2] * b.m_v[1];
c.m_v[1]= m_v[2] * b.m_v[0] - m_v[0] * b.m_v[2];
c.m_v[2]= m_v[0] * b.m_v[1] - m_v[1] * b.m_v[0]; }
float       SquaredLenght()               const    {  return Dot(*this);   }
float       Lenght()                      const    {  return (float)sqrt(Dot(*this));   }
float       Distance(const Vector3F& v)
{
Vector3F d(v); d-=(*this); return d.Lenght();
}
bool        Normalize()
{
float L=Lenght();
if( (-FLT_EPSILON) < L && L < FLT_EPSILON ) return false;
(*this)*=1.0f/L;
retu

...
...
... to be continued.

This is a preview. To get the complete source file,

```
```