🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

CD3DFile?

Started by
1 comment, last by Esap1 24 years, 6 months ago
Does anyone know how to Get the Vertices and Indices without knowing the name of the object in a .x file? Thanxs ALOT
Advertisement
Hi,

By the title of your post I am assuming you are using the file object provided in the sample DirectX sample code. Using that you can simply call CD3DFile::EnumObjects passing your own callback function to get all the data in the file. Then your callback will be called with a CD3DFileObject* parameter, call the GetMeshGeometry method then if there are vertices do what ever you want with them

If you are creating your own file object you need to use the IDirectXFileEnumObject and IDirectXFileObject interfaces to enumerate the data. The IDirectXFileEnumObject has a method GetNextDataObject, this will iterate every object in the file for you.
This can be a little complicated so I’m not going to attempt to explain it here.

I would just use the CD3DFile object provided possibly with a few modifications, no need to reinvent the wheel

Hope this helps
Thanx for responding but I cant exactly implement what your saying by looking at the function Parameters, Could you PLLEEEAAASE show me a little example, THANK YOU SOOO MUCH!

This topic is closed to new replies.

Advertisement