3d-ascii-viewerでコンソール上でモデルを表示する

はじめに

3DモデルファイルをASCIIで表示できるコマンドがあるらしく、面白そうなので使ってみる。

環境

Windows 11 Professional
WSL2 Ubuntu 24.04LTS

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このヘルプリストを表示

参考

おわりに

動物が回っているの見ると、Can't it be trueを思い出すね。

Hugo で構築されています。
テーマ StackJimmy によって設計されています。