当前位置:编程学习 > 网站相关 >>

关于openGL中调用,3ds模型的问题!我要做机器交互式仿真

我在solidworks或者用autocad绘制复杂的三维机器零件,然后转化到3dmax里面渲染,并设置好坐标,但是导出.3ds文件,在opengl里调用,但是坐标混乱了,怎么回事啊?急急啊,请高手们帮一下!
LoadT8("木地板027.bmp", g_cactus[0]); //地面帖图  
m_3ds=new CLoad3DS();                            //创建3DS类
load3dobj("3ds/","x1.3DS",0);             //调入底座(A)
load3dobj("3ds/","x2.3DS",1);
load3dobj("3ds/","x3.3DS",2);
以上是我调入3d的程序
怎么组装起来呢,就是重绘后要把各个零件组装起来,因为我在3dmax里面我已经设置好坐标原点
现在:static float shoulder=0;                      //加入三个模块
    static float elbow=0;
    static float wrist=0;
    
glPushMatrix();
     //加入三个模块
/*glTranslatef(0.0f,0.0f,0.0f);
glRotatef(shoulder,0.0,0.0,1.0);
glPushMatrix();
    m_baiscobj->Scene(0,0,0,0,0, 0,0.1f);     //0.01f代表此时单位比例为100mm=1.0f
glPopMatrix();*/
    
    glTranslatef(0.0f,3.0f,0.0f);
    glRotatef(elbow,0.0,1.0,0.0);
    glPushMatrix();
m_baiscobj->Scene(1,0,0,0,0,0,0.1f);  
glPopMatrix();

    glTranslatef(0.5f,1.7f,-2.0f);
    glRotatef(wrist,1.0,0.0,0.0);
    glPushMatrix();
m_baiscobj->Scene(2,0,0,0,0,0,0.1f);    
大家可以看到,用坐标移动tanslate,和旋转rote等,可是一调到opengl漫游里来,原来的坐标乱了!!请求帮助
          --------------------编程问答-------------------- --------------------编程问答-------------------- --------------------编程问答-------------------- --------------------编程问答-------------------- --------------------编程问答-------------------- --------------------编程问答-------------------- --------------------编程问答-------------------- 高手帮忙:http://topic.csdn.net/u/20100513/22/e5fd9fee-ec26-44cd-b61c-28ce627e52f1.html --------------------编程问答-------------------- 要在3dmax里为每一个3DS设置一个相对原点的坐标
补充:云计算 ,  OpenAPI
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,