OGL.H in OPENGLZOOM.zip


In the system that we draw a square, you can twist the mouse box object realize...Original Link
    Sponsored links

			
#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, 
  please click here to download the whole source code package.

			
			


Project Files

    Sponsored links
NameSizeDate
 02.00 B
 ChildFrm.cpp1.51 kB02-11-02 10:25
 ChildFrm.h1.36 kB02-11-02 10:25
 DlgSetup.cpp1.46 kB02-12-02 13:05
 DlgSetup.h1.38 kB02-12-02 13:05
 MAINFRM.CPP2.34 kB02-11-02 12:33
 MainFrm.h1.37 kB02-11-02 12:32
 OGL.CPP9.34 kB02-12-02 14:09
 OGL.H6.83 kB02-12-02 13:18
 ReadMe.txt4.86 kB02-11-02 10:25
 02.00 B
 02.00 B
 resource.h1.22 kB02-12-02 13:14
 Apple.bmp192.05 kB02-12-02 14:06
 Toolbar.bmp1.29 kB02-12-02 13:14
 ZoomPerspective.ico1.05 kB02-11-02 10:25
 ZoomPerspective.rc2407.00 B02-11-02 10:25
 ZoomPerspectiveDoc.ico1.05 kB02-11-02 10:25
 StdAfx.cpp217.00 B02-11-02 10:25
 STDAFX.H1.15 kB02-11-02 11:30
 TEXTURE.CPP28.64 kB02-11-02 19:30
 TEXTURE.H2.96 kB02-11-02 19:29
 VIEW.CPP11.23 kB02-12-02 13:49
 View.h2.60 kB02-12-02 13:06
 Zoom.jpg38.22 kB02-11-02 19:45
 ZoomPerspective.cpp4.43 kB02-11-02 10:25
 ZoomPerspective.dep802.00 B02-11-02 10:25
 ZoomPerspective.dsp5.39 kB02-12-02 13:53
 ZoomPerspective.dsw553.00 B02-11-02 10:25
 ZoomPerspective.h1.42 kB02-11-02 10:25
 ZoomPerspective.mak7.10 kB02-12-02 13:53
 ZoomPerspective.rc15.94 kB02-12-02 13:14
 ZoomPerspective.ver114.00 B02-12-02 14:09
 ZoomPerspectiveDoc.cpp1.88 kB02-11-02 10:25
 ZoomPerspectiveDoc.h1.54 kB02-11-02 10:25
 Ψ-偻穰3.11 kB04-19-04 10:52
 Ψ-偻穰126.00 B04-03-04 17:45
 -3.84 kB11-05-03 18:50
...

Related Items

    Sponsored links