There's Goblins in my XNA! (No, not that kind...)
- Posted: Jun 13, 2011 at 6:00AM
- 7,220 views
Today we're going to look at something that does not use the bleeding edge/beta versions, something that requires a little download assembly to get working, but with a description like this how can I pass it up?
... uses a scene graph to support 3D scene manipulation and rendering, mixing real and virtual imagery. 6DOF (six-degrees-of-freedom) position and orientation tracking is accomplished using the ALVAR or ARTag marker-based camera tracking package with DirectShow or PGRFly (for Point Grey cameras), and InterSense hybrid trackers. In addition to regular desktop and hand-held computer displays, Goblin XNA also supports the Vuzix iWear VR920 head-worn display in monoscopic and stereoscopic modes, along with its 3DOF orientation tracker. Physics is supported through the Newton Game Dynamics library, and networking through the Lidgren library. Goblin XNA also includes a 2D GUI system to allow the creation of classical 2D interaction components.
Goblin XNA is a platform for research on 3D user interfaces, including mobile augmented reality and virtual reality, with an emphasis on games. It is written in C# and based on the Microsoft XNA platform. Goblin XNA inherits some of the goals of the earlier Goblin project, but with a shift in emphasis toward core 3D user interface functionality, leveraging the existing functionality of DirectX 3D game engines and development environments. The platform currently supports 6DOF (six degree of freedom) position and orientation tracking using marker-based camera tracking through ARTag with OpenCV or DirectShow, and InterSense hybrid trackers. Physics is supported through BulletX and Newton Game Dynamics. Networking is supported through Lidgren library. Goblin XNA also includes a 2D GUI system to allow the creation of classical 2D interaction components.
Goblin XNA AR Racing Game
The Goblin XNA AR Racing Game is an augmented reality mod of the XNA Racing Game Starter Kit. It is the first game being created using Goblin XNA, and demonstrates the use of fiducial tracking, 2.5D and 3D widgets, and assorted 3D user interface techniques. The Goblin XNA AR Racing Game uses an optically tracked physical gameboard, controller, and tokens. Instead of racing around a preset virtual track, the driver must pass a sequence of waypoints, while avoiding obstacles. Waypoints and obstacles are attached to physical tokens that can be moved dynamically during gameplay to rearrange the course.
The user drives a virtual car with a hand-held controller on a tracked physical gameboard.
Waypoints and obstacles can be attached to physical tokens and moved during gameplay.
Goblin XNA Domino Knockdown
The user fires balls at a board filled with dominoes, trying to knock all the dominos off the board.
3D User Interface Design
Buildings overlaid on tracked image of urban site are selected using a two-handed controller created from a hand-held box covered with tracker markers.
Tracked finger selects from fisheye menu of buildings.
Goblin XNA (Codeplex)
Goblin XNA is a platform for research on 3D user interfaces, including mobile augmented reality and virtual reality, with an emphasis on games. It is written in C# and based on Microsoft XNA Game Studio 3.1.
The latest release (beta) is version 3.5.1, released on 1/4/11. For details of changes, please see the ReleaseNotes.txt in the distribution.
We will release version 4.0 sometime mid or late 2011 that will support XNA Game Studio 4.0.
We're currently distributing closed beta for Goblin XNA 4.0 (as of 3/14/2011). Please contact firstname.lastname@example.org if you want to try it out.
Before version 4.0, we will make final release v3.6 using XNA 3.1, and the release will contain more "nicer looking" tutorials, enhanced shadow mapping, simple AI (flocking, chasing, finding shortest path, etc), and OpenCV 2.1 support.
Here are the videos of some interesting games we have developed using Goblin XNA:
The download is nicely complete, with installation and usage guide docs, src for the library and a number of tutorials.
The assembly required is that there's a some third party downloads/projects you'll need to get, compile and copy. This is well covered in the included two page Installation Guide.pdf (also available with the Project's documentation)
Please see the installation guide, user manual, and API specification, below. These documents can also be found in the doc directory that comes with the distribution package.
Calibrating the Camera (easy method)
Calibrating the Camera Option 2 (more involved)
Augmented Reality Tutorial using GoblinXNA and ALVAR
Creating Custom Markers using ALVAR
Creating a Custom Marker Layout (under construction)
Speaking of tutorials, here's a snap of the 15 included with the project;
The all the tutorial code is nicely commented. Here's a snip from Tutorial8
protected override void Draw(GameTime gameTime)
// If ground marker array is detected
// If the toolbar marker array is detected, then overlay the box model on top
// of the toolbar marker array; otherwise, overlay the box model on top of
// the ground marker array
// The box model is overlaid on the ground marker array, so in order to
// make the box model appear overlaid on the toolbar marker array, we need
// to offset the ground marker array's transformation. Thus, we multiply
// the toolbar marker array's transformation with the inverse of the ground marker
// array's transformation, which becomes T*G(inv)*G = T*I = T as a result,
// where T is the transformation of the toolbar marker array, G is the
// transformation of the ground marker array, and I is the identity matrix.
// The Vector3(4, 4, 4) is a shift translation to make the box overlaid right
// on top of the toolbar marker. The top-left corner of the left marker of the
// toolbar marker array is defined as (0, 0, 0), so in order to make the box model
// appear right on top of the left marker of the toolbar marker array, we shift by
// half of each dimension of the 8x8x8 box model. The approach used here requires that
// the ground marker array remains visible at all times.
Vector3 shiftVector = Vector3.Zero;
shiftVector = new Vector3(4, 4, 4);
shiftVector = new Vector3(4, -4, 4);
Matrix mat = Matrix.CreateTranslation(shiftVector) *
// Modify the transformation in the physics engine
Matrix.CreateTranslation(Vector3.One * 4));
// TODO: Add your drawing code here
What does the actual Goblin XNA Library Solution look like?
So while not currently using the current bleeding edge Visual Studio, XNA, etc versions, but IS very cutting edge in what it does, you're interested in Virtual/.Augmented Reality, Marker based camera tracking, 2/3D user interfaces, Physic Engines, this is a project you might dig.
Here’s a few more links you might find interesting: