How to make VR920 SDK work with Visual Studio 2008 SP1 and XNA 3.0
Vuzix Forums
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      



How to make VR920 SDK work with Visual Studio...Expand / Collapse
Author
Message
Posted 1/18/2009 11:09:12 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 3/20/2009 8:10:48 AM
Posts: 3, Visits: 19

When you try to use the SDK (vr920_xna_stereoscopy) with VS2008 & XNA 3.0 you get an error during VS conversion wizard and it will crash if you try to run it after you fix the upgrade issue
 
It is not an error in the SDK
, I believe it is caused by Microsoft having changed the way XNA 3.0 handles loading of FBX files: http://blogs.msdn.com/shawnhar/archive/2008/09/18/fbx-improvements-in-xna-game-studio-3-0.aspx
 
Luckily
there is a quite easy fix to make the SDK work. It may not look as good as intended originally (textures seems to be missing) but the Vuzix Stuff works well enough, so you can use it to understand what to do yourself. After I got this problem solved I was able to make my own code work really well with nice textures and all in a couple of hours
 
Steps to fix:
·        When you run VS2008 upgrade wizard it fails to convert the ShatterEffectWindows project
·        Just right-click “ShatterEffect” project in solution and remove it.
·        Go to the ShatterEffect folder and rename the folder “ShatterEffect” to e.g. ShatterEffect_old
·        Add new Windows Game (3.0 ) to the solution called ShatterEffect, delete the default Game1.cs created & program.cs
·        Copy ShatterEffectGame.cs, /content/*.fbx and /content/*.tga from ShatterEffect_old to the same location in the newly created project
·        By using “add existing item” add ShatterEffectGame.cs & the content files to the correct folders in the newly created project
·        Change project properties (application tab) so that startup object=ShatterSample.Program
·        Right-click ShatterEffect project in solution explorer and “set it as startup program”
·        You should now be able to do a clean compile
·        If you run the program it will however freeze up due to a crash in the SetupEffect method
·        What happens is that it fails on trying to access the parameters effects in the fbx file, probably due to a Microsoft change in the FBX loader
·        If you want to debug the error you have to disable full-screen, then it does not crash but breaks at correct error in debugger

A quick fix for this just to get the SDK working is to insert the following code at the end of the LoadContent method in ShatterEffectGame class

//HACK: Load effect into model after FBX file is loaded to get around XNA 3.0 change in FBX loader
Effect
loadEffect = Content.Load<Effect>("ShatterEffect");
foreach (ModelMesh mesh in model.Meshes){
    foreach (ModelMeshPart part in mesh.MeshParts){
        part.Effect = loadEffect;
    }
}


As mentioned textures does not seem to load properly but at least you can use the SDK and learn the code for getting the VR920 working in 3D

Above tested on VS2008 SP1 + Win XP + XNA 3.0, all fully patched u

Happy Coding

Jakob L.

Post #3979
Posted 1/25/2009 7:25:03 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 3/20/2009 8:10:48 AM
Posts: 3, Visits: 19
Posted "ready for reuse" sample code which works perfectly without the issue mentioned above: http://forums.vuzix.com/Topic3999-15-1.aspx

Happy Coding

Jakob

Post #4035
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: TechSupport, Daddo, Tech_Support

PermissionsExpand / Collapse

All times are GMT -5:00, Time now is 6:40am

Powered By InstantForum.NET v4.1.4 © 2010
Execution: 0.031. 9 queries. Compression Enabled.