Click here to Skip to main content
12,243,522 members (42,541 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C# DirectX 3D
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!!!!!
Posted 21-Jun-12 2:01am
Edited 21-Jun-12 2:08am
v2
Comments
sidali.kadi 21-Jun-12 9:08am
   
anyone can helps me?????????????

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

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
  Permalink  

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160426.1 | Last Updated 24 Jun 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100