计算机图形学实验——画立方体(通过视向变换等)具体实现如下(仅供参考)一、:具体代码:doubleVertex[8][3]={{0,20,0},{30,20,0},{30,20,15},{0,20,15},{0,0,0},{30,0,0},{30,0,15},{0,0,15}};intEdge[12][2]={{0,1},{1,2},{2,3},{3,0},{4,5},{5,6},{6,7},{7,4},{0,4},{1,5},{2,6},{3,7}};doubleVertex1[8][3];//视点doubleEye[3]={,,};//窗口数据//intWindow[4]={-30,5,-15,3};intWindow[4]={-20,-15,-2,-20};//视区数据intViewPort[4]={200,250,180,15};二、//:interfaceoftheCMy6_DrawcubeViewclass///////////////////////////////////////////////////////////////////////////////#if!defined(AFX_6_DRAWCUBEVIEW_H__940E4DA8_261A_46F3_82C2_259B9B805817__INCLUDED_)#defineAFX_6_DRAWCUBEVIEW_H__940E4DA8_261A_46F3_82C2_259B9B805817__INCLUDED_#if_MSC_VER>1000#pragmaonce#endif//_MSC_VER>1000classCMy6_DrawCUBEView:View{protected://createfromserializationonlyCMy6_DrawcubeView();DECLARE_DYNCREATE(CMy6_DrawcubeView)//Attributespublic:CMy6_DrawcubeDoc*GetDocument();booldraw;voiddrawCube();//Operationspublic://Overrides//ClassWizardgeneratedvirtualfunctionoverrides//{{AFX_VIRTUAL(CMy6_DrawcubeView)public:virtualvoidOnDraw(CDC*pDC); //overriddentodrawthisviewvirtualBOOLPreCreateWindow(CREATESTRUCT&cs);protected:virtualBOOLOnPreparePrinting(CPrintInfo*pInfo);virtualvoidOnBeginPrinting(CDC*pDC,CPrintInfo*pInfo);virtualvoidOnEndPrinting(CDC*pDC,CPrintInfo*pInfo);//}}AFX_VIRTUAL//Implementationpublic:virtual~
画立方体——计算机图形学实验 来自淘豆网m.daumloan.com转载请标明出处.