Hi,
I want to develop an application that allows you to do the following:
1 - Hold your mobile camera in front of a wall (say we will ask the user to stand about 1 meter from the wall).
2 - Using the app you can draw some markers on the wall and be able to estimate the distance between them.
You can see this video to gain more clear idea: http://www.youtube.com/watch?v=0X-kmUhPC4Q
I want to do something just like the cones drawn on the floor and lines drawn between them.
Please note that the key problem here is the estimation of the distance between the cones (the app actually does that despite not being clear in the video).
I am using the GyroDroid plugin to get access to the device sensors.
So far I have done the following:
void Update () {
// get the current rotation vector of the device
currentRotation = SensorHelper.rotation;
//float angle;
//Vector3 axis;
// get the difference between the current rotation and the rotation recorded in the last frame
Quaternion difference = Quaternion.Inverse(lastRotation) * currentRotation;
//difference.ToAngleAxis(out angle, out axis);
//Debug.Log("Difference: " + angle + ", " + axis.ToString());
// record current rotation to be used in the next frame
lastRotation = currentRotation;
}
Can I use the difference quaternion to estimate the distance covered by the camera?
Again I assume that the user stand about 1 meter in front of the wall.
I was thinking that getting the difference between 2 rotations I can get the angle offset between them. After getting the angle offset I can estimate the length of the triangle edge on the wall.
Any suggestions how to do this?