Creating objects on the marker

May 18, 2011 at 11:11 AM

I'm currently playing with Goblin XNA and would appreciate if you could help me.  I just have a few questions that I can't google-out. I'm hopless and don't know to whom to turn.

I'm new at the augmented reality (and computer graphics overall) thing so don't kill me if I say something stupid. Anyway, I'm doing a simple tech demo, 2 cars on a playing field and a ball (it should be something like AR car soccer :P). My problem is that I have no idea how to add objects. I know there's a create objects method but it just doesn't work for me.
Here's the CreateGround method: http://pastebin.com/M8iBXEzP
And here's the CreateObjects one (ball and 2 walls): http://pastebin.com/nTQcE7Fc

There should spawn a playing field, a ball, and 2 walls, but there's just the ground field.

Alvar is being user for the tracking and I want it all on the same multi-marker. Don't be confused by the no.2 in "ALVARGroundArray2.xml", it's the same marker but I was just experimenting.


I'm probably doing something terribly wrong. I think it has to do with the groundMarkerNode :/

Help me please, I'm desperate :(

May 19, 2011 at 7:42 AM

This :

groundMarkerNode = new MarkerNode(scene.MarkerTracker, "ALVARGroundArray2.xml");

 

You should only initialize your ground marker once, else when you initialize it later, you loose all the objects attached to it. I think that you create your ground last, that's why it's the only one remaining.

May 19, 2011 at 6:20 PM
Edited May 20, 2011 at 12:47 AM

Thank you very, very much. I was blind.

Yeah, the problem was in the Initialisation method - I first created the objects, then the ground so there were always errors.

On another note - does someone know how to make the ball roll when you tilt the marker? (just like in the Marble game by Ohan Oda). I'm searching for a improvised solution, without the HMD.