Commit Graph
151 Commits
Author SHA1 Message Date
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 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 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 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 2f1bf335c6 Forgot to build single file libraries and bump up version number. 2010-10-24 18:55:31 +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
Mr.doob 4da30fb353 * Blender 2.54 exporter: Added computeNormal and computeCentroids logic. 2010-10-22 00:02:19 +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 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 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
Mr.doob e68109fdb2 - Clean up 2010-09-17 02:52:29 +01:00
Mr.doob 216b4eeee2 * Workaround for Opera bug (clearRect not working with context with negative scale)
* Additional `Matrix4` and `Vector3` methods
2010-08-21 02:58:07 +01:00
Mr.doob 8b18eafc78 - Added "Or so they say..." demo to featured projects.
- Camelcased the minified files (it feels weird both ways anyway...)
2010-07-25 03:34:29 +01:00
Mr.doob 217b1505a3 - Added ParticleBitmapMaterial.offset (Vector2) 2010-07-22 08:10:04 +01:00
Mr.doob 8820e868b9 - Missed a line change on the Blender 2.5b exporter 2010-07-17 14:58:54 +01:00
Mr.doob b381202910 * Using new object UV instead of Vector2 where it should be used 2010-07-17 14:52:39 +01:00
Mr.doob 8f543db16d * Refactored CanvasRenderer (more duplicated code, but easier to handle)
* `Face4` now supports `MeshBitmapUVMappingMaterial`
* Changed order of `*StrokeMaterial` parameters. Now it's `color`, `opacity`, `lineWidth`.
* `BitmapUVMappingMaterial` > `MeshBitmapUVMappingMaterial`
* `ColorFillMaterial` > `MeshColorFillMaterial`
* `ColorStrokeMaterial` > `MeshColorStrokeMaterial`
* `FaceColorFillMaterial` > `MeshFaceColorFillMaterial`
* `FaceColorStrokeMaterial` > `MeshFaceColorStrokeMaterial`
* `ColorStrokeMaterial` > `LineColorMaterial`
* `Rectangle.instersects` returned false with rectangles with 0px witdh or height
2010-07-17 00:25:50 +01:00
Mr.doob f62b6e988d - Added three_debug.js (Renders some debug data) 2010-07-14 00:11:53 +01:00
Mr.doob 1c729ec8a0 - strip() is not the right way to remove substrings, replace() is the right one 2010-07-13 22:49:52 +01:00
Mr.doob 5268aeb0c9 - Blender Exporter: Using filename instead of object name for classname (easier to use that way) 2010-07-13 19:57:44 +01:00
Mr.doob 418a1bc287 * Added ParticleCircleMaterial and ParticleBitmapMaterial
* `Particle` now use `ParticleCircleMaterial` instead of `ColorFillMaterial`
* `Particle.size` > `Particle.scale.x` and `Particle.scale.y`
* `SVGRenderer` currently out of sync
2010-07-12 14:40:54 +01:00
Mr.doob c58843f23e - Seems like new dev version of Blender has some Python API changes. (Can't wait until Blender 2.5 gets released :D) 2010-07-10 11:33:12 +01:00
Mr.doob 7b385cf7a8 - First version of the WebGLRenderer (ColorFillMaterial and FaceColorFillMaterial by now)
- Matrix4.lookAt fix (CanvasRenderer and SVGRenderer now handle the -Y)
- Color class now using 0-1 floats instead of 0-255 integers
2010-07-07 02:35:27 +01:00
Mr.doob 4d0fdbb1c6 - Scene.add > Scene.addObject
- Enabled Scene.removeObject
- Removed computeNormals() from Geometry
2010-07-03 17:49:24 +01:00
kikko eaea61c306 added UVs and Normals to exported mesh and set mesh name as Classname instead of full path 2010-07-03 15:31:34 +02:00
Mr.doob 368e6a19c2 - Added WIP Blender 2.5 exporter 2010-06-23 00:27:55 +01:00
Mr.doob 7935bc8ab9 - Changed Camera system. (Thx [Paul Brunt](http://github.com/supereggbert))
- Object3D.overdraw = true to enable CanvasRenderer screen space point expansion hack.
2010-06-22 22:31:48 +01:00
Mr.doob 2a3d1e35cb * autoClear property for renderers.
* Removed SVG rgba() workaround for WebKit. (WebKit now supports it);
2010-06-20 19:59:36 +01:00
Mr.doob 55e4bde5cd + TextureUVMappingMaterial > BitmapUVMappingMaterial
+ Expand UVs (this should fix the glitches)
2010-06-07 19:43:34 +01:00
Mr.doob 90f54e2507 - CanvasRenderer expands screen space points (workaround for antialias gaps).
- CanvasRenderer supports TextureUVMappingMaterial.
- Moved UVs to Geometry.
- Minor clean up
2010-06-07 03:36:10 +01:00
Mr.doob e98397cb5a + Added Line Object
+ Workaround for WebKit not supporting rgba() in SVG yet
+ Aesthetic changes on the readme file
2010-06-05 20:07:04 +01:00
Mr.doob 530f87070f 2d clipping on CanvasRenderer and SVGRenderer
clearRect optimisations on CanvasRenderer
2010-05-17 11:36:27 +01:00
Mr.doob d495a40406 That's not needed here... 2010-05-16 05:33:56 +01:00
Mr.doob a6e98d7e9a Removed Class.js dependency
Added THREE namespace
Camera.x -> Camera.position.x
Camera.target.x -> Camera.target.position.x
ColorMaterial -> ColorFillMaterial
FaceColorMaterial -> FaceColorFillMaterial
Materials are now multipass (use array)
Added ColorStrokeMaterial and FaceColorStrokeMaterial
geometry.faces.a are now indexes instead of links
2010-05-16 05:32:43 +01:00
Mr.doob 106c77b9d0 Reverting 2010-05-01 15:36:37 +01:00
Mr.doobandMr.doob 4f14b7b89e r5 2010-05-01 13:17:38 +01:00
Paul BruntandMr.doob aac043805c first attempt at webGL renderer - not working yet 2010-05-01 19:42:16 +08:00
Paul BruntandMr.doob daf53d854d Now using projection matrix and particles are culled 2010-05-01 19:42:01 +08:00