Why make a common foundation?なぜ共通の土台を作った?
At first, the quickest route was to put both controller handling and the behavior of the object being viewed into the same scripts. That was enough to make a cube appear, track both hands and change a torus parameter. But once we moved on to a mathematical family of curves, it became clear that the same headset setup, movement and input logic should not have to be rebuilt for every new object.
最初は、コントローラーを動かす処理と、見たい物体の動きを、同じスクリプトへそのまま書くのが一番早い方法でした。それでも立方体を表示し、左右の手を追跡し、トーラスのパラメータを動かすところまでは進めます。しかし数学的な曲線族へ進むと、ゴーグルの初期設定、移動、入力処理まで、新しい対象のたびに作り直すべきではないと分かってきました。
The reusable foundation separates two questions: “how does the VR environment receive movement and controller input?” and “which mathematical object should this input change?” The first part can remain common; the second can be replaced for each visualization.
そこで、「VR環境が移動やコントローラー入力をどう受け取るか」と、「その入力で、どの数学的対象の何を変えるか」を分けました。前者を共通部分として残し、後者だけを可視化ごとに載せ替える、という考え方です。
How did the reusable foundation emerge?この基本構成は、どうやってできた?
The common foundation was not the first thing we designed. It emerged after the elliptic-curve visualization was already working. At that point, we told Chapio-kun, in essence, that we wanted to separate the parts that would be useful again for later visualizations instead of rebuilding the VR environment each time.
この共通基盤は、最初から設計していたものではありません。楕円曲線の可視化がひととおり動いた後で、「次の可視化でも使える基本部分を切り離して、毎回VR環境を一から作らなくてよい形にしたい」とちゃぴおくんに伝えたところから始まりました。
Chapio-kun then helped reorganize the project so that tracking, movement, controller input, parameter routing and status display could remain common while the mathematics-specific part could be replaced. We did not have to design that software architecture ourselves. There were a few rounds in which an error appeared, we showed Chapio-kun a screenshot, discussed what to change, and tried again; after those corrections, the reusable structure took shape quite quickly.
すると、追跡、移動、コントローラー入力、パラメータの受け渡し、状態表示などを共通部分として残し、数学ごとの可視化だけを載せ替えられるよう、プロジェクトの整理をちゃぴおくんに手伝ってもらえました。人間側でソフトウェア設計を一から考え込む必要はありませんでした。途中で何度かエラーは出ましたが、スクリーンショットを見せて修正方針を相談し、直して試す、というやり取りを繰り返すと、比較的すぐに再利用できる形へまとめることができました。
What stays in the common layer?どこまでを共通部分にした?
Names used in this prototypeこの試作で使っている構成名
In this prototype, VRBase groups OpenXR initialization, movement, the HUD and the desktop fallback; ParameterRouter translates device input into shared actions; and VisualizationRoot holds the mathematics-specific visualization that can be replaced.
この試作では、OpenXR初期化・移動・HUD・デスクトップ表示をまとめる部分を VRBase、機器入力を共通の操作へ変換する部分を ParameterRouter、載せ替える数学ごとの可視化を置く部分を VisualizationRoot としています。
Four views of the foundation taking shape共通基盤ができていく四つの画面

One cube is enough to check the route from Godot through OpenXR to the headset before adding any mathematical object.数学的対象を加える前に、立方体一つでGodotからOpenXR、ゴーグルまで表示が通ることを確認しました。

Simple placeholder shapes made the left and right controller positions visible while the input foundation was being checked.左右のコントローラー位置が分かるよう、単純な仮の形を表示して、入力の土台を確認しました。

A torus generated by GDScript provided a small test that controller input could be connected to a mathematical parameter.GDScriptから生成したトーラスを使い、コントローラー入力を数学的なパラメータへ結び付けられることを小さく試しました。

This diagram from the project notes separates headset input, the shared VR base, parameter routing, a mathematics-specific visualization, caching and tests. The diagram itself uses Japanese labels; the structure is summarized above in both languages.実機入力、共通のVR基盤、パラメータの受け渡し、数学ごとの可視化、計算のキャッシュ、テストを分けた構成図です。
How would we use it for the next object?次の数学的対象には、どう使う?
Keep the common VR setting.共通のVR環境は残す。
Reuse tracking, movement, the controllers, the status display and the desktop fallback.
追跡、移動、左右コントローラー、状態表示、デスクトップ確認はそのまま使います。
Describe the new mathematics and the parameters to move.新しい数学と、動かしたいパラメータを説明する。
Tell ChatGPT what object should be drawn, which information should become 3D position, colour or a movable parameter, and what change you want to observe.
何を描きたいか、どの情報を3D位置・色・可動パラメータへ割り当てるか、何の変化を見たいかをChatGPTへ伝えます。
Connect the module to abstract actions.可視化モジュールを共通の操作へつなぐ。
Map actions such as changing a value, changing an angle, switching a view and resetting to the parameters of the new object.
値を変える、角度を変える、見方を切り替える、リセットするといった共通操作を、新しい対象のパラメータへ対応させます。
Check a small step, then keep it with Git.小さく確認し、動いた状態をGitへ残す。
First check the desktop view where useful, then inspect the result through Meta Quest 3. After one small behavior works, record the state before adding the next one.
必要ならまずPC画面で確認し、その後Meta Quest 3で見ます。一つの小さな動作が通ったら、その状態を記録してから次を足します。
What has already been checked?今のところ、何を確認できた?
- OpenXR initialization through Meta Quest Link / Air Link.
- Head and both-controller tracking.
- Thumbstick, trigger, grip and button input.
- View-relative movement, parameter changes, resets and HUD switching.
- A desktop-preview fallback for part of the workflow.
- Reuse of the common structure in the elliptic-curve visualization.
- Meta Quest Link / Air Linkを通したOpenXR初期化。
- 頭と左右コントローラーの追跡。
- スティック、トリガー、グリップ、ボタンの入力。
- 視線方向に沿った移動、パラメータ変更、リセット、HUD切替。
- 作業の一部をPC画面で確認するデスクトップ表示。
- 楕円曲線可視化で、この共通構成を実際に使えたこと。
