bzt 7e9d813f79 WIP web viewer 1 jaar geleden
..
Makefile c775802802 Compile under MacOSX 5 jaren geleden
README.md 3943fb602c Move plane up and down 1 jaar geleden
font6.h 5420552dd9 Bugfixes and export speedup 5 jaren geleden
glfw.c 7e9d813f79 WIP web viewer 1 jaar geleden
glut.c 3943fb602c Move plane up and down 1 jaar geleden
sdl.c 3943fb602c Move plane up and down 1 jaar geleden
viewer.c 7e9d813f79 WIP web viewer 1 jaar geleden
viewer.c.md 8744be67d7 Lots of heavy testing and a few new features 5 jaren geleden
viewer.h 3943fb602c Move plane up and down 1 jaar geleden

README.md

Model 3D Viewer

A very very simple viewer for Model 3D files.

Main purpose: quickly check a model. It does not support all features and material properties of a M3D file, only vertex colors and basic properties and textures in materials. But it can load complex models, uses lights (so you can check normals), and shows action animations frame timestamp correctly.

Model 3D Viewer by bzt Copyright (C) 2019 MIT license

./m3dview <m3d file>

Compilation

Just run make, it will autodetect if you have GLFW, GLUT or SDL2 installed, and uses the appropriate library. GLFW is preferred and recommended as that's the simplest and most portable. The platform independent part is in viewer.c, the other .c files are the framework drivers. To override the autodetected one, use DRIVER="MINGW_GLUT" make for example.

Under Windows

You'll need a couple of tools, here's a step-by-step how to:

  1. install MinGW, this will give you gcc under Windows
  2. download SDL2-devel-X-mingw.tar.gz under the section Development Libraries
  3. extract SDL2 into a directory under MinGW's home directory
  4. open Makefile in Notepad, and edit MINGWSDL to the path where you've extracted the tarball, add the last SDL2-X part too
  5. copy $(MINGWSDL)/i686-w64-mingw32/bin/SDL2.dll into C:\Windows
  6. run make

Possible issues: with some configuration, gcc was unable to find gl.h. To solve this, you have to copy the C:\MinGW\include\GL folder into msys\1.0\include (whereever your msys directory is). You should also have C:\Windows\System32\opengl32.dll, but that's all.

On Windows, if command line argument is not specified, the viewer will fire up an Open File dialog.

Controls

Keybinding Description
mouse left drag the model, move the mouse to rotate
mouse middle zoom in
mouse right zoom out
mouse scroll zoom in / out
up/down move plane up and down
left/right rotate the model
page up/page down change action to animate
0 - 9 change playback FPS (should not needed, for debug)
, / . previous / next frame (without time interpolation)
space toggle continous playback (with interpolation)
m toggle drawing mesh
s toggle drawing skeleton
Esc, q quit

Note that there's an explicit "action animation" for the bind-pose. By pressing Page Down, you can always select it and see the pure model without any animations.