SyntaxHighlighter

Wednesday 19 June 2013

Day 8: Improving the code, adding model sets

I added a bunch of code to manage the enabling/disabling the object sets, to make adding models simpler.

If you are adding a new demo onto an existing marker (i.e. under the second model set) you need to:

  1. Create the new addDemo method, using a placer node so that it can be enabled. Add this placer node to the appropriate arraylist of model set placer nodes (i.e. it'll be modelSet2Nodes as this demo is part of the second model set)
  2. modify addDemo method of object that originally used this marker, so that it uses a placer node that can be enabled disabled. Add the placer node to modelSet1Nodes.
  3. add call to new addDemo method inside CreateObjects()
  4. increase global variable numObjects by 1
  5. update config.txt with a new line for your new demo, bind it to the same marker as for the object using the existing marker.
Better instructions are on the way.

Today I basically added and refined a bunch of models into two sets that can be switched on the fly. In this way 10 marker cards can effectively show 20 models.

XNA is very picky about models. It doesn't accept anything other than .fbx or .x (rejects other formats as it doesn't have the correct content processor), and even with fbx models it is pretty hit and miss. Randomly it returns errors of access violation (although the models run fine when accessed on a different computer by 3ds max), or it won't apply textures, or all sorts of stuff.

Tomorrow I'll be looking at sound, should be interesting!

No comments:

Post a Comment

Note: only a member of this blog may post a comment.