This project is read-only.

Determine size of markers

Oct 5, 2010 at 10:54 PM

Hey,

I'm new to Goblin XNA and using the Vuzix iWear VR920 and CamAR bundle. I was wondering if there is a way of calculating the size of a marker as seen by the camera? Essentially, I want to put a marker on an object and render an image a certain distance from the marker that is still within the dimensions of the object. However, since the further you get from the marker, the smaller the marker and object appear, is there a way of calculating the size of the marker as it appears through the camera? This will allow me to render the image in the same location each time. I would put another marker on that spot, but I don't want to have an enormous amount of markers on an object, as my project is a proof-of-concept to be used commercially.

THanks.

Coordinator
Oct 10, 2010 at 8:13 AM

The size of the marker is pre-defined by the developer in the marker config file, so I don't understand why you need to calculate it on the fly. If u need the distance of the marker from the camera, it's simply Vector3.Distance(markerNode.WorldTransformation.Translation).

Ohan

Nov 1, 2011 at 12:29 AM

The last parameter of InitTracker() is to determine the markerSize. If you say the XML file that we have provided in the parameter has defined the markerSize why do we need to provide it again for the last parameter?

thanks

Coordinator
Nov 1, 2011 at 2:30 AM

It defines the default marker size for markers you pass in as individual marker instead of as a marker array. The marker size for for the marker array is defined (or automatically computed based on the 4 corners) in the .xml file.

So if you use just the marker 0 (ID = 0) using MarkerNode(scene.MarkerTracker, 0) signature, then the marker size for marker 0 will use the default marker size. You can of course define the marker size for individual marker using MarkerNode(scene.MarkerTracker, 0, markerSize) signature.

Ohan