Click here to Skip to main content
15,887,435 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
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:
C#
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!!!!!
Posted
Updated 21-Jun-12 1:08am
v2
Comments
sidali.kadi 21-Jun-12 9:08am    
anyone can helps me?????????????

1 solution

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
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900