I am using unity, i simply want AR core to draw and measure a distance between 2 points but and its working fine but the points are always on the detected plane ...my need is to detect points anywhere not depending on the detected plane just like this app. http://armeasure.com i found something related to feature point but i don't know much as i am new to ARcore.
i tried commenting the trackablehitflag.planewithpolygon
in the HElloAR script in example project
TrackableHit hit;
TrackableHitFlags raycastFilter =TrackableHitFlags.FeaturePointWithSurfaceNormal;
// TrackableHitFlags.PlaneWithinPolygon
if (Frame.Raycast(touch.position.x, touch.position.y, raycastFilter, out hit))
{
// Use hit pose and camera pose to check if hittest is from the
// back of the plane, if it is, no need to create the anchor.
/* if ((hit.Trackable is DetectedPlane) &&
Vector3.Dot(FirstPersonCamera.transform.position - hit.Pose.position,
hit.Pose.rotation * Vector3.up) < 0)
{
Debug.Log("Hit at back of the current DetectedPlane");
}*/
// else
// {
// Choose the Andy model for the Trackable that got hit.
GameObject prefab;
// if (hit.Trackable is FeaturePoint)
//{
prefab = AndyPointPrefab;
// }
//else
//{
// prefab = AndyPlanePrefab;
//}
// Instantiate Andy model at the hit pose.
var andyObject = Instantiate(prefab, hit.Pose.position, hit.Pose.rotation);
}
after disabling the points were not even instantiating on the featurepoint hit flag