正在加载图片...
Vol.23 赵文广等:面向工程可视化仿真的VC+,OpenGL与3DS集成技术 ·565· meshobj->NumFaces-nv; meshobj->facelist=(H3dsFace * getmem(sizeof(H3dsFace)*nv); for(n=0;n<nv;n++) dread(&meshobj->facelist[n].p0,sizeof(word)); dread(&meshobj->facelist n].pl,sizeof(word)); dread(&meshobj->facelist[n].p2,sizeof(word)); dread(&meshobj->facelist[nl.flags,sizeof(word)); 图1 Open GL中绘制的挖掘机图 return (nv);/WG*/ Fig.1 Excavator in OpenGL } 4结论 读入当前形体对象的纹理映射坐标.纹理 坐标列表也是由1个表示顶点数目的整数开始, 把3DS模型应用于Open GL中,降低了用 接着是1组纹理坐标构成.每1组坐标由,y2 Open GL构造复杂模型的难度,减少了图形建 个浮点修值定义. 模的工作量.在矿山物流系统的可视化仿真系 void ReadMapList(H3dsMeshObj *meshobj){ 统研究中,实现了在VC+环境下用Open GL控 word nv; 制3DS挖掘机、卡车模型,得到了满意的三维动 int n; 画效果.同样,还可以编制AutoCAD等多种图 dread(&nv,sizeof(nv)); 形接口程序,把在AutoCAD等软件中建立的三 meshobj->NumMaps-nv; 维物体模型引入Open GL的应用程序中,由此 meshobj->maplist= 进行矿山物流系统等领域的可视化仿真. (H3dsMap *)getmem(sizeof(H3dsMap)*nv); 参考文献 for(n=0;n<nv;n++){ 1郭恒业,李晗静,王力明.虚拟现实技术中视景建模快 dread(&meshobj->maplist[n].u,sizeof(float32)); 捷实现的软件,计算机仿真,2000,17(3):52 dread(&meshobj->maplist[n].v,sizeof(float32)); 2李畅,黄心渊,丁预展虚拟现实中体视动画的生成算 法.北京科技大学学报,2000,22(3):274 3桥林,费正广,林杜,等.OpenGL程序设计,北京:清华 大学出版社,2000.197 读人数据后,可以用Open GL绘图语句进 4,David J Kruglinski,VC+技术内幕.北京:清华大学出 行绘制.图1是在OpenGL中绘制的挖掘机图 版社,1999 Integrating VC++,OpenGL and 3DS for Visual Simulation Applications in Engineering ZHAO Wenguang,LI Zhongxue,LI Cuiping Civil and Environment Engineering School,UST Beijing.Beijing 100083,China ABSTRACT Three dimensional representation of entities is one of the key technigues in visual simulation of systems.To facilitate the 3D realization of a visual simulation environment oriented to engineering applic- ations,an integration of various graphical programming techniques can be used.An integration method of VC++,OpenGL and 3DS is used to develop a mining oriented visual simulation application,including the data format of 3DS,the transformation of 3DS data structure into VC++format,and the 3D representation ofentities by OpenGL.Technical details of the integration method are described and some examples of program seg- ments with a visual presentation oriented to mining application are illustrated. KEY WORDS visualiztion;modeling;open GL;3DS
<<向上翻页
©2008-现在 cucdc.com 高等教育资讯网 版权所有