The code is crappy, I port my js code +/- AS IS to Dart. I'm new to Dart but I'm a java/scala/javascript developer.
# History (someone can be interested, else you can skip)
* The project was started few month ago in haxe, then I migrate to javascript/coffeescript.
* The project in js version used Three.js (rendering), chipmunk.js (physics), knockout (html binding), jsfx + soundmanager2 (sound), ...
* I also tried (1 week) 2 frameworks : playcanvas and turbulenz sdk.
* Since 2 weeks I migrate to dart
*
I failed to port chipmunk.js (some strange bugs), so after 3 days, I
switch to box2d (I previouly used box2dweb.js for the project in js).
* I removed sound
*
I import Three.dart, but I had to fork it to fix some issues with
material (Lambert, Phong, Shader) + some missing function I used in a
more recent Three.js. The code run well under dartium, but I've got some
difference in dart2js version :
* NormalMeshMaterial doesn't display with same colors
* WebGL error in my ShaderMaterial used to display explosions
*
I experiment successfully an other approach, using Three.js +
js-interop (introduce lot of boilerplate code). the dart2js performance
are similar (may be better) than Three.dart (but lesser than the
original full js version).
# About using Spectre
I
would prefer to use a dart solution for the display (type check, api
and code originaly targeted for dart, main team on dart). So I give a
quick try to Spectre, but :
* from the sample and article I read, I thinks it need lot of more code to setup scene, renderer, ...
*
I'm not sur I can do what I need to replace Three.js (+ future needs,
like AO, shadows), if you're ok I can send one email (on the ml) per
need / question / how to.
* I'm not sur about the
performance under Chrome and Firefox, the sample run "slowly" (~ 7 fps)
under chrome and failed under Firefox, under Dartium (~12 fps)
* younger than three.js, so there is a lot of less code, sample, article.
I'm
ok to try more with the help of John, Don, anyone (My main goal is to
create a game not to create a game-engine, assets pipelines, ...).
My
current asset are pretty basic, I made the vdrone under Blender (to
test the asset pipeline) but it can be created programmaticaly with 4
trianges, other 3d objects are box and planes.
Thanks for reading this long introduction.