Archived

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

Using D3DX

This topic is 5535 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

I''ve found that almost every tutorial or resource I''ve seen on DirectX uses D3DX extensively to do almost everything - lighting, matrix transformation, mesh loading... but I find that when I''m using D3DX, I don''t really know what I''m doing - I can understand what is happening (it makes pretty lights and it makes the boxes go spinning round and round), but I don''t know why it''s happening. In 2D programming, I always knew what was going on - I may not have written the circle drawing function, but I certainly knew how it was drawing it circle - but in 3D, I have no idea how D3DX is loading the mesh or what it''s doing to display it. I think I could probably translate a point in 3D space into a 2D pixel coordinate if I understood how the projection transformation matrix worked, but since all the tutorials seem to tell me to use D3DX and don''t worry about it, I really have no idea... So, what I''m trying to ask is, am I better off taking the time to find a good resource which codes its own routines for matrix transformation and lighting, so that I can properly understand what I''m doing, or should I just stick with D3DX for simplicity''s sake and hope that everything just fits together later?

Share this post


Link to post
Share on other sites
A tutorial is not meant to show you how everything work in detail. A tutorial has one purpose, showing you the big picture of how to do something step by step.

If a tutorial is about rotation. It''s going to give you the code and explain you how to use the functions for rotation. It won''t go into details for every single line of code, like projection matrices, else it would loose its simplicity and would become overly complex for those only seeking how to rotate.

If you want to know how things work behind D3DX, try searching about 3d graphics theories instead of tutorials. Reading a book on linear algebra will help a lot.

______________________________
Oooh, you found the horadric cube!

Share this post


Link to post
Share on other sites
you should try to learn what it''s doing, but you should also use D3DX. For example, you should probably try to learn what it means to multiply two matrices and why you would do it, etc. BUT.. don''t write your own matrix multiplication routine - the D3DX version will be much more optimized.

In regards to meshes, etc. you might want to go a little deeper. For instance, I like to use D3DX to load a mesh, but then I extract the buffers and render it without D3DX. Once you understand what it''s doing you can make decent decisions about when to use it.

To sum up - yes, try to learn, but remember that using D3DX is often the optimal approach, especially in regards to the pure math stuff (matrices, etc.)

Author, "Real Time Rendering Tricks and Techniques in DirectX", "Focus on Curves and Surfaces"

Share this post


Link to post
Share on other sites