- 07 11月, 2010 4 次提交
-
-
由 alteredq 提交于
-
由 alteredq 提交于
-
由 alteredq 提交于
-
由 alteredq 提交于
If you want to use binary format, convert OBJ models using "convert_obj_threejs_slim.py" with "-t binary" option. This will now create two files: JS part with materials BIN part with binary buffers Binary models are loaded like this: loader.loadBinary( 'obj/lucy/Lucy250k_bin.js', function( geometry ) { createScene( geometry, s ) }, "obj/lucy" ); (difference to ascii format is that url root must be always specified so loader can find binary buffers file, like it already was for textures) Good news: - raw binary files are quite smaller than raw ascii files (about half size) - loading times went down about 20-25% - now also Firefox can handle 250k triangle mesh (it just bugs about long running script), with ascii format it threw "array initialiser too large" exception Mixed news: - gzipped binary files are only about 25% smaller than gzipped ascii files so actual benefits are smaller, also it's more likely server will have JS gzipping on by default, while you need to set it up for other formats (could be hacked around by naming binary files with JS extension instead of BIN?) Bad news: - browser blocking is back :( Not that it ever went completely away (for large models object creation is more costly than loading and it is blocking), but it was slightly better with ascii loader (where data is loaded as worker's JS body). - this comes from having to use Ajax to load binary data - loading binary data by Ajax from within worker didn't really help, it was in fact slightly slower and browser did freeze :( - can't easily embed binary data in JSON (would need to encode it which would make it bigger, defying the purpose) - Loader got fatter Also in this commit: renamed Loader.loadAsync() => Loader.loadAsciiOld() and Loader.loadWorker() = Loader.loadAscii() so that names correspond to model formats instead of underlying implementation. loadAsciiOld - JS exported by Blender and old OBJ converter loadAscii - JSON created by slim OBJ converter (-t ascii) loadBinary - JSON + BIN created by slim OBJ converter (-t binary) TODO: - look into UV coordinates, should be indexed the same way as vertices, normals and faces are (instead of unrolled per each face) - look into HTML5 File API, binary blobs could help
-
- 06 11月, 2010 1 次提交
-
-
由 Mr.doob 提交于
-
- 05 11月, 2010 15 次提交
-
-
由 sole 提交于
-
由 Mr.doob 提交于
-
由 sole 提交于
-
由 Mr.doob 提交于
-
由 Mr.doob 提交于
-
由 alteredq 提交于
Small clarifications in large mesh example description: model size meanwhile went down to 3.5 MB ;) and file access flag applies to Chrome.
-
由 alteredq 提交于
-
由 Mr.doob 提交于
* Added the first WebGL example to README \:D/
-
由 Mr.doob 提交于
* Cleaned interactive_cubes example code.
-
由 Mr.doob 提交于
-
由 Mr.doob 提交于
-
由 Mr.doob 提交于
-
由 Mr.doob 提交于
-
由 alteredq 提交于
This is a first step towards eventual binary model format.
-
由 Mr.doob 提交于
* Fixed a bug in Ray.intersectObject: face.normal needs to be transformed using matrixRotation otherwise rotated objects fail * A bit nicer example
-
- 04 11月, 2010 3 次提交
-
-
由 alteredq 提交于
-
由 Mr.doob 提交于
Unimpressive example added `interactive_spheres.html`
-
由 alteredq 提交于
The idea is that later there will be more loaders which would load different formats (like OBJLoader, ColladaLoader). Usage (async JS): var loader = new THREE.Loader(); loader.loadAsync( "obj/torus/Torus.js", function() { createScene( new Torus() ) } ); Usage (web worker): var loader = new THREE.Loader(); loader.loadWorker( "obj/torus/Torus_slim.js", function( geometry ) { createScene( geometry ) } ); Web worker loader is useful for large meshes, where it allows browser to stay responsive for longer time and also it can handle larger meshes than async JS loader. Web worker loader needs a simpler format of the model. Web workers can communicate with the main application only via message passing, where messages are JSON objects. There is a new version of OBJ -> Three.js converter (convert_obj_threejs_slim.py) which can produce model in format needed for web workers. All examples which were using models from OBJ converter were refactored to use Loader. Except large mesh example, all examples are using just async JS loading. Web worker loading is there, it's just commented out, as it's a bit pain for local development. Chrome doesn't allow to run web workers from pages accessed via file://, so you need either to run it with "--allow-file-access-from-files" flag, or access examples via local server (http://localhost/example.html).
-
- 03 11月, 2010 8 次提交
-
-
由 Mr.doob 提交于
-
由 Mr.doob 提交于
-
由 Mr.doob 提交于
Work in progress refactoring ClickResolver.js to Ray.js
-
由 alteredq 提交于
-
由 alteredq 提交于
-
由 alteredq 提交于
-
由 alteredq 提交于
Quick and dirty fix for OBJ converter demo: don't do backface culling to get back floor mesh that disappeared (turning it upside down gets ugly lighting).
-
由 alteredq 提交于
-
- 02 11月, 2010 2 次提交
- 01 11月, 2010 3 次提交
-
-
由 alteredq 提交于
Fixed ambient light computation in CanvasRenderer to get correct lighting when there is no ambient light specified in the scene.
-
由 alteredq 提交于
-
由 Mr.doob 提交于
* Clickresolver.js: Implemented blackpawn's point in triangle algos ( http://www.blackpawn.com/texts/pointinpoly/default.html ). Now works properly with Face3 too.
-
- 31 10月, 2010 4 次提交
-
-
由 Mr.doob 提交于
Now we just need to make sure geometry.computeCentroids() is called at the end of creating/modifying the geometry, otherwise things break...
-
由 Mr.doob 提交于
* Projector.js: Rather than calculating the screen space centrium of each face per render, seemed smarter to just project the precomputed centrium. Side effect: Polygon shaking is gone \o/
-
由 alteredq 提交于
-
由 Mr.doob 提交于
-