Click here to Skip to main content
Rate this: bad
good
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 at 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
0 OriginalGriff 350
1 Jochen Arndt 190
2 Richard MacCutchan 135
3 Sergey Alexandrovich Kryukov 120
4 DamithSL 95
0 OriginalGriff 6,045
1 DamithSL 4,611
2 Maciej Los 4,087
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,310


Advertise | Privacy | Mobile
Web04 | 2.8.141220.1 | Last Updated 24 Jun 2012
Copyright © CodeProject, 1999-2014
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