rayshaderでDEM+GPSデータ可視化 #2
#1のつづき
前回は地理院のDEM+GPSデータを3Dで可視化するところまでできた。
では、はじめてrayshaderについて知った時のような動画にする。
‼️New #rayshader release (v0.32.5)! This version brings 3rd person views to your maps, generated directly from a spatial path: turn your GPS bike rides/runs/hikes into cool 3D animations, directly in #RStats! You can even steady the camera or add rotation for a cinematic effect. pic.twitter.com/rYE2dG6n75
— Tyler Morgan-Wall @tylermorganwall@fosstodon.org (@tylermorganwall) December 13, 2022
動画にする
上記Twitterのコメント欄にあったリンクから
convert_path_to_animation_coords()
によって可能と説明されている。
やってみた。
![](https://assets.st-note.com/img/1673876676931-V6VCxBn3sz.png?width=800)
その1
関数の名前だけかえ、コード例を実行したのみ。
まずは、パスをたどる視点で。
zscaleだけ、パスのものと同じにした。
するとTempファイルに25枚写真が保存された。(tempdir()でパスがわかる)
![](https://assets.st-note.com/img/1673877845332-3qN5JWf2EX.png?width=800)
https://syncer.jp/gif-makerでgifにすると以下のような感じ。フレーム数が少なすぎて、よくわかんけど、とりあえず何かできた。
![](https://assets.st-note.com/production/uploads/images/95804591/picture_pc_0c38b98a12560e2b1507ec781e209969.gif)
その2
パスを、第三者からの視点で。
follow_camera = TRUE
だけでよい。すると以下のように。
![](https://assets.st-note.com/img/1673878061579-r1UYnVDhdO.png?width=800)
おなじくGIFにすると
![](https://assets.st-note.com/production/uploads/images/95804848/picture_pc_3c7dfb325515f8fe0192d647b5658f8a.gif)
小括
改善の余地あり!
この記事が気に入ったらサポートをしてみませんか?