我正在使用固定的参考系放置一个Direct X球体。当我移动我的头时,球面全息图停留在原地。但它不能扩展。当我第一次使用PositionHologramAtGaze() (基于示例代码)放置它时,它确实可以伸缩。
在C++ / Direct X中,我是否必须处理缩放?
//以下代码基于示例代码或与示例代码相同...
SpatialPointerPose^ pointerPoseStationary =
SpatialPointerPose::TryGetAtTimestamp(m_stationaryReferenceFrame-
>CoordinateSystem, prediction->Timestamp);
m_Sphere->PositionHologramAtGaze(pointerPoseStationary, 2.5f);球体画得很好,并且保持在一个固定的世界位置,但当我将我的头/全息镜头移动得更远时,球体不会缩放。
例如,在这张图像中,我们让一个人看着一个全息球体Person wearing a hololens looking at holographic sphere
他们看到的是Holographic Sphere as seen by wearer
现在,佩戴hololens硬件的用户向后退了几米:
他们应该看到的是一个更小的球体:Smaller sphere
我在微软的例子中也观察到了这一点:
https://github.com/microsoft/Windows-universal-samples/tree/master/Samples/BasicHologram
当我向后移动时,立方体会旋转,但大小不会改变。
发布于 2019-05-27 21:44:56
我找到了我自己的答案。
HolographicFaceTracking示例使用相对于眼镜的坐标系。第281行空间坐标系统^ currentCoordinateSystem = m_referenceFrame-
GetStationaryCoordinateSystemAtTimestamp(prediction->Timestamp);
我把这种方法误解为获取“静态”,即“世界”坐标系。但在这种情况下,“固定”并没有这个意思。
它不能很好地解释为什么立方体不会改变大小,或者有反向缩放,但是,一旦我切换到使用BasicHologram示例中的代码:
// The simplest way to render world-locked holograms is to create a
stationary reference frame
// based on a SpatialLocator. This is roughly analogous to creating a "world"
coordinate system
// with the origin placed at the device's position as the app is launched.
m_stationaryReferenceFrame = m_spatialLocator-
>CreateStationaryFrameOfReferenceAtCurrentLocation();然后
pose = SpatialPointerPose::TryGetAtTimestamp(m_stationaryReferenceFrame-
>CoordinateSystem, prediction->Timestamp);切换到使用CreateStationaryFrameOfReferenceAtCurrentLocation()
给了我“世界锁定”的坐标框架。
我认为,在我的辩护,;>),“静止”这个词的过载到处都是有点混乱,一个人需要小心。我正在修改我自己的代码,以确保使用"world“和"headset”来引用坐标框架,以帮助消除混淆……
希望我的答案能对其他人有所帮助……
https://stackoverflow.com/questions/56209889
复制相似问题