Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

chopov

Letter

This topic is 6016 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, fellows! Can you give me some code written on C++ and using Direct3D Immediate Mode execute buffers. I prefer the code to be working. Remarks: I have the code of Microsoft written by Collin McCarthney. However there''s just one rotating triangle in it. I have implemented a 3D viewer using Direct3D Immediate Mode execute buffers. If I handle the vertex normals by myself and call after each transform IDirect3DExecuteBuffer->Lock() and fill the vertex normals coordinates by myself all works perferctly. When I let Direct3D rotate the mesh and handle the vertex normals the things look very poor - it seems as if the Z-buffer does not work. I tried everything - changing the z-coordinates of the verteices and/or the normals, multiplying the world matrix''s Y-coordinates by -1, transforming the mesh, changing the direction of the face culling to "clockwise", changing the triangles'' indeces and so on. Nothing helped. That''s why I am writing to this forum (with hope). One could think: "Why dont you write your code using DirectX 8.0?" I am doing this at this very moment. However execute buffers remain part of Direct3D and I see no reason to break one of the main principles of COM architecture - support for older interfaces. Otherwise, there will be no sence of COM at all save for the fact that COM reuse binary code, will be? Best regards! Apostol Chopov

Share this post


Link to post
Share on other sites
Advertisement
....

in the case of DX.. break your rule... there''s no reason at all to try and support "older versions of d3d" as everyone installs the newest version of dx when it comes out. (in what is the proper use of the rule, d3d supports older programs that were written targeting earlier versions of the api)

I''d say that I need to see some code to help you.. except that I don''t know much about programming for older versions of DX. In other words, code it for dx8, and then if you''re still having a problem I might be able to help






Share this post


Link to post
Share on other sites
The problem might be in your projection matrix. Set your near clipping plane to 1.0f or more and see if it helps.

I would forget about targeting old DirectX versions and concentrate on DX8, if I were you.

Share this post


Link to post
Share on other sites
Hello, fellows!

By the way I managed to fix the problem by myself. What was all the fuss about?
I set the worldMatrix._43 member to zero, which is unacceptable for DirectX. I have revised my linear algebra and found out that worldMatrix._43 must not be less than zero. I constructed matrix objects of my own, make all transformations using them and then substituting the resulting matrix in the worldMatrix. However, I set the worldMatrix._43 to 0.5. All went perfect! Anyway, thank you for your cooperation!

Apostol Chopov

Sofia, Bulgaria, Eastern Europe

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!