Microsoft.DirectX.Direct3DX.dll中发生了类型为'Microsoft.DirectX.Direct3D.Direct3DXException'的未处理的异常 [英] An unhandled exception of type 'Microsoft.DirectX.Direct3D.Direct3DXException' occurred in Microsoft.DirectX.Direct3DX.dll

查看:116
本文介绍了Microsoft.DirectX.Direct3DX.dll中发生了类型为'Microsoft.DirectX.Direct3D.Direct3DXException'的未处理的异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好
我试图使用直接x显示3d对象,并且出现此错误

"Microsoft.DirectX.Direct3DX.dll中发生类型'Microsoft.DirectX.Direct3D.Direct3DXException'的未处理异常",并带有其他信息错误应用程序" 


在此方法中:

 公共  void  drawMesh(Object3D对象,矩阵垫)
        {
            
            object1.scale =  Vector3(scalex,scaley,scalez);
            
            object1.translation =  Vector3(transx,transy,transz);
            SetupLights( 100 ,-50,-100);

            _device.RenderState.CullMode = Cull.Clockwise;
            
            
                如果(objct.extddMatrls!= )
                {
                    _device.Transform.World = Matrix.RotationZ(rotz)* Matrix.RotationY(roty)* Matrix.RotationX(rotx)* Matrix.Scaling(object1.scale)* Matrix.Translation(object1.translation)* mat;
                     for ( int  count =  0 ; count <  objct.extddMatrls.Length; count ++)
                    {
                        _device.Material = objct.matrls [count];
                        _device.SetTexture( 0 ,objct.textre [count]);

                        objct.mesh.DrawSubset(count); // 在这里我得到了错误
                        
                    }
                } 



谢谢,祝您有美好的一天!!!!!!!!!!!!!!! 我找到了解决方案.问题在于我忘了添加这些方法:

device.beginSecene();
device.endScene();
device.Present();

仅此而已.
祝你有美好的一天


hi all
im trying to display 3d objectusing direct x and i get this error

"An unhandled exception of type 'Microsoft.DirectX.Direct3D.Direct3DXException' occurred in Microsoft.DirectX.Direct3DX.dll" with additional information "error application"


in this methode:

public void drawMesh(Object3D objct, Matrix mat)
        {
            
            object1.scale=new Vector3(scalex,scaley,scalez);
            
            object1.translation= new Vector3(transx, transy, transz);
            SetupLights(100, -50, -100);

            _device.RenderState.CullMode = Cull.Clockwise;
            
            
                if (objct.extddMatrls != null)
                {
                    _device.Transform.World = Matrix.RotationZ(rotz) * Matrix.RotationY(roty) * Matrix.RotationX(rotx) * Matrix.Scaling(object1.scale) * Matrix.Translation(object1.translation) * mat;
                    for (int count = 0; count < objct.extddMatrls.Length; count++)
                    {
                        _device.Material = objct.matrls[count];
                        _device.SetTexture(0, objct.textre[count]);

                        objct.mesh.DrawSubset(count);// here i got the error
                        
                    }
                }



thx and have nice day!!!!!

解决方案

salam guys
i found the solution.the probleme was that i forgot to add those methodes:

device.beginSecene();
device.endScene();
device.Present();

that''s all.
have a nice day


这篇关于Microsoft.DirectX.Direct3DX.dll中发生了类型为'Microsoft.DirectX.Direct3D.Direct3DXException'的未处理的异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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