I have a paper with a tracker and a rectangle where the user can draw with a pencil in real life a black line. In my program I've got a bitmap from the plane where true is black and false is white so I can use that bitmap to set a ball on the line.
Here is where the problem is, when searching for the black pixels I'm getting the right cords for the bitmap but when placing the ball via metaio the ball is not on the right place it's not on the line but far above.
for(column = 0; column < width && !stop; column++)
{
for(row = 0; row < height && !stop; row++)
{
if (bitmap[row][column])
stop = true;
}
}
if (stop)
{
m_geometry->setTranslation(metaio::Vector3d(-m_x,-m_y,0));
m_y = (0 - 160 - column);
m_x = row;
m_geometry->setTranslation(metaio::Vector3d(m_x,m_y,0));
cout << m_geometry->getTranslation().x << " " << m_geometry->getTranslation().y << " "<< m_geometry->getTranslation().z << endl;
}
Can someone help me with this? I've draw the situation in paint so you got an idea.
http://img195.imageshack.us/img195/4945/naamlooszw.png (drawn a triangle instead of a ball sorry)
Kind regards,