• 大小: 0.14M
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-06-14
  • 语言: 其他
  • 标签: 其他  

资源简介

cd7b02a80b63de41fce63008c278aae1.rar

资源截图

代码片段和文件信息

// DrawScene.cpp: implementation of the CDrawScene class.
//
//////////////////////////////////////////////////////////////////////

#include “stdafx.h“
#include “quhe3Dtrans.h“
#include “DrawScene.h“

#include “gl\gl.h“
#include “gl\glu.h“

#include “quhe3DtransDoc.h“
#include “quhe3DtransView.h“
#include “TransControl.h“

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CDrawScene::CDrawScene()
{

}

CDrawScene::CDrawScene(Cquhe3DtransView *pView)
{
   m_pView = pView;
}

CDrawScene::~CDrawScene()
{

}

void CDrawScene::DrawScene()
{
DrawBackground();
 
  
  CaculateMatrix();  // Caculate the transing matrix.
DrawBall();        // Trans the ball and display.

pClipSpaceobject(); 
    Projectobject();
DrawClipBall();
}

void CDrawScene::DrawBackground()
{
     Cquhe3DtransDoc *pDoc = (Cquhe3DtransDoc *)m_pView->GetDocument();

 /* Draw Space Axis */
    glColor3f(1.0f 0.0f 0.0f);
glBegin(GL_LINES);                  // X Axis 
  glVertex3f( 3.0f 0.0f  0.0f);
  glVertex3f(-6.0f 0.0f  0.0f);
glEnd();
    glColor3f(0.0f 1.0f 0.f);
glBegin(GL_LINES);                  // Y Axis 
  glVertex3f( 0.0f  3.0f  0.0f);
  glVertex3f( 0.0f -3.0f  0.0f);
glEnd();
    glColor3f(0.0f 1.0f 1.0f);
glBegin(GL_LINES);                  // Z Axis 
  glVertex3f( 0.0f 0.0f  8.0f);
  glVertex3f( 0.0f 0.0f -24.0f);
glEnd();

/* Draw window on YOZ Plane */
    glColor3f(1.0f 1.0f 0.0f);
glBegin(GL_LINES);                  
glVertex3f(0.0 pDoc->winLypDoc->winLz);
glVertex3f(0.0 pDoc->winRypDoc->winLz);

glVertex3f(0.0 pDoc->winRypDoc->winLz);
glVertex3f(0.0 pDoc->winRypDoc->winRz);

glVertex3f(0.0 pDoc->winRypDoc->winRz);
glVertex3f(0.0 pDoc->winLypDoc->winRz);

glVertex3f(0.0 pDoc->winLypDoc->winRz);
glVertex3f(0.0 pDoc->winLypDoc->winLz);
glEnd();

// link eye and window to create space clip box
    glColor3f(1.0f 1.0f 0.0f);
glBegin(GL_LINES);    
    float xyz;
glVertex3f(pDoc->eyeX pDoc->eyeYpDoc->eyeZ);
x = -pDoc->eyeX * 2.5 + pDoc->eyeX;
y = (pDoc->winLy - pDoc->eyeY) * 2.5 + pDoc->eyeY;
z = (pDoc->winLz - pDoc->eyeZ) * 2.5 + pDoc->eyeZ;
glVertex3f(x y z);

glVertex3f(pDoc->eyeX pDoc->eyeYpDoc->eyeZ);
x = -pDoc->eyeX * 2.5 + pDoc->eyeX;
y = (pDoc->winRy - pDoc->eyeY) * 2.5 + pDoc->eyeY;
z = (pDoc->winLz - pDoc->eyeZ) * 2.5 + pDoc->eyeZ;
glVertex3f(x y z);

glVertex3f(pDoc->eyeX pDoc->eyeYpDoc->eyeZ);
x = -pDoc->eyeX * 2.5 + pDoc->eyeX;
y = (pDoc->winRy - pDoc->eyeY) * 2.5 + pDoc->eyeY;
z = (pDoc->winRz - pDoc->eyeZ) * 2.5 + pDoc->eyeZ;
glVertex3f(x y z);

glVertex3f(pDoc->eyeX pDoc->eyeYpDoc->eyeZ);
x = -pDoc->eyeX * 

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       1507  2008-12-09 17:35  quhe3Dtrans\DrawScene.h

     文件       2224  2008-12-09 17:35  quhe3Dtrans\quhe3DtransVIEW.h

     文件       2971  2008-12-12 17:24  quhe3Dtrans\quhe3Dtrans.clw

     文件       4431  2008-12-09 17:35  quhe3Dtrans\ReadMe.txt

     文件       1411  2008-12-09 17:35  quhe3Dtrans\quhe3Dtrans.h

     文件       4299  2008-12-09 17:35  quhe3Dtrans\quhe3Dtrans.cpp

     文件       1054  2008-12-09 17:35  quhe3Dtrans\StdAfx.h

     文件        213  2008-12-09 17:35  quhe3Dtrans\StdAfx.cpp

     文件       1104  2008-12-09 17:35  quhe3Dtrans\Resource.h

     文件       2006  2008-12-09 17:35  quhe3Dtrans\TransControl.h

     文件       7280  2008-12-09 17:35  quhe3Dtrans\quhe3DtransVIEW.cpp

     文件       5042  2008-12-09 17:35  quhe3Dtrans\quhe3Dtrans.dsp

     文件        545  2008-12-09 17:35  quhe3Dtrans\quhe3Dtrans.dsw

     文件        839  2008-12-12 17:25  quhe3Dtrans\quhe3Dtrans.plg

     文件       1713  2008-12-09 17:35  quhe3Dtrans\MainFrm.h

     文件       3087  2008-12-09 17:35  quhe3Dtrans\MainFrm.cpp

     文件        841  2008-12-09 17:35  quhe3Dtrans\TypeDefine.h

     文件        167  2008-10-03 19:23  quhe3Dtrans\ClearProjec.bat

     文件      29376  2008-12-12 16:54  quhe3Dtrans\quhe3Dtrans.aps

     文件      12548  2008-12-09 17:35  quhe3Dtrans\quhe3Dtrans.rc

     文件     272896  2008-12-09 17:33  quhe3Dtrans\cg3Dtrans.opt

     文件       6884  2008-12-12 17:18  quhe3Dtrans\quhe3DtransDOC.cpp

     文件       7482  2008-12-12 17:23  quhe3Dtrans\TransControl.cpp

     文件       2561  2008-12-12 17:24  quhe3Dtrans\quhe3DtransDOC.h

     文件      17303  2008-12-12 17:25  quhe3Dtrans\DrawScene.cpp

     文件      54784  2008-12-12 17:26  quhe3Dtrans\quhe3Dtrans.opt

     文件     151647  2008-12-12 17:25  quhe3Dtrans\Debug\quhe3Dtrans.exe

     文件        403  2008-12-09 17:35  quhe3Dtrans\res\quhe3Dtrans.rc2

     文件       1078  2008-12-09 17:35  quhe3Dtrans\res\quhe3DtransDOC.ico

     文件       1078  2008-12-09 17:35  quhe3Dtrans\res\quhe3Dtrans.ico

............此处省略9个文件信息

评论

共有 条评论