首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >为什么我的固定全息图不能随着头部的移动而缩放?

为什么我的固定全息图不能随着头部的移动而缩放?
EN

Stack Overflow用户
提问于 2019-05-20 00:36:59
回答 1查看 115关注 0票数 0

我正在使用固定的参考系放置一个Direct X球体。当我移动我的头时,球面全息图停留在原地。但它不能扩展。当我第一次使用PositionHologramAtGaze() (基于示例代码)放置它时,它确实可以伸缩。

在C++ / Direct X中,我是否必须处理缩放?

//以下代码基于示例代码或与示例代码相同...

代码语言:javascript
复制
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硬件的用户向后退了几米:

Person takes a few steps back

他们应该看到的是一个更小的球体:Smaller sphere

我在微软的例子中也观察到了这一点:

https://github.com/microsoft/Windows-universal-samples/tree/master/Samples/BasicHologram

当我向后移动时,立方体会旋转,但大小不会改变。

EN

回答 1

Stack Overflow用户

发布于 2019-05-27 21:44:56

我找到了我自己的答案。

HolographicFaceTracking示例使用相对于眼镜的坐标系。第281行空间坐标系统^ currentCoordinateSystem = m_referenceFrame-

GetStationaryCoordinateSystemAtTimestamp(prediction->Timestamp);

我把这种方法误解为获取“静态”,即“世界”坐标系。但在这种情况下,“固定”并没有这个意思。

它不能很好地解释为什么立方体不会改变大小,或者有反向缩放,但是,一旦我切换到使用BasicHologram示例中的代码:

代码语言:javascript
复制
// 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();

然后

代码语言:javascript
复制
pose = SpatialPointerPose::TryGetAtTimestamp(m_stationaryReferenceFrame- 
>CoordinateSystem, prediction->Timestamp);

切换到使用CreateStationaryFrameOfReferenceAtCurrentLocation()

给了我“世界锁定”的坐标框架。

我认为,在我的辩护,;>),“静止”这个词的过载到处都是有点混乱,一个人需要小心。我正在修改我自己的代码,以确保使用"world“和"headset”来引用坐标框架,以帮助消除混淆……

希望我的答案能对其他人有所帮助……

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/56209889

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档