void CTestView::DrawPolygon(CDC *pDC,CLine *line)//绘制立方体线框模型 { for(int nFace=0;nFace<6;nFace++) { CP2 t; for(int nVertex=0;nVertex<F[nFace].vN;nVertex++)//顶点循环 { ObliqueProject(P[F[nFace].vI[nVertex]]);//斜等测投影 if(0==nVertex) { line->MoveTo(pDC,ScreenP.x,ScreenP.y); t=ScreenP; } else line->LineTo(pDC,ScreenP.x,ScreenP.y); } line->LineTo(pDC,t.x,t.y);//闭合多边形 } }改为三棱锥
时间: 2023-06-15 21:04:27 浏览: 133
void CTestView::DrawPyramid(CDC *pDC, CLine *line)//绘制三棱锥线框模型
{
for(int nFace = 0; nFace < 4; nFace++)
{
CP2 t;
for(int nVertex = 0; nVertex < P[nFace].vN; nVertex++)
{
ObliqueProject(P[nFace].vI[nVertex]);//斜等测投影
if(0 == nVertex)
{
line->MoveTo(pDC, ScreenP.x, ScreenP.y);
t = ScreenP;
}
else
{
line->LineTo(pDC, ScreenP.x, ScreenP.y);
}
}
line->LineTo(pDC, t.x, t.y);//闭合多边形
}
for(int nVertex = 0; nVertex < P[4].vN; nVertex++)//底面的顶点循环
{
ObliqueProject(P[4].vI[nVertex]);//斜等测投影
if(0 == nVertex)
{
line->MoveTo(pDC, ScreenP.x, ScreenP.y);
}
else
{
line->LineTo(pDC, ScreenP.x, ScreenP.y);
}
}
}
阅读全文
相关推荐
![rar](https://img-home.csdnimg.cn/images/20241231044955.png)
![rar](https://img-home.csdnimg.cn/images/20241231044955.png)
![docx](https://img-home.csdnimg.cn/images/20241231044901.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![-](https://img-home.csdnimg.cn/images/20241231044937.png)
![-](https://img-home.csdnimg.cn/images/20241231044937.png)
![-](https://img-home.csdnimg.cn/images/20241231044937.png)
![-](https://img-home.csdnimg.cn/images/20241231044937.png)
![-](https://img-home.csdnimg.cn/images/20241231044937.png)
![-](https://img-home.csdnimg.cn/images/20241231044937.png)
![-](https://img-home.csdnimg.cn/images/20241231044833.png)
![-](https://img-home.csdnimg.cn/images/20241231044937.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)