在C#Windows应用程序中绘制3D模型 [英] Draw 3D model in C# windows application

查看:167
本文介绍了在C#Windows应用程序中绘制3D模型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正试图在Windows应用程序中绘制4个3D立方体.当某人单击第一个多维数据集时,MessageBox将显示第一个多维数据集被单击,其他3个相同.
有人可以帮我怎么做吗...
谢谢

I''m trying to draw 4 3D cubes in windows application. When someone click on the first cube then MessageBox shows the first cube is clicked and same for other 3.
Can somebody help me how to do this please...
Thanks

推荐答案

好.我不能/不会给你代码.但这是一种获取此信息的方法

1.设置您的应用程序以使用OpenGL绘制
2.绘制多维数据集,并将多维数据集的面(绘制为triangle_strips)保留在列表中
3.现在,您应该处理鼠标单击事件,以了解单击了哪个triangle_strip(通过使用某些命中列表反馈机制)
4.知道具有单击了triangle_strip的多维数据集后,就可以相应地弹出消息.
Ok. I can''t/won''t give you the code. But here is a way you could get this

1. Set up you App to draw using OpenGL
2. Draw the cubes and maintain the cubes faces (drawn as triangle_strips) in a list
3. Now you should handle mouse click events to know which triangle_strip is clicked (by using some hit-list feedback mechanism)
4. Once you know the cube having the clicked triangle_strip, you can pop-up message accordingly.



这篇文章使用System.Drawing,看看它:
http://www.daniweb.com/software-development/csharp/threads/369044/drawing-cubes-in-c-using-system.drawing [ http://msdn.microsoft.com/en-us/library/bb196414.aspx [ ^ ]

这个使用XNA并更高级:
http://msdn.microsoft.com/en-us/library/bb197293%28v = xnagamestudio.31%29.aspx [ ^ ]

希望对您有所帮助
Hi,
This post use System.Drawing, take a look at it:
http://www.daniweb.com/software-development/csharp/threads/369044/drawing-cubes-in-c-using-system.drawing[^]

and this one:
http://msdn.microsoft.com/en-us/library/bb196414.aspx[^]

this one uses XNA and is more advanced:
http://msdn.microsoft.com/en-us/library/bb197293%28v=xnagamestudio.31%29.aspx[^]

I hope it will help


这篇关于在C#Windows应用程序中绘制3D模型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆