
CD3DFile?
Does anyone know how to Get the Vertices and Indices without knowing the name of the object in a .x file?
Thanxs ALOT

January 17, 2000 10:17 PM
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
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
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement