Hololens 学习摘要及翻译记录 二 World coordinates

来源:互联网 发布:易语言盗号源码2016 编辑:程序博客网 时间:2024/06/08 00:31

阅朗微软官方文档并作出简要记录:

https://developer.microsoft.com/zh-cn/windows/holographic/documentation

个人学习记录,有错误欢迎指出。


HoloLens的六个基本概念之一

Building blocks of Holographic apps : 

一、Coordinate systems : https://developer.microsoft.com/zh-cn/windows/holographic/coordinate_systems


A.Spatial coordinate Systems : 空间坐标系

1.All 3D graphics applications use Cartesian coordinate systems.
所有的3D图形应用都采用笛卡尔积坐标系。

2.Spatial coordinate systems express their coordinate values in meters.
空间坐标系统以真实世界米为一个单位。

3.Spatial coordinate systems on Windows Holographic are always right-handed, which means that the positive X-axis points right, the positive Y-axis points up (aligned to gravity) and the positive Z-axis points backwards.
坐标系采用右手定则,X向右为正,Y向上为正,Z向内为正。


B.Stationary frame of reference : 固定参照系

1.Describing the position of a hologram in the real-world requires a reference point that remains stationary as the device moves through the environment. The system provides a simple affordance for this purpose which is called a "stationary frame of reference". The coordinate system provided by this frame of reference works to keep the positions of objects near the user as stable as possible, relative to the world.
当戴着设备在周围环境中移动时,为了描述一个全息影像在真实世界中的位置,需要一个固定的参照点。系统提供了一个简单的功能达到这个目的叫做固定参照系。固定参照系提供的坐标系让使用者周围的全息影像位置尽可能的保持在自己原本的位置上不发生改变。固定参照系其本身对世界来说是会变化的。

2.In a game engine such as Unity, a stationary frame of reference is what defines the engine's "world origin". Objects that are placed at a specific world coordinate use the stationary frame of reference to define their position in the real-world using those same coordinates. An app will typically create one stationary frame of reference on startup and use its coordinate system throughout the app's lifetime.
像在Untiy这样的游戏引擎里,固定参照系定义了引擎的世界坐标原点。被放置在特定世界坐标的对象,用同样的坐标数据在固定参照系中定义他们在真实世界中的位置。一个应用最典型的就是在启动的时候创建一个固定参照系并用这个坐标系贯穿整个应用的生命周期。

3.Over time, as the system learns more about the user's environment it may determine that distances between various points in the real-world are shorter or longer than the system previously believed. Therefore, the system adjusts as the user walks around a larger area resulting in holograms that you've placed in a stationary coordinate system may be seen to drift off their original position.
随着时间的推移,系统会自动识别更多的环境信息。而识别的依据取决于各个点在真实世界中的距离与系统预先之前所确定的距离是否存在差距。因此,系统会随着使用者在区域内反复游走而不断的调整结果(因为点之间距离变化了)告诉那些你放置在固定坐标系中的全息影像,其结果就好像这些全息影像渐渐的偏离了他们原来所在的位置(原本系统认知为4米的距离,实际上为3.9米,当系统了解到这一事实后将会改变固定参照系为真实的状态,这个时候原本放在4米位置的对象,在坐标系修改后就放在了3.9米的位置,就看起来好像偏离了他原来所在的位置)。


C.Spatial anchors :空间锚点

1.To avoid drift and ensure that a hologram remains exactly at a specific spot in the world, even as the system discovers more about the world, you can place that hologram using a spatial anchor.

为了解决静止参照系中出现的偏移问题,你放置的全息影像就可以采用空间锚点。

2.A spatial anchor represents an important point in the world that the system should keep track of over time. Each anchor has a coordinate system that adjusts as needed, relative to other spatial anchors or frames of reference, in order to ensure that anchored holograms stay precisely in place.

每一个空间锚点都代表着世界中的一个点,用以被系统追踪。每一个锚点都有着一个相对于其他空间锚点或固定参照系可调整的坐标系,以确保全息影像准确的呆在它的位置上。


Why a single rigid coordinate system cannot be used for the whole scene : 

为什么不能用一个不变的坐标系描述整个场景:

1.Today, when writing games, data visualization apps, or virtual reality apps, the typical approach is to establish one absolute world coordinate system that all other coordinates can reliably map back to. In that environment, you can always find a stable transform that defines a relationship between any two objects in that world. If you didn't move those objects their relative transform would always remain the same. This kind of global coordinate system works well when rendering a purely virtual world where you know all of the geometry in advance.

如今,我们在写一个可视化数据的应用或虚拟现实应用,最典型的方式是建立一个绝对的世界坐标系,其他所有的坐标系都依赖其映射。在这个环境下,你总是能够找到一个固定的变换矩阵定义两个对象在世界中的关系。如果你不去移动这些对象,他们的相对的变化矩阵总是保持不变的。这类型的全局坐标系总是能够在一个纯粹的并且能够提前知道所有几何结构(是指的位置,形状等几何关系永远不会发生变化的情况下)的虚拟世界中得到完美的应用。

2.In contrast, as a mixed-reality device, HoloLens has a dynamic sensor-driven understanding of the world -- continuously adjusting its knowledge over time of the spatial anchors you create. As a result, your app must be prepared for the spatial anchors you create to change their relationships to each other over time.

与其相对的,作为一个混合现实的设备。HoloLens有着动态的传感器来理解世界,并随着时间的推移,持续的调整着你所创建的空间锚点的认知。其结果就是,你的应用必须随时准备好为你所创建的空间锚点改变它们之间的相对关系。

3.For example, the device may currently believe two locations in the world to be 4 meters apart, and then later refine that understanding, learning that the locations are in fact 3.9 meters apart. If those holograms had initially been placed 4 meters apart in a single rigid coordinate system, one of them would then always appear 0.1 meters off from the real-world.

举例来说,设备当前认为两个点之间的距离为4米。然后设备学习并认知到实际上他们之间只有3.9米,那么这两个被初始化相距为4米的全息影像如果是放在一个不变的坐标系下,那么这个时候在真实世界中它们之间总会有一个出现0.1米的误差。(因为不变的坐标系下初始化的4米,其在真实世界中是3.9米,因为是不变坐标系,所以不会再改变他们的真实距离)


The solution : Spatial anchors : 解决办法:空间锚点

1.HoloLens solves this issue by letting you create spatial anchors to mark important points in the world where the user has placed holograms. As the device learns about the world, these spatial anchors can adjust their position relative to one another as needed to ensure that each anchor stays precisely where it was placed relative to the real-world. By placing a hologram in the coordinate systems of a nearby spatial anchor, you can ensure that this hologram maintains optimal stability.

HoloLens解决这个问题的方式就是用空间锚点在你放置全息影像的位置标记为重要的点。随着设备对世界的认知,这些空间锚点会调整它们在真实世界中的相对位置,保持在坐标系上的不变(会随着坐标系的改变而改变)。把全息影像放在空间锚点的坐标系上,确保全息影像保持稳定。

2.This continuous adjustment of spatial anchors relative to one another is the key difference between coordinate systems from spatial anchors and stationary frames of reference:

持续的调整空间锚点 对 其他空间锚点 和 固定参照系 上有两个关键的不同点:

  • Holograms placed in the stationary frame of reference all retain a rigid relationship to one another. However, that frame's coordinate system may drift relative to the world over time to ensure that holograms next to the user appear stable.
  • 放置在固定参照系中的全息影像相对于其他对象都是保持不变的。然而,固定参照系本身的坐标系会随着对世界的认知而发生改变,这样才能保证下一个在使用者周围会出现的全息影像是稳定的。
  • Holograms placed using one spatial anchor may drift relative to holograms placed using another spatial anchor. This allows Windows to improve its understanding of the position of each spatial anchor, even if, for example, one anchor needs to adjust itself left and another anchor needs to adjust right.
  • 放置在空间锚点中的全息影像会相对于放置在其他空间锚点中的影像发生漂移。系统能够提高对各个锚点位置的认知,比如一个锚点需要左移而另一个锚点需要右移
3.In contrast to a stationary frame of reference, which always optimizes for stability near the user, spatial anchors ensure stability near their origins. This helps those holograms stay precisely in place over time, but it also means that holograms rendered too far away from their spatial anchor's origin will experience increasingly severe lever-arm effects. This is because small updates to the position and orientation of the spatial anchor are magnified proportional to the distance from that anchor. A good rule of thumb is to ensure that anything you render based on a spatial anchor's coordinate system is within about 3 meters of its origin.
相比于一个固定参考系总是会为使用者附近的稳定性做优化,空间锚点确保它们原点的稳定性。这能使全息影像随着时间的推移也能够呆在该在位置,但这也意味着,全息影像的渲染,会着随着偏离锚点原心的距离产生严重的杠杆效应。这是因为空间锚点的位置或朝向的一点微小更新,将会随着距离的增加而成倍的放大。好在任何在空间锚点坐标系下对象只有在离原心3米的范围内能被渲染。

Spatial anchor persistence : 持续空间锚
1.Spatial anchors can also allow your app to remember an important location even after your app suspends or the device is shut down.
空间锚能让你的应用记住这些关键的位置,即使你的应用挂起或关闭了。
2.You can save to disk the spatial anchors your app creates, and then load them back again later, by persisting them to your app's spatial anchor store. When saving or loading an anchor, you provide a string key that is meaningful to your app, in order to identify the anchor later. Think of this key as the filename for your anchor. If you want to associate other data with that anchor, such as a 3D model that the user placed at that location, save that to your app's local storage and associate it with the key you chose.
通过空间锚仓库将空间锚维持,将空间锚保存到磁盘,晚点再加载回来。在保存或加载一个空间锚时,你要提供一个有意义的string key给你的应用来识别空间锚。这个key你可以是锚点的文件名。如果你想协作其他数据,比如放置在空间中的3D模型,你也可以跟这个key连协储存的。
3.By persisting anchors to the store, your users can place individual holograms or place a workspace around which an app will place its various holograms, and then find those holograms later where they expect them, over many uses of your app.
通过空间锚仓库维持空间锚,你可以放置独立的全息影像,也可以放置一个包含各种全息影像的环境,并且这甄别出你所希望的。

Spatial anchor sharing
1.Your app can also share spatial anchors with other devices. By transferring a spatial anchor along with its supporting understanding of the environment and sensor data around it to a second HoloLens, both devices can then reason about the same location. By having each device render a hologram using that shared spatial anchor, both users will see the hologram appear at the same place in the real world.
应用能够和其他设备共享空间锚。传输一个空间锚的环境和传感数据给第二个设备。这两设备就可以推理出同样的空间。并且每个设备都能用共享空间锚渲染同一个全息影像。能够在真实世界中看到全息影像在同一个地方出现。

Best practices :  最佳的实践
1.For guidelines on how best to use spatial anchors, and when to use a stationary frame of reference instead, check out the Spatial anchors best practices page.
怎样使用空间锚和什么时候用固定参考系代替,可以查看 Spatial anchors best practices 页面。

D.Attached frame of reference : 附加参照系
1.Some holograms are designed to follow the user, floating at a chosen heading and distance from the user at all times. These holograms can be placed in an "attached frame of reference", which moves with the user as they walk around. One key note is that an attached frame of reference has a fixed orientation, defined when it's first created. The reference frame does not rotate as the user turns their head or body. This lets the user comfortably look around at various holograms placed within that frame of reference, while still bringing those holograms along as the user walks around. Content rendered with this behavior relative to the user is called 'body-locked' content.
一些全息影像被设计成跟随使用者,漂浮在头顶,和使用者始终保持着一定距离。这些全息影像能够被放置在附加参照系中,随着使用者的行走而移动。需要注意的一点是附加参照系有固定的方向,在创建的时候就被定义好了。附加参照系不会随着使用者的的头部或身体旋转而旋转。即使使用者带着跟随他的全息影像移动时,也能很舒服的环顾放在附加参考系中的全息影像。相对于使用者来说这种叫做主体锁定内容。
2.When the device can't figure out where it is in the world, an attached frame of reference provides the only coordinate system which can be used to render holograms. This makes it ideal for displaying fallback UI to tell the user that their device can't find them in the world. All apps should include such a fallback to help the user get things working again with UI similar to that shown in the holographic shell.
当设备无法计算出全息影像在的世界中的位置。附加参照系提供了唯一的坐标系用来渲染全息影像。这让它能够与备用展示UI进行交互,告诉使用者设备不能在世界中找到它。所有的应用都应该提供一个备用的类似于UI的东西在全息外壳(就是指的系统启动后各种程序菜单打开时2D页面所在的那个坐标系)中,好让使用者获取信息并再次工作。

E.Head-locked content
--相对于body-locked--没太多用。。。

F.Handling tracking errors : 错误追踪处理
1.In some environments, it is possible that the device is not able to locate itself correctly in world. This will lead to previously positioned holograms to either not show up or appear at incorrect places. We now discuss the conditions in which this can happen, its impact on user experience, and tips to recover from this situation.
在一些环境中,设备可能无法定位自己在世界中正确的位置。可能导致预先放置的全息影像无法显示或位置不正确。我们现在讨论可能发生的情形,它影响用户的体验,和怎么从这种情况中恢复的提示。

Device cannot track due to insufficient sensor data : 设备无法追踪是由于缺少传感数据
1.Sometimes, the device's sensors are not able to figure out where the device is. This can happen if the room is dark, or if the sensors are covered by hair or hands, or if the surroundings do not have enough texture.

一些时候,设备的传感器无法计算出设备在哪。可能的原因是,房间太黑,或者传感器被头发或手挡住,或者周围没有足够的纹理。

2。When this happens, the device will be unable to track its position with enough accuracy to render world-locked holograms. You won't be able to figure out where a spatial anchor or the stationary coordinate frame is relative to the device, but you can still render body-locked content in the attached frame of reference.

当这个情况发生时,设备没有足够准确的信息去追踪在世界中全息影像的位置。你不能计算出空间锚或固定参照系与设备的相对位置。但是你能渲染那些在附加参照系中的主体锁定的内容。

3.Your app should tell the user how to get positional tracking back, rendering some fallback body-locked content that describes some tips, such as uncovering the sensors and turning on more lights.

应用需要告诉使用者,怎么获取追踪位置。使用主体锁定的内容来做提示,如:不要挡住传感器和把光调亮一点。


Device tracks incorrectly due to dynamic changes in the environment : 设备追踪不正确是由于环境中动态变化的东西

1.Sometimes, the device cannot track properly if there are lot of dynamic changes in the environment. For example, many people walking around in the room. In this case, the holograms may seem to jump or drift as the device tries to track itself in this dynamic environment. We recommend using the device in a less dynamic environment if you hit this scenario.

一些时候,设备无法正确的追踪是因为在环境中动态改变的东西太多了,比如,一些人在房间中走动。因此,在设备试图追踪他们的时候全息影像可能看上去像跳或漂移。我们使用设备时应在尽量少的动态坏境中使用。


Device tracks incorrectly because the environment has changed significantly over time : 随着时间的推移,环境有了显著的变化,会导致设备追踪不正确。

Sometimes, when you start using a device in an environment which has undergone lot of changes (e.g. significant movement of furniture, wall hangings etc.), it is possible that some holograms may appear shifted from their original locations. The earlier holograms may also jump around as the user moves around in this new space. This is because the device's understanding of your space no longer holds and it tries to remap the environment while trying to reconcile the hologram positions. In this scenario, it is advised to remove the original holograms. If the newly placed holograms also seem to shift and jump, please ask the user to remove the current space on the device by going to Settings > System > Spaces. Please note that removing a space leads to loss of all the holograms.

一些时候,当你在一个环境中使用设备时,会扫描到很多会变化的物体,比如明显移动过的家具或壁挂。可能出现一些全息影像从他们原来的位置发生了移动。早一些的全息影像也许会随着使用者移动到一个新的地方而产生跳跃。因为设备知道你的空间已经换了,所以设备在尝试重新定位全息影像位置时,会试图重新扫描环境。在这个情况下,建议清除原来的全息影像。如果新的全息影像位置看起来像移动或跳跃,可以请求使用者在设备上移除当前的空间。步骤:Settings>System>Spaces。记住,移除一个空间会导致所有的全息图像丢失。


Device track incorrectly due to identical spaces in an environment : 在环境中具有相同的空间,会导致设备追踪不正确。

Sometimes, a home/space may have two identical portions. For example, two identical rooms in a home, two identical corner areas, two large identical posters that cover the device's field of view. In such scenarios, the device may, at times, get confused between the identical parts and mark them as the same in its internal representation. This may cause the holograms from some areas to appear in other locations. The device may start to lose tracking often since its internal representation of the environment has been corrupted. In this case, it is advised to remove the current space by going to Settings > System > Spaces. Please note that removing a space leads to loss of all the holograms. This will cause the device to track well in the unique areas of the environment. However, the problem may re-occur if the device gets confused between the identical areas again.

一些时候,在房子或者空间中有两个相同的部分。比如,两个一样的房间,两个一样的角落,两个一样的大海报覆盖了设备的FOV。在这个情况下,设备有可能混淆两个部分,并在内部把他们标记成一个东西。这可能导致全息影像应该这个位置出现的确在另一个位置出现了。经常由于设备的内部环境标识出了问题,设备开始丢失追踪。建议清除当前空间。步骤:Settings>System>Spaces。记住,移除一个空间会导致所有的全息图像丢失。在唯一的环境中设备会追踪的很好,然后如果还是在有相同区域的空间中,设备依然有可能出现这个问题。


See also

  • Spatial anchors
  • Shared holographic experiences
  • World anchor in Unity
  • Coordinate systems in DirectX
  • Shared spatial anchors in DirectX
  • Case study - Looking through holes in your reality

0 0
原创粉丝点击