作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
有人知道如何在 Urho 中使用空间 anchor 吗?我查看了所有样本,没有发现任何东西。文档中也没有任何内容。我尝试使用常规的全息 API:
var store = await SpatialAnchorManager.RequestStoreAsync();
var anchors = store.GetAllSavedAnchors();
store.TrySave("myanchor", SpatialAnchor.TryCreateRelativeTo(???SpatialCoordinateSystem???));
但我不知道从哪里获取空间坐标系。
最佳答案
您可以像这样创建空间 anchor
var anchor = SpatialAnchor.TryCreateRelativeTo(UrhoAppView.Current.ReferenceFrame.CoordinateSystem, new System.Numerics.Vector3(x, y, -z));
store.TrySave("anchorname", anchor);
请注意,Urho 具有左手坐标系,而 HoloLens API 具有右手坐标系,因此为负 z。
您可以将 anchor 映射到当前系统,如下所示:
var matrix = store["anchorname"].CoordinateSystem.TryGetTransformTo(UrhoAppView.Current.ReferenceFrame.CoordinateSystem);
if (matrix.HasValue)
{
System.Numerics.Vector3 scale;
System.Numerics.Quaternion rotation;
System.Numerics.Vector3 translation;
System.Numerics.Matrix4x4.Decompose(matrix.Value, out scale, out rotation, out translation);
var q = new Quaternion(rotation.X, rotation.Y, rotation.Z, rotation.W);
var v = new Vector3(translation.X, translation.Y, -translation.Z);// -Z Right-handed to left-handed
}
关于hololens - HoloLens 上的 Urho 空间 anchor ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42550297/
有人知道如何在 Urho 中使用空间 anchor 吗?我查看了所有样本,没有发现任何东西。文档中也没有任何内容。我尝试使用常规的全息 API: var store = await Spati
我正在尝试使用 Xamarin.Forms 将 Urho 应用程序与一些在可移植项目中定义的通用 UI 嵌入。 它在 Android 上运行,非常棒! Xamarin UrhoSharp 功能示例适用
我是一名优秀的程序员,十分优秀!