Mini Mighty Engine - Overview
MME aims to provide simple way of creating and rendering 3D content by combining
scene objects into a tree hierarchy called
a scene. This is considered a
high-level layer of MME desing.
Second important aim of MME is to provide a fairly simple way of adding new ways to render 3D content. This is done by implementing a new GLSL shader together with supporting Haxe code that integrates the shader into MME. This part is considered a
low-level layer of MME design.
So, MME has two layers:
- high-level: this is where all 3D-content related classes live (cameras, lights, meshes, boxes, planes, etc. etc. all that fun stuff)
- low-level: this is what translates high-level stuff to OpenGL API realm (think shaders, geometry buffers, API calls, rendering engine, etc. etc. all that fun stuff :) )
A sample scene might be constructed like this:
var scene = new Scene(); var camera = new PerspectiveCamera( 60, window.width / window.height, 1, 5000 ); camera.translate([ 0, 0, 1000 ]); scene.addCamera( camera ); var light = new PointLight(); light.translate([ 500, 500, 750 ]); scene.addLight( light ); scene.addLight( new AmbientLight() ); var box = new Box( 300, 300, new PhongMaterial( NamedColor.green ) ); box.rotate( 45, Vec3.Y_AXIS ); box.rotate( 45, Vec3.X_AXIS ); scene.add( box ); var renderer = new Renderer( window.context.webgl );
and then in
lime.app.Application.onRender() override you would have to call:
renderer.render( context.webgl, scene );
By doing that, after building and running the app, you may end up with a window looking like this:
MME also provides simple support for text and text labels (by implementing font atlas), pseudo-2D graphics (lines, polylines, beziers, etc. all rendered with z-coordinate initially set to
0), parametric surface generators, STL and OBJ/MTL loaders etc.
For more details, checkout the README.