gomdl

command module
v0.0.0-...-3830b07 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 21, 2024 License: MIT Imports: 7 Imported by: 0

README

gomdl

この Go 言語のコードは Valve 社の Half-Life 1 エンジンで使用されている MDL ファイルのビュワーです。
mdlviewer を参考に Go 言語で新たに記述しました。
MSYS2 版 Go 1.17 で動作確認しています。

実行環境のセットアップ

MSYS2 MSYS のシェルで以下のコマンドを実行します。

$ pacman -S base-devel
$ pacman -S mingw-w64-x86_64-toolchain
$ pacman -S mingw-w64-x86_64-go
$ pacman -S git
$ pacman -S mingw-w64-x86_64-SDL2{,_image,_mixer,_ttf,_gfx}

ビルド

MSYS2 MinGW x64 のシェルで以下のコマンドを実行します。
ビルドが成功すると、カレントディレクトリに gomdl.exe が生成されます。

$ git clone https://github.com/takaya030/gomdl
$ cd gomdl
$ go mod tidy
$ go build

実行

MSYS2 MinGW x64 のシェルで表示する MDL ファイル名を指定して起動します。

$ ./gomdl.exe <mdlfile>

ウィンドウが開いてモデルが表示されます。
アニメーションデータが含まれている場合はアニメーションも再生されます。
gsg9

スペースキーを押す毎にアニメーションが切り替わります。

gsg9

gsg9

操作方法

キーボード
SPACE: アニメーション切り替え
Z: モデルのローテーション初期化

マウス
L ボタン押しながら左右移動: モデルの Y 軸周りの回転
R ボタン押しながら上下移動: モデルの X 軸周りの回転

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL