Apple Developer onepage/WWDC26
#WWDC26#visionOS#RealityKit#USDZ2026-06-08 · 25:16

結構化 3D 模型協作:讓 hierarchy 變成互動能力

這場 session 用 AirPods Pro 與引擎模型示範 visionOS 設計審查體驗:保留 USDZ hierarchy、在 entity tree 上放對 ManipulationComponent、用 ClippingComponent 做剖面檢視,並用 volume-weighted variance 自動展開組件。

// 一句話結論

visionOS 的 3D 協作不是把模型放進空間就結束;真正的關鍵是讓資產 hierarchy、component placement、座標轉換與數學規則共同決定互動。

Apple Developer · WWDC26 · Video ID: zEyH34eLRlwApple Developer 官方頁
Content map

這支影片在拆空間模型協作的四個前提

Asset structure

模型看起來對,不代表能互動

flatten 到 root 的 USDZ 仍可正常 render,但程式很難找出 piston、case、logic board 這些有意義的 part。hierarchy 是後續選取、隱藏、展開與協作的前提。

Component placement

ManipulationComponent 放在哪裡,行為就在哪裡

放在 root 時整個 assembly 一起移動;移到 children 時每個 sub-entity 可被個別抓取。幾何沒有變,互動模型卻完全不同。

Inspection

ClippingComponent 讓內部結構變成可探索表面

visionOS 27 的 clipping 可用 local-space bounds 丟掉 bounds 外的 geometry。再加上六個可拖曳 plane,就能做互動式剖面檢視。

Auto expansion

展開方向可以由模型資料自己決定

影片用 volume-weighted position variance 比較 x、y、z 三軸,沿 variance 最大的方向展開組件,讓模型像設計審查中的 exploded view。

Chapters
0:00Introduction:SharePlay design review 的空間協作情境
2:55Asset preparation:保留 USDZ hierarchy 與 part-whole 關係
5:05Manipulating the hierarchy:ManipulationComponent、InputTargetComponent、CollisionComponent
8:15Interactive clipping:ClippingComponent、editing planes、coordinate frames
18:16Autoexpansion:volume-weighted variance 與 FromToBy animations
24:10Next steps:sample project、Spatial Preview、object tracking
Implementation flow

從靜態 USDZ 到可協作 inspection tool

1

先整理 hierarchy,再談互動

把 assemblies、sub-assemblies、parts 用清楚名稱與巢狀結構保留下來。flattened geometry 雖然能 render,但無法支援可靠的選取與程式控制。

2

用 component placement 切換 open / close 狀態

closed state 把 ManipulationComponent 與 InputTargetComponent 放在 assembly;open state 移除 root component,再加到 sub-entities,並設定 releaseBehavior 為 .stay。

3

用 ClippingComponent 建立剖面檢視

設定 local-space bounds,必要時打開 shouldClipChildren。若要讓使用者編輯 bounds,額外建立六個 plane entities 作為 visual affordance。

4

把 drag delta 轉進正確座標系

gesture 來自 clipping plane frame,bounds 要在 model frame 更新。流程是 plane frame 到 world,到 model,投影到 plane normal,再轉回 plane frame 更新 plane 位置。

5

用資料決定 exploded view 的自然方向

計算每個軸的 volume-weighted position variance,沿最大 variance 的軸建立 FromToBy animations,讓展開方向跟模型結構一致。

重點 1:hierarchy 是空間互動的資料模型

影片很明確地把 asset preparation 放在第一個技術段落:如果模型 export 時把所有 geometry flatten 到 root,viewport 看起來可能完全正確,但程式無法知道哪個 entity 是 piston、哪個是 enclosure、哪個是 logic board。互動不是從手勢開始,而是從資產結構開始。

對內容 pipeline 來說,這代表 USDZ export 應該保留 assembly / sub-assembly / part 的語意,並建立可預測命名。否則 RealityKit 端只能處理一堆無意義的 InteriorPart_47。

Flattened asset 只適合觀看所有 geometry 都在,但沒有可用語意。要 isolate、highlight、animate 個別 part 會變得脆弱。
Nested hierarchy 支援協作每個 part 都是 entity,才能在 SharePlay call 中讓不同人檢視、旋轉、拆開同一個模型的不同部分。
component placement 是 behavior switch同一個模型可以在 root 與 children 間移動 ManipulationComponent,切換「整體可移動」與「零件可拆開」。
CollisionComponent 不能漏影片特別提醒 demo code 沒展示新增 collision,但 event processing 需要 entities 有 collision components。

重點 2:clipping 的難點不是 component,而是座標系

ClippingComponent 的概念很直接:在 entity local space 給一個 axis-aligned bounding box,renderer 每 frame 丟掉 bounds 外的 geometry。真正容易出錯的是互動式 clipping plane。使用者拖的是 plane entity,bounds 更新的是 model coordinate frame,視覺 plane 又要回到自己的 coordinate frame。

01
off / on / editing 做成明確狀態機
off 保存上次 bounds;on 加入 ClippingComponent;editing 顯示 clipping planes,並同步 assembly transform。
02
六個 plane 只控制六個 scalar
每個 bounding box face 對應一個可拖曳 plane。拖曳時只應改該 face 的單一方向,不應讓 plane 任意飄移。
03
用 projection 限制拖曳方向
把 drag delta 轉到 model frame 後,投影到 +x、-y 等 plane normal,得到 bounds 需要的 constrained delta。

重點 3:autoexpansion 把數學變成互動設計

展開模型時,硬編 x 軸或 y 軸通常會在不同 asset 上失效。影片示範用 volume-weighted position variance 讓程式自己選軸:先看每個 child 的位置分布,再用 volume 作權重,沿 variance 最大的軸展開。大型零件距離平均位置越遠,越能影響展開方向。

這個方法很適合 mechanical assembly、建築、城市基礎設施或任何「理解 part 與 whole 的關係」比單純看外觀更重要的模型。它讓 exploded view 不是固定動畫,而是從模型資料推導出來的協作工具。

風險與遷移注意事項

asset pipeline 必須跟工程一起設計如果 3D artist export 時丟掉 hierarchy,工程端再多 component 也很難補回語意。
releaseBehavior 會影響協作感sub-entity 被拖開後若沒有 .stay,使用者放手後的位置可能不符合設計審查預期。
ClippingComponent 預設不剪 childrenshouldClipChildren 預設 false。把 component 加到 parent 卻看不到 children 被裁切,常見原因就在這裡。
coordinate transforms 要做可視化 debugplane frame、world frame、model frame 的轉換若錯,使用者會感覺拖曳方向反直覺。建議在開發工具中顯示 axes 與 plane normals。

對 visionOS 團隊的實作啟發

01
把 hierarchy quality 納入 asset acceptance criteria
交付的 USDZ 不只要 polygon、material、scale 正確,也要能被程式依語意找到 assemblies 與 parts。
02
把 component placement 當成 interaction design tool
不要只把 ManipulationComponent 當「讓東西可拖」的 flag。它放在 tree 的哪一層,就是互動層級。
03
用 sample project 建立數學與手勢測試
clipping 與 autoexpansion 涉及線性代數、variance、權重與動畫。越早建立可重跑 sample,越能避免協作體驗靠目測調參。

來源

主要來源為 Apple Developer 官方影片頁、官方 transcript、章節與 resources;YouTube 影片頁用於 iframe 與發布 metadata。官方頁:Collaborate on structured 3D models in visionOS - WWDC26。YouTube:WWDC26: Collaborate on structured 3D models in visionOS | Apple。

// TL;DR