Commit Graph
201 Commits
Author SHA1 Message Date
Mr.doob c0d14df4a8 * Fixed examples that were still using scene.add() 2010-10-30 04:11:41 +01:00
Mr.doob 6f51ce7e8d * Trying to make the interaction stuff work... 2010-10-30 01:39:08 +01:00
Mr.doob d764c7980e Merge remote branch 'alteredq/master' 2010-10-29 16:40:43 +01:00
alteredq 129a128ec1 Cleaned up WebGLRenderer. Made Blinn-Phong shader work also in Firefox 4. 2010-10-29 13:35:31 +02:00
alteredq 45f7464793 Synced with mrdoob's branch. 2010-10-29 09:43:18 +02:00
Mr.doob 17641fed96 * Typo on point lights example link 2010-10-29 04:20:48 +01:00
Mr.doob 3e5fed7104 * .blend wasn't supposed to get in.... 2010-10-29 04:16:40 +01:00
Mr.doob 98693605e8 * Added point lights example 2010-10-29 04:15:00 +01:00
Mr.doob 4f1cb8f48f * Added point lights example 2010-10-29 04:00:11 +01:00
Mr.doob a0e9935a0f * Minor change to SVGRenderer 2010-10-28 21:48:32 +01:00
Mr.doob 1b1fb7affe * Code clean up (yuicompressor doesn't throw a single warning :D) and some reformating
* Minor fixes (Geometry normal calculation)
* Isolated Matrix3 code into `Matrix3.js`
* README and TODO updated
2010-10-28 21:27:58 +01:00
alteredq 79ab4bf2e6 Merged with mrdoob's branch. Got WebGLRenderer working again :)
Changed OBJ -> Three.js converter to use new materials system (eventual old models need to be reconverted).

Limitations:

  - one use case is now much slower
    - when a mesh has each face with different color (e.g. polyfield in examples/test.html)
    - before this used FaceColorFill material and in WebGLRenderer it was rendered fast with color attribute array
    - now when FaceColorFill material is gone, each face gets own VBO :(

  - material sorting uses Materials "toString" methods for hashing, so it's very important to keep these in a good shape
2010-10-28 19:35:13 +02:00
alteredq b6904f3d72 Added Blinn-Phong material for WebGLRenderer.
In Chrome it looks more or less ok, but it has some problem in Firefox 4 (with some camera angles there are black areas around edges).

Also updated Python builder scripts and examples to include this new material.
2010-10-27 21:16:11 +02:00
Mr.doob 71f96a5f1b Merge remote branch 'alteredq/master' 2010-10-27 17:50:40 +01:00
alteredq 5d7e32a3af Changed camera matrix update in WebGLRenderer to happen just once per frame, no need to do it with every object. 2010-10-27 10:27:59 +02:00
Mr.doob 7464f5ff97 * MeshBitmapUVMappingMaterial -> MeshBitmapMaterial. Second param is mode, which is THREE.MeshBitmapMaterialMode.UVMAPPING by default.
* Removed MeshFaceColorFillMaterial and MeshFaceColorStrokeMaterial
* Added MeshFaceMaterial ( it uses the face.material for that pass )
* CanvasRenderer and SVGRenderer per face material logic changed.
* SVGRenderer supports particles again.
* WebGLRenderer currently broken :/
* Code clean up
2010-10-27 08:49:00 +01:00
alteredq 87e0d754bd Premultiplied alpha in WebGLRenderer for MeshColorFillMaterial and MeshColorStrokeMaterial (to get closer to CanvasRenderer look). 2010-10-26 15:22:31 +02:00
alteredq 277d117b3d Refactored multimaterials to also work with non-textured models composed from multiple material groups.
Old version was doing massive overdraw (whole mesh was drawn for each material).

Even current solution is still quite messy: there is a different behavior for stroke and fill materials (when used as secondary materials).

Stroke materials are applied to the complete mesh (as most common use case seems to be wireframe) while fill materials now apply only to faces within single material group (when "decalIndex" property of secondary fill material is set).
2010-10-26 12:18:30 +02:00
alteredq 3db0c8777d Fixed broken normals in Blender 2.54 exporter.
There were two problems:

- vertices were in a different coordinate system than normals
- generated JS code was not properly handling normals with 0-sized components
2010-10-26 01:19:08 +02:00
alteredq 9bf3db34d3 Updated WebGLRenderer to use light intensity. 2010-10-25 14:00:49 +02:00
alteredq a0e3f4068f Changed exported JS class name in OBJ converter to use the same convention as Blender exporter (use exact case of JS filename, no capitalization). 2010-10-24 21:13:33 +02:00
alteredq 4a7082165a Synced with mrdoob's branch. 2010-10-24 19:53:36 +02:00
alteredq 1de8e6fd2a Disabled point light, now that it works also in WebGL, not to have red people :). 2010-10-24 19:34:03 +02:00
alteredq 2f1bf335c6 Forgot to build single file libraries and bump up version number. 2010-10-24 18:55:31 +02:00
alteredq ca261ddca5 Added point light / fixed directional light in WebGLRenderer / added light test example.
Changed WebGLRenderer to use 3x3 normal matrix.

Limitations of WebGL lights:

- currently handles only single one of each ambient/directional/point light
- light intensity modifier not yet taken into account
- only diffuse term (this applies also in CanvasRenderer)
2010-10-24 18:52:42 +02:00
alteredq fdb1ee5ff2 Added inversion of 3x3 rotation submatrix.
Added rudimentary 3x3 matrix class (just transpose, as this is needed for normal matrix).
2010-10-24 16:44:19 +02:00
Mr.doob 369a8661dc * WebGLRenderer: update camera and object matrices if autoUpdateMatrix == true 2010-10-23 16:57:10 +02:00
Mr.doob 836f1b878f * CanvasRenderer light per particle and lines 2010-10-23 02:22:52 +02:00
Mr.doob bd2dc37e50 (alteredq fix)
Changed mesh JS class name generator in Blender exporter to use cross-platform path parsing.
Old version was generating broken class names on Windows (full path was included).
2010-10-22 14:16:26 +02:00
alteredq 8a8dd0d9cb Changed mesh JS class name generator in Blender exporter to use cross-platform path parsing.
Old version was generating broken class names on Windows (full path was included).
2010-10-22 03:39:37 +02:00
alteredq 31644e179b Added link to OBJ converter script at GitHub to JS template. 2010-10-22 03:19:20 +02:00
alteredq 47a4c91ebc Merge remote branch 'remotes/upstream/master' 2010-10-22 03:14:27 +02:00
alteredq 69d93317c8 Forgot to build single file libraries. 2010-10-22 02:49:58 +02:00
alteredq ecae266e8a Added mesh stroke materials (wireframe) to WebGLRenderer.
Added multipass multimaterials to WebGLRenderer.

Refactored WebGLRenderer shader to become proto-mini-ubershader (untershader :).

Line width is currently not set properly on Chrome in Windows:

http://code.google.com/p/chromium/issues/detail?id=60124
2010-10-22 02:46:56 +02:00
Mr.doob 4da30fb353 * Blender 2.54 exporter: Added computeNormal and computeCentroids logic. 2010-10-22 00:02:19 +02:00
Mr.doob b61e4a453f * Added AUTHORS file
* Updated TODO
2010-10-21 17:05:15 +02:00
Mr.doob cb76523b31 * Added Blender 2.54 exporter. (Crossing fingers so they don't change the scripting system again...) 2010-10-21 14:11:11 +02:00
alteredq ce000d482f Merged remote branch 'upstream/master' (original mrdoob's version) 2010-10-21 02:00:52 +02:00
alteredq dde831bf6f Extended CanvasRenderer to be able to handle decals (MeshBitmapUVMappingMaterials as secondary materials).
For decals you need to set "decalIndex" property of the material (corresponding to materials index of the original mesh UV material).

Added multimaterials example.

Fixed forgotten sphere smoothing in OBJ converter example.
2010-10-21 01:38:29 +02:00
alteredq 36dc7212f8 Made Sphere mesh smoothing optional. 2010-10-21 01:17:58 +02:00
Mr.doob db7003e88a * CanvasRenderer and SVGRenderer calculating light only when needed. 2010-10-20 05:14:45 +01:00
alteredq 0f69c71924 Experiment to get backwards compatibility with the original meaning of materials array in Mesh (= extra materials are drawn for whole mesh).
Limitations:
 - works just in CanvasRenderer
 - doesn't work for MeshBitmapUVMappingMaterial as secondary material
2010-10-20 01:23:56 +02:00
alteredq 29be1febb0 Added handling of null materials (coming from Blender exporter when mesh has no assigned material). 2010-10-19 13:15:27 +02:00
alteredq 32133b352b Fixed crash bug when parsing quad faces. 2010-10-19 12:06:36 +02:00
alteredq 396d8d1cec Added male model to OBJ converter example. 2010-10-18 14:19:39 +02:00
unknown 60c2354424 Added OBJ -> Three.js converter.
Added OBJ converter test example.

Modified Three.js to handle converted models:

 - extended WebGL renderer to use texturing
   - broke down model into multiple VBOs according to materials
   - textures are lazy created when images get loaded
     (converter takes care of resizing images to nearest power of 2
      dimensions using 2d canvas)

 - changed material array semantics in Mesh object
    - before: multiple materials were applied to all faces (broken in WebGL, needs multitexturing shader)
    - now: there is only single material per face, but one mesh can have faces with different materials

 - added per vertex normals (to get smooth shading in WebGL)
2010-10-18 11:33:32 +02:00
Mr.doob 647b4a57b8 * Added PointLight
* `CanvasRenderer` and `SVGRenderer` basic lighting support (`*ColorStroke`/`*ColorFill` only)
* `Renderer` > `Projector`. `CanvasRenderer`, `SVGRenderer` and `DOMRenderer` do not extend anymore
* Interactivity base code (hdi folder). To be refactored... ([mindlapse](http://github.com/mindlapse))
* Added `computeCentroids` method to `Geometry`
* Included `Stats.js` directly in the `/examples` folder to avoid the need of internet for playing around
2010-10-06 03:36:21 +01:00
mindlapseandMr.doob a89865bda8 3d onclick, see examples/hci_clickcube.html 2010-09-30 23:11:29 +08:00
Julian WalkerandMr.doob 7c94809ed2 Using projection * view * obj matrix to transform vertices in Renderer instead of transforming twice (once by view * obj and once by projection). 2010-09-29 07:19:32 +08:00
Julian WalkerandMr.doob 930faff1ef Matrix4.lookAt now initializes W row (omitted previously). 2010-09-29 07:19:32 +08:00