AR_Sandbox/tips の変更点


#author("2018-07-07T10:57:57+00:00","default:sawagaki","sawagaki")
#author("2018-07-07T10:58:25+00:00","default:sawagaki","sawagaki")
#navi(../)
*Tips [#k23c3fab]
#contents
**セットアップ後の追加セッティング(降水など) [#kba5e2dd]
-https://arsandbox.ucdavis.edu/forums/topic/ar-sandbox-post-installation-setup/
**熔岩・雪・雨 [#d60e59ef]
-https://arsandbox.ucdavis.edu/forums/topic/snow-shader-and-a-cool-tool-here/
-https://arsandbox.ucdavis.edu/forums/topic/water-to-lava/

***熔岩への変更 [#t1692af3]
-水の効果のソース
share/SARndbox-<version>/Shaders/SurfaceAddWaterColor.fs

-Uncomment line 170:
 float colorW=max(turb(vec3(fragCoord*0.05,waterAnimationTime*0.25)),0.0); // Turbulence noise

-Comment out line 177:
 // float colorW=pow(dot(wn,normalize(vec3(0.075,0.075,1.0))),100.0)*1.0-0.0;

-Comment/uncomment lines 179 and 180:
 // vec4 waterColor=vec4(colorW,colorW,1.0,1.0); // Water
 vec4 waterColor=vec4(1.0-colorW,1.0-colorW*2.0,0.0,1.0); // Lava

**地球? [#u3bdebef]
 ~/Vrui-3.1/bin/ShowEarthModel

**How to [#eee57010]
-http://www.joeguillaume.com/AR_Sandbox/index.htm

**wiki [#m6f14475]
-https://github.com/maphew/SARndbox/wiki

**四角ではない砂箱 [#j2cab2ae]
-https://arsandbox.ucdavis.edu/forums/topic/report-arbitrarily-shaped-sandbox-design/

**改造版 [#c17622de]
-https://arsandbox.ucdavis.edu/forums/topic/sharing-my-modifications/

** [#u8a8b0b0]
-https://system76.com/weekend-project/arsandbox


**DEMファイルの利用 [#re3cc30e]
***参考サイト [#c7e7af08]
-https://youtu.be/nPba_9WzdjI?t=11m37s
-[[ DEM Help>https://arsandbox.ucdavis.edu/forums/topic/dem-help/]]
-https://arsandbox.ucdavis.edu/forums/topic/terrian-model/
-[[SARndbox_util>https://github.com/zsiki/SARndbox_util]]
-https://arsandbox.ucdavis.edu/forums/topic/model-export/
-https://arsandbox.ucdavis.edu/forums/topic/dem-help/
***砂の形状をDEMで保存 [#h245bc98]
-まず“Save Bathymetry” toolを適当なキーに割り当てます.
-割り当てたキーを押すと,現在の砂山の形状のDEMが「USGS DEM format」でSARndboxのディレクトリに保存されます.
-ここで保存したDEMファイルは「USGS DEM format」であり,次の「DEMデータを読み込む」で使う「
grid」ファイル形式とは異なりますので注意してください.
--dem -> grid 変換 と,その逆の grid->dem 変換のためのスクリプトが[[SARndbox_util>https://github.com/zsiki/SARndbox_util]]として提供されています.
-3D Print STLへの変換のヒント
++Save Bathymetry Tool
++[[Qgis2threejsプラグインチュートリアル>http://qgis2threejs.readthedocs.io/ja/docs-release/]]
++FileExport.html
***DEMデータを読み込む [#u69c2604]
-SARndboxは作成済みのDEMデータ(grid形式)を読み込むことができます.
-grid形式のDEMを読み込むには,まず“Show DEM” toolをキーに割り当ててください.これにより,読み込もうとしているDEMファイルを指定するダイアログが表示されますので,gridの拡張子がついたファイル(フォーマットについては下記に詳述)を指定してください..
-gridファイルが正しく読み込まれると,同じ割り当てキーを押すことで,AR SandboxがDEMモードと通常モードを行ったり来たりするようになります.
--DEMモードでは,砂が標高値よりも高くなっている部分が青色で,砂が標高値よりも低くなっているところが赤色で表示されます.
--読み込んだDEMの標高地が砂の表面よりも低いと,全域が青になります(青は砂が多すぎることを意味し,赤は少なすぎることを意味します).
--青い部分の砂を削って赤い部分に盛ってやります.標高値と一致すると白色になります.
--これで何ができるかは[[こちらの動画>https://youtu.be/nPba_9WzdjI?t=11m37s]]をご覧ください.
--ほとんどのエリアが白くなったら,“Show DEM” toolに割り当てたキーを押して,通常モードにしてみてください.
-平面のスケーリングについては,BoxLayout.txtで設定されている砂箱の四角形のスケールに合わせて自動調整されます.
-高さ方向については,砂箱に入っている砂の量によって表現できる起伏が決まりますので,砂の量に応じてgridファイルの値を調整する必要があります.

- 現時点では,SARndboxは以下のような単純なバイナリグリッドフォーマット(拡張子はgrid)のファイルだけを認識します.
--two 32-bit integers (n and m, number of grid vertices in x and y) followed by four 32-bit floats defining the grid’s left, bottom, right, and top edges in some coordinate system, followed by n*m 32-bit floats defining each grid vertex’s elevation.
-- The format is binary, with little-endian (Intel) byte order. The first two entries are the number of columns and rows in the DEM, stored as 4-byte signed integers.
-- The next four entries are the spatial extents of the DEM represented as a rectangle using some arbitrary units and coordinate system. More precisely, they are the left, bottom, right, and top edges of the DEM, stored as 4-byte IEEE 754 standard floating-point numbers.
--After that follow the DEM’s elevation postings, as numRows x numColumns 4-byte IEEE 754 floating-point numbers in row-major order. The AR Sandbox assumes that the elevation values are in the same unit of measurement as the DEM’s spatial extents.
***DEMを垂直方向に調整する前準備 [#m57e87c8]
-AR Sandboxを起動して,“Show DEM” tool をどれかのキーに割り当て,そのキーからDEMを読み込みます(前節で説明した手順).
-一旦読み込ませたら, Vrui’s systemメニューの“Devices”サブメニューから“Save Input Graph…” を選びます.
-そして,一旦アプリを終了させて,保存したファイルをエディタで開きます.
-保存したファイルは他のVrui設定ファイルとフォーマットは同じで,一つのツールごとに一つのセクションが記述されています.
  section DEMTool2
    toolClass DEMTool
    bindings ((Mouse, 4))
    demFileName /home/<user_name>/src/SARndbox-<ver>/LakeTahoe.grid
    demVerticalScale 4.0
    demVerticalShift -1.5 # Positive values make it blue-er, negative values red-er
 endsection
-“toolClass DEMTool”というセクションを探して,以下の行を加えてください.
 demVerticalShift 0.0
-編集したinput graphファイルを保存します.
-AR Sandboxを再度起動させ,保存しておいた input graphファイルを “Devices”サブメニューから開いてください.
-上記のセクションにDEMファイル名をdemFileNameで記載しておけば,DEMファイルを毎回指定し直す手間が省けます.
 demFileName /home/<user_name>/src/SARndbox-<ver>/LakeTahoe.grid
***DEMを垂直方向に調整 [#s442f297]
-上記の準備段階で作成したinput graphファイルの「demVerticalShift」を書き換えることで垂直方向をシフトさせながら,全てのDEMを砂で再現できるように調整していきます.
 demVerticalShift の値で,砂の総量にマッチするようにDEMを上下させます.
 demVerticalScale の値で,DEMの値の拡大縮小比率を変えます.
-AR Sandboxが起動中でもinput graphファイルの書き換えはできます.
-書き換えたら,“Load Input Graph…” メニューから再読み込みしてください.
-真っ青になっている場合は,DEM全域の標高値が砂の表面よりも低いので,demVerticalShiftを減らします. 一旦大きなマイナス値を設定して全域が赤になるようにしておいて,そこから少しずつ値を増やしながら丁度よい値を決めていくとよいでしょう(真っ赤はその逆).
-まずは,DEMモデルの最も低いエリアが砂箱の底あたりになることを想定して,そのエリアの砂箱の底で投影画像が白くなるようにdemVerticalShiftを調整するとよいでしょう.
-赤と青がほどよくまだらになっている状態になることを目指してdemVerticalShiftやdemVerticalScaleを調整するとよいでしょう.
-DEMが平らかノイズだけのように見える場合は,おそらく平面方向と垂直方向で異なったの測定単位が使われている可能性があります.
 tolerance level で白になる範囲(DEMと砂山が一致していると判定する許容値)を決められるはずですが,どこにその記述があるのかは,まだつきとめていません.


#navi(../)

トップ   編集 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS