Roll up, roll up, get your replacement hammers here…

Here is the sample I was working on when I realized that Model is a hammer. And here is a second sample released in reaction to that realization.

Comments (5)

  1. Ultrahead says:

    No so fast! … there’s one task left: to close this comment:

    Cheers! 😉

  2. Kehdar says:

    Thanks for the great sample, mesh istancing and the other September samples are great,

    and they are exactly what I neeed for my project 🙂

    Since you are involved in the content ipeline, maybe you can help me with a little problem.

    I’m missing something about content pipeline, from what I could understand the ContentTypeWriter class takes care to write our custom class to a XNB file, what I can’t understand is what fills our custom class.

    The particle3Dsample load the data from an xml file, but seems like the data appears from thin air (I guess it uses the xml tag as variables name) since it uses only 2 classes ParticleSettingsContent (that has no method to read from a file) and ParticleSettingWriter(that only writes data to the output file).

    All the other samples I found are builded on the model importer so they process the data from the NodeContent class, but if I want to read a totally new type of content what should I pass to the ContentProcessor?

    In a word where should I read my file and put it inside my custom class?

    Thanks in advance for any help.

    And thanks again to you and all the XNA team for the great work.

  3. ShawnHargreaves says:

    Our original Particle 3D sample just used hard-coded settings. The separate tutorial on extending it to use the Content Pipeline explains how the XML data is loaded in the accompanying document, which says:

    “We don’t need to bother writing our own ContentImporter, because XNA comes with a built-in XmlImporter that will do just fine for what we need.”

    If you want to import some other type that is not covered by any of the built in importers, you can write your own custom ContentImporter class to read in the data.

  4. Kehdar says:

    Thank Shawn.

    The ContentImporter class is exactly what I was looking for.

    In regard of the particles example, sorry I totally overlooked that part :p

  5. SaintD says:

    This replacement to the model class is very cool. I would really like to see you extend it to do two things. First, add a contructor that allows the user to create a model programatically from modelparts. Second, show how to save the model back out to .X format. It would be generally useful, and a really good example of how to use XNA. I see a lot of examples of cool things you can do in XNA. Saddly most of the code isn’t very good at a design level. Your code is the best example of how to use XNA with solid OOP principles.

Skip to main content