Down to the CodeYou know most of the code from the second tutorial First Steps to Animation, so we can concentrate on the new X file code. OneTimeSceneInit()Loading an object should happen in the OneTimeSceneInit() method of your main file:
After allocating the X file class, we could load the X file and search for the BOID_Root Frame template and later for the FrameTransformMatrix template to get the transformation matrix. That's easy ... isn't it? To store the class pointer in the structure of the object, I've expanded the structure used by the objects like this:
You'll find it at the beginning of the objects.cpp file. Render()To render the X files, a simple call to CD3DFile::Render() has to be performed:
Ok, that wasn't difficult. FinaleRumours tell us that the X file support in DirectX 8 will be greatly enhanced. There should be a Maya and a 3D Studio Max X file exporter with source. New X file handling routines will be provided with Direct3D's utility library, Direct3DX. So your time has been well-spent learning the ins and outs of the X file format and the simple interface provided by the Direct3D 7 Framework. I hope you enjoyed our trip to the X file format. This will be a work in progress in the future. If you find any mistakes or if you have any good ideas to improve this tutorial or if you dislike or like it, give me a sign at wolf@direct3d.net. © 1999-2001 Wolfgang Engel, Mainz, Germany |