Finding object position

Apr 15, 2011 at 11:50 AM

Hi,

Im working on a goblin project and I have a few questions. I would really appricate any answers provided.

  1. I generate a 3D object relative to the marker position and I would like to know the postion of this 3D object.
  2. I need to find the position of the guitar marker in a (640,480) image. When I use GuitarMarker. WorldTransformation it returns the world coordinates.

Thanks :)

Apr 17, 2011 at 6:11 PM

Hi,

 

1.  This depends on how you have set up your scene.  If you make it like this:

 

Scene.Root->MarkerNode->TransformNode->GeoNode  then the 3DModel (the geonode) will have a fixed position (which you define by setting the translation component of the transformNode)

 

When working with markers following Tutorial8, the camera is fixed at 0,0,0

 

The marker node will have a translation and rotation based on its location relative to the camera

 

If you want the 3D object relative to the camera then you need to multiply the translation of the marker node by the translation you have placed between the markernode and the geoNode (The TransformNode in my chain above)

 

2.  Try reading the Translation property of the GuitarMarker..If you want rotation then read the Rotation propoerty.  You can use these to build a transformation object.

 

Apr 20, 2011 at 4:48 PM

Hi,

Thank you very much for the detailed explanation. Please check this image http://img97.imageshack.us/i/markerdetectioncopy.jpg/

I manage to retreive finger cordinates using open cv and pass it to XNA. What I want to do is to see if there is a collision between the finger cordinates and the object generated by Goblin. Is the physics engine going to help me.

I would really appriciate if you could give me some guidance on this issue.

Thanks