Tag Archives: wings3d

Wings3d is a surprisingly excellent 3d modeling package, written in Erlang. I have been playing with it for a few weeks, using a prebuilt .dmg. I now need to be able to build from source so I can tinker.

I hit some rocks following the build instructions on the wings3d site.

First problem: the build of ESDL which the ESDL website claims is the latest is esdl-0.94.0615. This is outdated and not compatible with current Wings3d source code – there seem to be big differences in the OpenGL libraries. Get the actual latest version instead from ESDL [sourceforge]. I got 1.0.1 and that seems to work.

After building ESDL, ESDL_PATH needs to be set correctly to compile Wings3d. I achieved that with:

export ESDL_PATH=/usr/local/lib/erlang/lib/esdl-1.0.1

Another problem with ESDL – somehow, the library files had been installed with the wrong permissions: they were owned by root and had permissions -rwx——– and so could not be read by erlang. I fixed the permissions.

Final ESDL problem – when I had built Wings3d and started it from the command line, I got an error:
Driver failed: dlopen(/usr/local/lib/erlang/lib/esdl-1.0.1/priv/sdl_driver.so, 2): no suitable image found. Did find:
/usr/local/lib/erlang/lib/esdl-1.0.1/priv/sdl_driver.so: mach-o, but wrong architecture

I added ‘-arch i386’ to the LDFLAGS and CFLAGS in the Makefile in the c_src directory of the ESDL sources and got an i386 .so library out as needed.

Another problem is that the Mac specific Makefiles and the XCode project needed to build a .dmg specify MacOS 10.4. I am running 10.6.6 and do not have the 10.4 frameworks installed on this machine, so to build I needed to specify 10.6 or latest versions of the frameworks. This was achieved by deleting -isysroot /Developer/SDKs/MacOSX10.4u.sdk where it appears in various Makefiles, and editing the XCode project in macosx/Wings3d.xcodeproj/ to change the target to 10.6 or latest from 10.4.

That was enough to get the build to work, and to yield a .dmg containing an application bundle to install.

My first piece of fiddling has been to allow a mousepress while holding down the CMD modifier to fake a right button click if a single button mouse is being used. I changed the first clause of handle_event_0 in wings.erl to this: