storm-enroute/macrogl — pull request #38 by joelross (2014-06-27 19:03:09+00:00)
Title: Utility parser for OBJ and MTL files + new associated demo + migration to Scala.js 0.5.0 and Scalajs-dom 0.6

Added a new utility to parse OBJ and MTL files to be able to load complex meshes from an external 3D modeling software (I tested exported files from Blender, but I have tried to stay as close as possible to the specs of the files, so any other software should work too). There is a tool to convert their content to triangle meshes (much easier to inject directly into OpenGL buffers).

(Little reminder: OBJ and MTL files support multiple rendering materials, but only static geometries, so no animations with that format)

This new 6th demo shows how to use the utility to load several text files at once, use the utility to extract and convert their content and render it. The current mesh is a simple Cube with a different color for each face. You can replace by your own if you want to. The demo currently loads the files "test.obj" and "test.mtl" from the resource directory "/org/macrogl/examples/backend/common" and uses the object called "Test".

I migrated the projects to Scala.js 0.5.0 and Scalajs-dom 0.6. This imply a few changes about how to launch the WebGL demos:

command 'sbt "backendExamplesWebgl/fastOptJS"' and file index-fastopt.html or
command 'sbt "backendExamplesWebgl/fullOptJS"' and file index.html

The LWJGL demos still launch using the command 'sbt "backendExamplesLwjgl/run 6"' (replace 6 with the number of the demo),