unable to get head tracking data from warp 920vr

Oct 9, 2012 at 12:09 PM

i write code to get pitch, yaw, and roll.

i have no error in my code but not response with warp 920

so can you tell me how do it

that my code


using System;
using System.Collections.Generic;
using System.Linq;
using System.Xml;

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;


using GoblinXNA;
using GoblinXNA.Graphics;
using GoblinXNA.SceneGraph;
using Model = GoblinXNA.Graphics.Model;
using GoblinXNA.Graphics.Geometry;
using GoblinXNA.Device.Capture;
using GoblinXNA.Device.Vision;
using GoblinXNA.Device.Vision.Marker;
using GoblinXNA.Device.Util;
using GoblinXNA.Physics;
using GoblinXNA.Helpers;
using GoblinXNA.Device.iWear;
using GoblinXNA.Device;
using GoblinXNA.Device.Generic;
using GoblinXNA.Shaders;

using GoblinXNA.UI.UI2D;

namespace iwear_test
{
    /// <summary>
    /// This is the main type for your game
    /// </summary>
    public class Game1 : Microsoft.Xna.Framework.Game
    {
        bool FULL_SCREEN = false;

        GraphicsDeviceManager graphics;
        SpriteFont sampleFont;

        Scene scene;
       // MarkerNode groundMarkerNode;
        //true
        bool stereoMode = false;

        iWearTracker iTracker;

        //RenderTarget2D stereoScreenLeft;
        //RenderTarget2D stereoScreenRight;
        //Rectangle leftRect;
        //Rectangle rightRect;
        //Rectangle leftSource;
        //Rectangle rightSource;
        SpriteBatch spriteBatch;
        Vector3 x1;
        Quaternion q1;
        Vector3 t1;
        //string identifier;

//float markerSize = 32.4f;
        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";

            //full screen

            if (FULL_SCREEN)
                graphics.IsFullScreen = true;
            else
            {
                graphics.PreferredBackBufferWidth = 1280;
                graphics.PreferredBackBufferHeight = 480;
            }
        }

        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            // TODO: Add your initialization logic here

            base.Initialize();

            // Initialize the GoblinXNA framework
            State.InitGoblin(graphics, Content, "");

            State.ThreadOption = (ushort)(ThreadOptions.MarkerTracking);

            // Initialize the scene graph
            scene = new Scene();
            // Set up the VUZIX's iWear VR920 for both stereo and orientation tracking
            SetupIWear();

        }
        

        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            sampleFont = Content.Load<SpriteFont>("Sample");

            base.LoadContent();
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            // TODO: use this.Content to load your game content here
        }


        /// <summary>
        /// Allows the game to run logic such as updating the world,
        /// checking for collisions, gathering input, and playing audio.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Update(GameTime gameTime)
        {
            // Allows the game to exit
            if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
                this.Exit();
            InputMapper.Instance.GetWorldTransformation(iTracker.Identifier).Decompose(out x1, out q1, out t1);

            forward = InputMapper.Instance.GetWorldTransformation(iTracker.Identifier).Forward;
            // TODO: Add your update logic here

            base.Update(gameTime);
        }
        Vector3 forward;

        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.Azure);
            spriteBatch.Begin();
            //spriteBatch.DrawString(sampleFont, "hhhhhh", new Vector2(20, 45), Color.Black);
            spriteBatch.DrawString(sampleFont, forward.ToString(), new Vector2(20, 45), Color.Black);
            spriteBatch.DrawString(sampleFont, x1.ToString(), new Vector2(20, 100), Color.Black);
            spriteBatch.DrawString(sampleFont,t1.ToString(), new Vector2(20, 150), Color.Black);
            DrawText();
            spriteBatch.End();
           
            // TODO: Add your drawing code here
            scene.Draw(gameTime.ElapsedGameTime, gameTime.IsRunningSlowly);
            RenderUI();
            DrawText();
    
            base.Draw(gameTime);
        }
        private void SetupIWear()
        {
            // Get an instance of iWearTracker
            iTracker = iWearTracker.Instance;
            // We need to initialize it before adding it to the InputMapper class
            iTracker.Initialize();
            // If not stereo, then we need to set the iWear VR920 to mono mode (by default, it's
            // stereo mode if stereo is available)
            if (stereoMode)
                iTracker.EnableStereo = true;
            // Add this iWearTracker to the InputMapper class for automatic update and disposal
            InputMapper.Instance.Add6DOFInputDevice(iTracker);
            // Re-enumerate all of the input devices so that the newly added device can be found
            InputMapper.Instance.Reenumerate();

           // identifier=iTracker.Identifier;
            
            //InputMapper.Instance.ge
        }

        private void SetupStereoCamera()
        {
            StereoCamera camera = new StereoCamera();

            // Load the right eye view matrix from a calibration file created in StereoCameraCalibration tool
            Matrix cameraRightView = Matrix.Identity;
            MatrixHelper.LoadMatrixFromXML("Wrap920_Stereo_Millimeter.xml", ref cameraRightView);

            camera.LeftView = Matrix.CreateLookAt(Vector3.Zero, -Vector3.UnitZ, Vector3.UnitY);
            camera.RightView = Matrix.Invert(cameraRightView);

            CameraNode cameraNode = new CameraNode(camera);

            scene.RootNode.AddChild(cameraNode);
            scene.CameraNode = cameraNode;
        }
        private void RenderUI()
        {
            UI2DRenderer.WriteText(Vector2.Zero, "Stereoscopic UI", Color.Red,
                sampleFont, Vector2.One, GoblinEnums.HorizontalAlignment.Center,
                GoblinEnums.VerticalAlignment.Top);
        }



    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Xml;

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;


using GoblinXNA;
using GoblinXNA.Graphics;
using GoblinXNA.SceneGraph;
using Model = GoblinXNA.Graphics.Model;
using GoblinXNA.Graphics.Geometry;
using GoblinXNA.Device.Capture;
using GoblinXNA.Device.Vision;
using GoblinXNA.Device.Vision.Marker;
using GoblinXNA.Device.Util;
using GoblinXNA.Physics;
using GoblinXNA.Helpers;
using GoblinXNA.Device.iWear;
using GoblinXNA.Device;
using GoblinXNA.Device.Generic;
using GoblinXNA.Shaders;

using GoblinXNA.UI.UI2D;

namespace iwear_test
{
    /// <summary>
    /// This is the main type for your game
    /// </summary>
    public class Game1 : Microsoft.Xna.Framework.Game
    {
        bool FULL_SCREEN = false;

        GraphicsDeviceManager graphics;
        SpriteFont sampleFont;

        Scene scene;
       // MarkerNode groundMarkerNode;
        //true
        bool stereoMode = false;

        iWearTracker iTracker;

        //RenderTarget2D stereoScreenLeft;
        //RenderTarget2D stereoScreenRight;
        //Rectangle leftRect;
        //Rectangle rightRect;
        //Rectangle leftSource;
        //Rectangle rightSource;
        SpriteBatch spriteBatch;
        Vector3 x1;
        Quaternion q1;
        Vector3 t1;
        //string identifier;

//float markerSize = 32.4f;
        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";

            //full screen

            if (FULL_SCREEN)
                graphics.IsFullScreen = true;
            else
            {
                graphics.PreferredBackBufferWidth = 1280;
                graphics.PreferredBackBufferHeight = 480;
            }
        }

        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            // TODO: Add your initialization logic here

            base.Initialize();

            // Initialize the GoblinXNA framework
            State.InitGoblin(graphics, Content, "");

            State.ThreadOption = (ushort)(ThreadOptions.MarkerTracking);

            // Initialize the scene graph
            scene = new Scene();
            // Set up the VUZIX's iWear VR920 for both stereo and orientation tracking
            SetupIWear();


            // If stereo mode is true, then setup stereo camera. If not stereo, we don't need to
            // setup a camera since it's automatically setup by Scene when marker tracker is
            // used. This stereo camera needs to be setup before setting up the marker tracker so
            // the stereo camera will have correct projection matrix computed by the marker tracker.
            //if (stereoMode)
               // SetupStereoCamera();

            // Set up the lights used in the scene
           // CreateLights();



            // Use the multi light shadow map shader for our shadow mapping
            // NOTE: In order to use shadow mapping, you will need to add 'MultiLightShadowMap.fx'
            // and 'SimpleShadowShader.fx' shader files to your 'Content' directory
            //scene.ShadowMap = new MultiLightShadowMap();

            // Create 3D objects
            //CreateObjects();
            // Create the ground that represents the physical ground marker array
            //CreateGround();
           
            //State.ShowFPS = true;
        }
       

        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            sampleFont = Content.Load<SpriteFont>("Sample");

            base.LoadContent();
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            // TODO: use this.Content to load your game content here
        }


        /// <summary>
        /// Allows the game to run logic such as updating the world,
        /// checking for collisions, gathering input, and playing audio.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Update(GameTime gameTime)
        {
            // Allows the game to exit
            if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
                this.Exit();
            InputMapper.Instance.GetWorldTransformation(iTracker.Identifier).Decompose(out x1, out q1, out t1);

            forward = InputMapper.Instance.GetWorldTransformation(iTracker.Identifier).Forward;
            // TODO: Add your update logic here

            base.Update(gameTime);
        }
        Vector3 forward;
        /// <summary>
        /// This is called when the game should draw itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.Azure);
            spriteBatch.Begin();
            //spriteBatch.DrawString(sampleFont, "hhhhhh", new Vector2(20, 45), Color.Black);
            spriteBatch.DrawString(sampleFont, forward.ToString(), new Vector2(20, 45), Color.Black);
            spriteBatch.DrawString(sampleFont, x1.ToString(), new Vector2(20, 100), Color.Black);
            spriteBatch.DrawString(sampleFont,t1.ToString(), new Vector2(20, 150), Color.Black);
            DrawText();
            spriteBatch.End();
          
            // TODO: Add your drawing code here
            scene.Draw(gameTime.ElapsedGameTime, gameTime.IsRunningSlowly);
            RenderUI();
            DrawText();
   
            base.Draw(gameTime);
        }
        private void SetupIWear()
        {
            // Get an instance of iWearTracker
            iTracker = iWearTracker.Instance;
            // We need to initialize it before adding it to the InputMapper class
            iTracker.Initialize();
            // If not stereo, then we need to set the iWear VR920 to mono mode (by default, it's
            // stereo mode if stereo is available)
            if (stereoMode)
                iTracker.EnableStereo = true;
            // Add this iWearTracker to the InputMapper class for automatic update and disposal
            InputMapper.Instance.Add6DOFInputDevice(iTracker);
            // Re-enumerate all of the input devices so that the newly added device can be found
            InputMapper.Instance.Reenumerate();

           // identifier=iTracker.Identifier;
           
            //InputMapper.Instance.ge
        }
        private void CreateObjects()
        {
            // Create a sphere geometry
            {
                GeometryNode sphereNode = new GeometryNode("Sphere");
                sphereNode.Model = new TexturedSphere(14, 20, 20);
                sphereNode.Model.ShadowAttribute = ShadowAttribute.ReceiveCast;
                //sphereNode.Model.Shader = new SimpleShadowShader(scene.ShadowMap);

                Material sphereMat = new Material();
                sphereMat.Diffuse = Color.Red.ToVector4();
                sphereMat.Specular = Color.White.ToVector4();
                sphereMat.SpecularPower = 20;

                sphereNode.Material = sphereMat;

                TransformNode sphereTrans = new TransformNode();
                sphereTrans.Translation = new Vector3(0, 0, 20);

                //groundMarkerNode.AddChild(sphereTrans);
                //sphereTrans.AddChild(sphereNode);
            }

           
        }
        private void SetupStereoCamera()
        {
            StereoCamera camera = new StereoCamera();

            // Load the right eye view matrix from a calibration file created in StereoCameraCalibration tool
            Matrix cameraRightView = Matrix.Identity;
            MatrixHelper.LoadMatrixFromXML("Wrap920_Stereo_Millimeter.xml", ref cameraRightView);

            camera.LeftView = Matrix.CreateLookAt(Vector3.Zero, -Vector3.UnitZ, Vector3.UnitY);
            camera.RightView = Matrix.Invert(cameraRightView);

            CameraNode cameraNode = new CameraNode(camera);

            scene.RootNode.AddChild(cameraNode);
            scene.CameraNode = cameraNode;
        }
        private void RenderUI()
        {
            UI2DRenderer.WriteText(Vector2.Zero, "Stereoscopic UI", Color.Red,
                sampleFont, Vector2.One, GoblinEnums.HorizontalAlignment.Center,
                GoblinEnums.VerticalAlignment.Top);
        }

        private void CreateLights()
        {
            // Create a directional light source
            LightSource lightSource = new LightSource();
            lightSource.Direction = new Vector3(1, -1, -1);
            lightSource.Diffuse = new Vector4(0.8f, 0.8f, 0.8f, 1);
            lightSource.Specular = new Vector4(0.6f, 0.6f, 0.6f, 1);

            // Create a light node to hold the light source
            LightNode lightNode = new LightNode();
            lightNode.CastShadows = true;
            lightNode.LightProjection = Matrix.CreatePerspectiveFieldOfView(MathHelper.PiOver4,
                1, 1f, 500);
            // Add an ambient component
            lightNode.AmbientLightColor = new Vector4(0.3f, 0.3f, 0.3f, 1);
            lightNode.LightSource = lightSource;

            // Add this light node to the root node
            //groundMarkerNode.AddChild(lightNode);
        }
        private void DrawText()
        {
           // spriteBatch.DrawString(sampleFont, "Cannon power: 100", new Vector2(20, 45), Color.White);
        }
        //private void CreateGround()
        //{
        //    GeometryNode groundNode = new GeometryNode("Ground");

        //    groundNode.Model = new TexturedBox(340, 200, 0.1f);

        //    // Set this ground model to act as an occluder so that it appears transparent
        //    groundNode.IsOccluder = true;

        //    // Make the ground model to receive shadow casted by other objects with
        //    // CastShadows set to true
        //    groundNode.Model.ShadowAttribute = ShadowAttribute.ReceiveOnly;
        //    groundNode.Model.Shader = new SimpleShadowShader(scene.ShadowMap);

        //    Material groundMaterial = new Material();
        //    groundMaterial.Diffuse = new Vector4(0.5f, 0.5f, 0.5f, 0.5f);
        //    groundMaterial.Specular = Color.White.ToVector4();
        //    groundMaterial.SpecularPower = 20;

        //    groundNode.Material = groundMaterial;

        //    groundMarkerNode.AddChild(groundNode);
        //}
    }
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Xml;

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;


using GoblinXNA;
using GoblinXNA.Graphics;
using GoblinXNA.SceneGraph;
using Model = GoblinXNA.Graphics.Model;
using GoblinXNA.Graphics.Geometry;
using GoblinXNA.Device.Capture;
using GoblinXNA.Device.Vision;
using GoblinXNA.Device.Vision.Marker;
using GoblinXNA.Device.Util;
using GoblinXNA.Physics;
using GoblinXNA.Helpers;
using GoblinXNA.Device.iWear;
using GoblinXNA.Device;
using GoblinXNA.Device.Generic;
using GoblinXNA.Shaders;

using GoblinXNA.UI.UI2D;

namespace iwear_test
{
    /// <summary>
    /// This is the main type for your game
    /// </summary>
    public class Game1 : Microsoft.Xna.Framework.Game
    {
        bool FULL_SCREEN = false;

        GraphicsDeviceManager graphics;
        SpriteFont sampleFont;

        Scene scene;
       // MarkerNode groundMarkerNode;
        //true
        bool stereoMode = false;

        iWearTracker iTracker;

        //RenderTarget2D stereoScreenLeft;
        //RenderTarget2D stereoScreenRight;
        //Rectangle leftRect;
        //Rectangle rightRect;
        //Rectangle leftSource;
        //Rectangle rightSource;
        SpriteBatch spriteBatch;
        Vector3 x1;
        Quaternion q1;
        Vector3 t1;
        //string identifier;

//float markerSize = 32.4f;
        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";

            //full screen

            if (FULL_SCREEN)
                graphics.IsFullScreen = true;
            else
            {
                graphics.PreferredBackBufferWidth = 1280;
                graphics.PreferredBackBufferHeight = 480;
            }
        }

        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            // TODO: Add your initialization logic here

            base.Initialize();

            // Initialize the GoblinXNA framework
            State.InitGoblin(graphics, Content, "");

            State.ThreadOption = (ushort)(ThreadOptions.MarkerTracking);

            // Initialize the scene graph
            scene = new Scene();
            // Set up the VUZIX's iWear VR920 for both stereo and orientation tracking
            SetupIWear();


            // If stereo mode is true, then setup stereo camera. If not stereo, we don't need to
            // setup a camera since it's automatically setup by Scene when marker tracker is
            // used. This stereo camera needs to be setup before setting up the marker tracker so
            // the stereo camera will have correct projection matrix computed by the marker tracker.
            //if (stereoMode)
               // SetupStereoCamera();

            // Set up the lights used in the scene
           // CreateLights();



            // Use the multi light shadow map shader for our shadow mapping
            // NOTE: In order to use shadow mapping, you will need to add 'MultiLightShadowMap.fx'
            // and 'SimpleShadowShader.fx' shader files to your 'Content' directory
            //scene.ShadowMap = new MultiLightShadowMap();

            // Create 3D objects
            //CreateObjects();
            // Create the ground that represents the physical ground marker array
            //CreateGround();
            
            //State.ShowFPS = true;
        }
        

        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            sampleFont = Content.Load<SpriteFont>("Sample");

            base.LoadContent();
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            // TODO: use this.Content to load your game content here
        }


        /// <summary>
        /// Allows the game to run logic such as updating the world,
        /// checking for collisions, gathering input, and playing audio.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Update(GameTime gameTime)
        {
            // Allows the game to exit
            if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
                this.Exit();
            InputMapper.Instance.GetWorldTransformation(iTracker.Identifier).Decompose(out x1, out q1, out t1);

            forward = InputMapper.Instance.GetWorldTransformation(iTracker.Identifier).Forward;
            // TODO: Add your update logic here

            base.Update(gameTime);
        }
        Vector3 forward;
        /// <summary>
        /// This is called when the game should draw itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.Azure);
            spriteBatch.Begin();
            //spriteBatch.DrawString(sampleFont, "hhhhhh", new Vector2(20, 45), Color.Black);
            spriteBatch.DrawString(sampleFont, forward.ToString(), new Vector2(20, 45), Color.Black);
            spriteBatch.DrawString(sampleFont, x1.ToString(), new Vector2(20, 100), Color.Black);
            spriteBatch.DrawString(sampleFont,t1.ToString(), new Vector2(20, 150), Color.Black);
            DrawText();
            spriteBatch.End();
           
            // TODO: Add your drawing code here
            scene.Draw(gameTime.ElapsedGameTime, gameTime.IsRunningSlowly);
            RenderUI();
            DrawText();
    
            base.Draw(gameTime);
        }
        private void SetupIWear()
        {
            // Get an instance of iWearTracker
            iTracker = iWearTracker.Instance;
            // We need to initialize it before adding it to the InputMapper class
            iTracker.Initialize();
            // If not stereo, then we need to set the iWear VR920 to mono mode (by default, it's
            // stereo mode if stereo is available)
            if (stereoMode)
                iTracker.EnableStereo = true;
            // Add this iWearTracker to the InputMapper class for automatic update and disposal
            InputMapper.Instance.Add6DOFInputDevice(iTracker);
            // Re-enumerate all of the input devices so that the newly added device can be found
            InputMapper.Instance.Reenumerate();

           // identifier=iTracker.Identifier;
            
            //InputMapper.Instance.ge
        }
        private void CreateObjects()
        {
            // Create a sphere geometry
            {
                GeometryNode sphereNode = new GeometryNode("Sphere");
                sphereNode.Model = new TexturedSphere(14, 20, 20);
                sphereNode.Model.ShadowAttribute = ShadowAttribute.ReceiveCast;
                //sphereNode.Model.Shader = new SimpleShadowShader(scene.ShadowMap);

                Material sphereMat = new Material();
                sphereMat.Diffuse = Color.Red.ToVector4();
                sphereMat.Specular = Color.White.ToVector4();
                sphereMat.SpecularPower = 20;

                sphereNode.Material = sphereMat;

                TransformNode sphereTrans = new TransformNode();
                sphereTrans.Translation = new Vector3(0, 0, 20);

                //groundMarkerNode.AddChild(sphereTrans);
                //sphereTrans.AddChild(sphereNode);
            }

            
        }
        private void SetupStereoCamera()
        {
            StereoCamera camera = new StereoCamera();

            // Load the right eye view matrix from a calibration file created in StereoCameraCalibration tool
            Matrix cameraRightView = Matrix.Identity;
            MatrixHelper.LoadMatrixFromXML("Wrap920_Stereo_Millimeter.xml", ref cameraRightView);

            camera.LeftView = Matrix.CreateLookAt(Vector3.Zero, -Vector3.UnitZ, Vector3.UnitY);
            camera.RightView = Matrix.Invert(cameraRightView);

            CameraNode cameraNode = new CameraNode(camera);

            scene.RootNode.AddChild(cameraNode);
            scene.CameraNode = cameraNode;
        }
        private void RenderUI()
        {
            UI2DRenderer.WriteText(Vector2.Zero, "Stereoscopic UI", Color.Red,
                sampleFont, Vector2.One, GoblinEnums.HorizontalAlignment.Center,
                GoblinEnums.VerticalAlignment.Top);
        }

        private void CreateLights()
        {
            // Create a directional light source
            LightSource lightSource = new LightSource();
            lightSource.Direction = new Vector3(1, -1, -1);
            lightSource.Diffuse = new Vector4(0.8f, 0.8f, 0.8f, 1);
            lightSource.Specular = new Vector4(0.6f, 0.6f, 0.6f, 1);

            // Create a light node to hold the light source
            LightNode lightNode = new LightNode();
            lightNode.CastShadows = true;
            lightNode.LightProjection = Matrix.CreatePerspectiveFieldOfView(MathHelper.PiOver4,
                1, 1f, 500);
            // Add an ambient component
            lightNode.AmbientLightColor = new Vector4(0.3f, 0.3f, 0.3f, 1);
            lightNode.LightSource = lightSource;

            // Add this light node to the root node
            //groundMarkerNode.AddChild(lightNode);
        }
        private void DrawText()
        {
           // spriteBatch.DrawString(sampleFont, "Cannon power: 100", new Vector2(20, 45), Color.White);
        }
        //private void CreateGround()
        //{
        //    GeometryNode groundNode = new GeometryNode("Ground");

        //    groundNode.Model = new TexturedBox(340, 200, 0.1f);

        //    // Set this ground model to act as an occluder so that it appears transparent
        //    groundNode.IsOccluder = true;

        //    // Make the ground model to receive shadow casted by other objects with
        //    // CastShadows set to true
        //    groundNode.Model.ShadowAttribute = ShadowAttribute.ReceiveOnly;
        //    groundNode.Model.Shader = new SimpleShadowShader(scene.ShadowMap);

        //    Material groundMaterial = new Material();
        //    groundMaterial.Diffuse = new Vector4(0.5f, 0.5f, 0.5f, 0.5f);
        //    groundMaterial.Specular = Color.White.ToVector4();
        //    groundMaterial.SpecularPower = 20;

        //    groundNode.Material = groundMaterial;

        //    groundMarkerNode.AddChild(groundNode);
        //}
    }
}

Coordinator
Oct 9, 2012 at 6:40 PM

VR920 or Wrap920 AR? First of all, you will need to install VR Manager from Vuzix. VR920 has embedded tracker, but Wrap920 AR needs an external tracker so if you don't have it (it's a separate hardware), then you won't get any tracking data.

Ohan

Oct 9, 2012 at 7:56 PM

thanks Ohan for reply

but I want to make a xna game that use wrap 920 vr so i want to get pitch, yaw, and roll to change camera of game depend on it .

can you help me how to get that information.

Coordinator
Oct 9, 2012 at 11:15 PM

It has nothing to do with XNA. I'm asking whether you installed their driver & tracker properly. There is no Wrap920VR. It's either VR920 or Wrap920AR. See my comment carefully again.

Ohan

Oct 10, 2012 at 9:34 AM

yes i have installed the driver and the tracker and when i open the VR manager it reads the data from the glasses

Dec 12, 2012 at 7:30 PM

in my case, i have Wrap920 AR and external tracker , has isntalled driver and sdk but the device dont register information of pich yaw or roll,

i acces to them use pich = iWearTracker.Instance.Pitch;.

plis help me