# Google Blocks

* [**Google Blocks**](https://unwire.hk/2017/07/07/google-blocks-can-easily-create-3d-model-in-vr/software/)
  * 可簡單創作各種 3D 模型
* 史前 vs 現在
  * Unity Vuforia vs ARKit and ARCore
* Unity + ARKitPlugin
  * 優點：
    * AnimationController 動作設定比用原生還棒
    * 有很多的免費骨架可直接套用
    * 遊戲物理引擎好設定，寫比較少的 Code
  * 缺點：
    * 不好測試
      * 需要一直輸出 Xcode project 看執行結果
      * Unity ARKit Remote Plugin 可以直接在 Unity 測試，但不能測試 hitTest 功能
    * 沒有跨平台的優點
      * 因為 AR 重度依賴硬體資源
    * ARKitPlugin 不穩定
      * 直接崩潰，試了半天才知道是某版本不能用
    * 擴展性低
      * 想嘗試結合 CardBoard 效果，但不知如何著手
    * 已被棄用，換成 AR Foundation
      * Unity-ARKit-Plugin \[Now deprecated as of June 3, 2019]
* 建模工具 Blender
  * 建模
  * 渲染
  * 動作
* 檔案匯入
  * DAE
  * USDZ
  * SCN
* Node
  * Position
    * 設定座標 on 世界座標
  * Eular
  * Scale
* Geometry
  * Material
* 材質處理
  * 自行設定
  * 圖檔烘培
* 動作處理
  * 一個動作配一個scn檔
  * SCNAnimationPlayer
  * blendout 動作狀態的過度處理
* 碰撞處理
  * 開 Debug 模式，看碰撞體長什麼樣子
  * SCNPhysicsBody
    * static      (動不了)
    * dynamic    (會倒)
    * kinematic (用這個)
  * 不要相信 Inspector 的設定，用 Hardcode 吧
    * 碰撞體的大小會變得非常奇怪，不會跟著 Node Scale 進行縮放
* imageAnchor
  * 將 Anchor 位置轉換為世界座標
    * ARSCNViewDelegate
      * func renderer(\_ renderer: SCNSceneRenderer, didUpdate node: SCNNode, for anchor: ARAnchor)
* 互動方式
  * 搖桿
    * 以鏡頭為原點推算出向量
      * SCNSceneRendererDelegate
        * func renderer(\_ renderer: SCNSceneRenderer, updateAtTime time: TimeInterval)
* 未來展望
  * 沈浸式體驗
    * 結合 CardBoard
    * Vision 手勢辨識
    * Speech 聲音辨識
    * 多人互動
      * MultipeerConnectivity

環境需求 1. 內建 A9 以上晶片的 Apple 設備，如 iphone6S 以上機種 2. 設備版本 iOS12 以上 3. 如果設備是 iOS12，請安裝 Xcode 10 4. 如果設備是 iOS13 或 iPadOS13，請安裝 Xcode 11

您將會學到 1. imageAnchor 設定 2. 座標設定、轉角設定、比例縮放 3. 材質設定 4. 人物動作處理 5. 搖桿控制


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://jacky-chen.gitbook.io/jackychen/ar-vr/google-blocks.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
