我正在使用GART SDK开发Windows Phone 8应用程序。
但我不喜欢,因为它重叠了地方的名字,并且所有字体都有相同的字体。我正在使用ARToolkit for iPhone,它改变了地方近或远的字体大小,并且它们不会重叠。
你知道另一个像GART for Windows Phone 8的SDK吗?
答案 0 :(得分:0)
前一段时间我遇到了同样的问题,我通过修改OnAttitudeChanged
类的WorldView
方法解决了这个问题。
这是我在该方法的else
块中的代码:
else
{
// In range so show
wvItem.Visibility = Visibility.Visible;
// Create a CompositeTransform to position and scale the WorldViewItem
CompositeTransform ct = new CompositeTransform();
// Offset by half of the WorldViewItems size to center it on the point
ct.TranslateX = projected.X - (wvItem.ActualWidth / 2);
ct.TranslateY = projected.Y - (wvItem.ActualHeight / 2);
// Scale should be 100% at near clipping plane and 10% at far clipping plane
//double scale = (double)(MathHelper.Lerp(0.1f, 1.0f, (FarClippingPlane - Math.Abs(arItem.WorldLocation.Z)) / FarClippingPlane));
// Added to use distance
double scale = (double)(MathHelper.Lerp(0.1f, 1.0f, (FarClippingPlane - (float)Math.Round(arItem.GeoLocation.GetDistanceTo(this.Location))) / FarClippingPlane));
// This makes the items that are far to appear higher on screen. Values are that best fit my project, so, it should be calibrated.
ct.TranslateY = ct.TranslateY - (int)((1-scale) * 63);
ct.ScaleX = scale;
ct.ScaleY = scale;
// Set the transform, which moves the item
wvItem.RenderTransform = ct;
// Set the items z-index so that the closest item is always rendered on top
Canvas.SetZIndex(wvItem, (int)(scale * 255));
}