Enabled by "useConstantSpeed" parameter.
This is done by creating new spline which resamples original spline proportionally to linear-piece-wise integrated length of segments of the original spline.
It's not perfect, but speed-wise it should be better, especially when the original spline has very different lengths of segments.
New spline may have a bit different shape though (Catmull-Rom spline guarantees that it will pass through control points, but with more dense control points it may get kinks in between). You may control density of resampling by "resamplingCoef" parameter of the PathCamera.
No more need for manual update hack.
Problems with keeping constant speed are still there. Added debug particles sampled along the spline - seems problems come from spline, samples have weird distribution.
To be used like this:
python convert_obj_threejs_slim.py -i model.obj -m morph*.obj -o model.js
Morph filename strings can contain wildcards "*,?,[]".
For including morphs from multiple folders, use quotes and separate filename patterns by space:
python convert_obj_threejs_slim.py -i model.obj -m "folderA/morphA*.obj folderB/morphB*.obj ..." -o model.js
PathCamera automatically follows path passing through waypoints (interpolated via Catmull-Rom spline). View angles can be constrained and controlled by mouse.
Work in progress, there are still some issued to be solved (constant movement speed, broken automatic update, broken frustum culling).
Gah, that was painful. Obvious solution with object.lookAt doesn't work, forward facing direction (heading and attitude) is fine, but banking gets messed up:( Tried many fixes, none worked, so I just resorted to simple rotation around Y-axis based on direction vector.
Spline control points shouldn't be cycled, this produces freaky behaviors near start and end of path. Instead they have to be capped.
Also did some refactoring.
It's now possible to create fog with zero density (which makes sense if you want to build shader with fog support, but not yet use fog, in contrast to not having fog in scene at all).
Also updated GUI-DAT (didn't help with recent Chrome compositing bugs, though this is Chrome Windows issue), added FileAPI to Detector and fixed aspect ratio bug in WebGLRenderer.
Made face flipping heuristics optional, it messes up scenes that are ok.
For scenes that after exporting have objects with flipped normals, original assets can be fixed in Max in a following way:
1. find out problematic objects in Max
1. select all objects
2. set View -> xView to show "Face Orientation"
3. select all object that are fully/mostly green
4. in Utilities apply Reset XForm to selected objects (this will show messed normals also in Max, otherwise they are hidden)
2. fix problematic objects
1. apply Normals => flipNormals modifier to selected object
If no object is passed to initMaterials (for example, if material is pre-built while loading, or shader program is intended for sharing), max limit of 50 bones is used (should be enough to leave space for other uniforms not to hit ANGLE limits).
Hope so. At least now hacked face normals correspond to face normals computed from scratch in Geometry.
(If only max didn't have zillion ways how to achieve the same visual results :/. I tracked this flipped normals/faces business down to XForm modifier - it doesn't get collapsed properly when making TriMesh / Editable_mesh snapshots. At least Editable_mesh snapshot differs in way that is exploitable for workaround hack.)
Clearing API for rendering to RenderTarget is now flipped: before forced clearing of render target was default, now no clearing is default.
New way of doing things saves one extra duplicitous clear call when switching render targets (like when doing postprocessing).
(doing documentation is indeed turning out to be useful)