はじめに
3DモデルファイルをASCII
で表示できるコマンドがあるらしく、面白そうなので使ってみる。
環境
Windows 11 Professional
WSL2 Ubuntu 24.04LTS
- 3d-ascii-viewer | Ubuntu Packages
https://packages.ubuntu.com/noble/graphics/3d-ascii-viewer
3d-ascii-viewerのインストール
sudo apt-get install 3d-ascii-viewer
ログ
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
libgl1-amber-dri libllvm19 libxcb-damage0 mesa-utils-bin xbitmaps
Use 'sudo apt autoremove' to remove them.
Suggested packages:
meshlab
The following NEW packages will be installed:
3d-ascii-viewer
0 upgraded, 1 newly installed, 0 to remove and 83 not upgraded.
Need to get 24.0 kB of archives.
After this operation, 72.7 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu noble/universe amd64 3d-ascii-viewer amd64 1.4.0+ds-1 [24.0 kB]
Fetched 24.0 kB in 1s (28.7 kB/s)
Selecting previously unselected package 3d-ascii-viewer.
(Reading database ... 120455 files and directories currently installed.)
Preparing to unpack .../3d-ascii-viewer_1.4.0+ds-1_amd64.deb ...
Unpacking 3d-ascii-viewer (1.4.0+ds-1) ...
Setting up 3d-ascii-viewer (1.4.0+ds-1) ...
Processing triggers for man-db (2.12.0-4build2) ...
3d-ascii-viewerを使ってみる
使う
※モデルファイルがないので、下記のGitHub
リポジトリをクローンして指定する。
https://github.com/autopawn/3d-ascii-viewer
git clone https://github.com/autopawn/3d-ascii-viewer.git
/usr/bin/3d-ascii-viewer 3d-ascii-viewer/models/fox.obj
オプションの確認
オプション | 説明 |
---|---|
-w <サイズ> | 出力幅(文字数) |
-h <サイズ> | 出力高さ(文字数) |
-d <秒> | 指定秒数後にプログラムを停止 |
-f <フレーム> | 1秒あたりのフレーム数 |
-a <比率> | ターミナル文字の高さ/幅の比率を指定して表示 |
-c <文字> | 輝度を表す代替文字を指定(光の少ないものから多いものへ) |
-s | ターミナル文字の高さ/幅の比率に関係なくモデルを引き伸ばす |
-t | アニメーションが最大標高に達することを許可 |
-l | モデルと一緒に光を回転させない |
-X, -Y, -Z | それぞれの軸を反転 |
-XYZ, -XZY, -YXZ, -YZX, -ZXY, -ZYX | モデルの向きを変更 |
-F | 面を反転 |
-z <ズーム> | ズームレベルを変更(デフォルト:100) |
–color | 色付きで表示。OBJ形式は付属のMTLファイルに依存 |
–snap | 指定された方位角と高度角(度単位)で単一のスナップをstdoutに出力 |
–interactive | カメラを手動で回転。操作方法:矢印キー、「-」、「+」 代替操作:H, J, K, L, A, S 終了:Q HUD切替:T |
-?, –help | このヘルプリストを表示 |
参考
- 3d-ascii-viewer
https://packages.ubuntu.com/noble/graphics/3d-ascii-viewer
おわりに
動物が回っているの見ると、Can't it be true
を思い出すね。