Archived

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

Some questions about meshes and stuff

This topic is 5798 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 have a few questions about the ID3DXMesh interface and it''s uses. If some1 could please take the time to answer them. I''ve looked around but couldn''t find the answers. There are a bunch of helper functions that create meshes that you can load into a LPD3DXMesh object. The one I''m struggling with is the D3DXCreateTextA function. It creates a mesh from given values and text. I have a few q''s about this: 1.) How do you use the 2nd parameter. It wants the hdc and I''m assuming that you have to somehow create a font and select it into the hdc. What I''m doing is creating an hfont and then using the GetStockObject function I get the default system font. Then I use the SelectObject function to select it into the hdc. Am I doing it correctly? 2.) What does the 4th parameter mean. It says its deviation and then says maximum chordal deviation from true font outlines. Could someone explain that? I also have two questions about the ID3DXMesh interface functions. 3.) How would I render the object after I load it into this interface. Would I use the GetVertexBuffer and GetIndexBuffer function to load it into vertex and index buffers? Then would I use the GetFVF function to get the custom fvf of the vertices? After I would load it if that''s the correct way, how would I know what type of primitive to draw. Triangle strips, lists, fans, how do you know? Or is there another way like using DrawSubset or something. If it is using DrawSet, what does DrawSubset actually do. It''s confusing the heck out of me. 4.) I notices the optomize functions. There are two of them. I was wondering which one I use. Or do I use both. The one is called Optomise and the other is OptomiseInPlace or something. What''s the difference? I know I''m asking a lot and I''m really sorry. I''m been trying to figure this out over time but I have never fully gotten the grasp. Also, I saw the CD3DXFont class but I didn''t want to use it because it would be better trying to do it''s features by myself. Please I would be very grateful if someone could answer. Thanks in advance. [Edited by - kmsixpence on October 18, 2005 2:45:02 PM]

Share this post


Link to post
Share on other sites
About text:
Use the CD3DFont class in the SDK over the D3DX font classes.

About meshes:
The easiest way is to use DrawSubset. The mesh object keeps track of what faces in your mesh are affected by which materials. DrawSubset draws each subset that is related to a given material.

You can get the pointers to the buffers and draw them yourself. This gives you alot more flexibility, but it sounds like you''re just getting started, so start with DrawSubset.

I personally wouldn''t bother with optimize yet. Here''s my rationale: as you ramp up you''ll learn more and more about what''s going on in meshes, etc. At that point, you''ll be able to make your own conclusions about what''s best. For now, optimize is a distraction - stick with the basics.

Share this post


Link to post
Share on other sites