Jump to content
  • Advertisement


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


FVF question

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

Being new to DirectX programming, I have a couple questions In the help files referencing defining a custom vertex type there is the following code followed by my tentative version:
    FLOAT x, y, z, rhw; // The transformed position for the vertex.

    DWORD color;        // The vertex color.



//Or can it be like this?

    FLOAT myx, myy, myz, myrhw; // The transformed position for the vertex.

    DWORD mycolor;        // The vertex color.

//Do I need to change the #define statement too?


Is what I did in the bottom half of that code legal or neccessary? The second part to my question is: My "source" for the vertices is going to be read out of a running 3D modelling application. As far as the DirectX end of the operation is concerned, I could be reading them out of a file. What functions should I look at in the DX8 SDK helpfiles that would help me group the vertices into the different models I would be importing, and then getting them ready to render in my DX interface? Thanks, [edited by - matthewb on December 24, 2002 2:58:26 PM]

Share this post

Link to post
Share on other sites
First of all, if I understood your first question right, the lower part of that code is legal but unnecessary (since the two are the same). The reason why you want to have multiple FVFs is when they differ, i.e some only have position, some have position and color etc, so you could define all possible FVFs and then use them wherever you like (instead of having something like D3DFVF_PLAYER and D3DFVF_ENEMY when they are the same). Also, dunno if you asked this, your FVF doesn''t need to have the same name as the struct. As for the second question, I''m not sure on that either. I think you should look up "D3DXLoadMeshFromX" for loading .x files (model files).

Merry christmas!

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!