Commit Graph
39 Commits
Author SHA1 Message Date
alteredq cf37a8cc43 First integration step: something appeared on the screen ;)
Otherwise things are very much work in progress, expect everything to be broken.
2011-02-16 17:58:19 +01:00
alteredq df513e044c Transplanted simple hierarchy system from WebGLRenderer2 into WebGLRenderer.
Work in progress.

As with static objects, faster with OpenGL (34 -> 38 fps) and slower with ANGLE (30 -> 27 fps).
2011-02-15 04:22:37 +01:00
alteredq 750a242f0c Added vertex colors for particles. 2011-02-03 23:54:30 +01:00
alteredq 5365a11b0e Small refactoring in handling of "dirty" buffers in WebGLRenderer. 2011-02-03 19:00:02 +01:00
alteredq 8227d9f118 Added billboard particles (semi-opaque depth sorted).
Work in progress, caveats:

- sort happens just inside one ParticleSystems, so everything gets messed up when more ParticleSystems are in the same screen space
- not yet solved proper order of operations, if you change object transform, you need to update ParticleSystem object matrix manually before rendering (so that sort works, otherwise it will use transform from previous frame)

Also fixed transparency in fog and did small optimizations in WebGLRenderer.
2011-02-03 02:53:33 +01:00
alteredq 1d9c3405a3 Changed ParticleSystem to autoupdate transform by default (as do Mesh and Line objects). 2011-02-02 12:41:42 +01:00
Mr.doob 37a053b308 Fixed PointLight prototype code (thx rectalogic) 2011-01-25 20:05:46 +00:00
astrodud 6c071233d6 This is the Object3D.js code as it *should* have been committed 2011-01-18 05:35:32 -08:00
Mr.doob 5accd0cfd7 Brought back Object3D.rotationMatrix (Projector still uses it). 2011-01-18 07:29:39 +00:00
astrodud c9706f85bf Optimized Object3D.updateMatrix to (1) cut down where possible on new Matrix4 allocation, (2) only compute
rotation/scale matrices if needed (if no rotation, no need t compute); and (3) no longer require
storage of translationMatrix or scaleMatrix (1 per object). Uses a single tmpMatrix instead.
2011-01-17 22:27:32 -08:00
alteredq 0f5652390f Added dynamic geometry support also for WebGL lines. Changed line strip example to use Hilbert curves.
Also fixed tons of bugs in lines handling.

TODO: make some example for dynamic lines.
2011-01-13 14:12:18 +01:00
alteredq e43de3dcf7 Refactored lines handling in WebGLRenderer to use the same internal machinery as meshes.
No need to stuff them in different bucket, line-specific stuff is anyway done in `renderBuffer` method.

This was prompted by starting with implementation of ParticleSystem. It would be unwieldy to handle three different buckets of objects / buffers.
2011-01-08 17:33:55 +01:00
alteredq bbe2a3bf56 Refactored handling of continuous lines: now they are rendered using LINE_STRIP primitive. Added example for this.
Also renamed associated constant to THREE.LineStrip (was THREE.LineContinuous).
2011-01-08 01:15:01 +01:00
alteredq 548c331519 Added crude lines support to WebGLRenderer.
As expected, performance of one-to-one conversion from CanvasRenderer was horrible, so I had to change a bit how lines are handled.

Line object now has "type" property:

    - default type is "THREE.LineContinuous" which should behave as before: geometry represents one continuous line (v0 ... vn)

    - new option is "THREE.LinePieces" which tells renderer that geometry represents collection of individual line segments (v0,v1) ... (vn-1, vn)

(one Line object corresponds to one VBO)

(same limitations as with meshes - once VBO is baked, no changes are possible except object transforms - scale / rotation / position)
2011-01-04 04:38:25 +01:00
Mr.doob bffdc03cf1 *.material*.materials 2010-12-24 21:24:58 +00:00
Mr.doob 5e2c480b89 Implemented Frustum checking to Projector::projectObjects (thanks errynp)
Added `boundingBox`, `boundingSphere` and `computeBoundingSphere` to Geometry.
2010-12-20 00:28:31 +00:00
Mr.doob f50f42dde1 Commented out Mesh::normalizeUVs. Needs to be handled in the CanvasRenderer directly.
Added a check in `Scene` to make sure the avoid duplicate objects.
WebGLRenderer2: In the process of handling > 65535
2010-12-15 14:36:42 +00:00
Mr.doob 584a8440fd Merging with alteredq's branch. 2010-12-02 17:24:56 +00:00
Mr.doob b913baa6f0 Code clean up and minor optimisations. 2010-11-26 07:58:44 +00:00
alteredq d3cd0887d2 Added handling of object removal to WebGLRender. Added visibility parameter to Object3D. 2010-11-24 03:43:44 +01:00
Mr.doob d961ee52c8 Started GeometryUtils class.
MeshUtils.merge( object1, object2 [ geometry | mesh ] ): Merges object2 into object1. Implemented in materials_cubemap_sky.
2010-11-19 09:08:20 +00:00
Mr.doob 3cdc007b90 * Fixed some minor issues handling opacity in hex colors 2010-11-06 12:51:09 +00:00
alteredq 406063d588 Added breaking of mesh into chunks of max 64K vertices (done in materials sorting step). 2010-11-02 19:12:05 +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
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 5ff2dfcaca - Added Mesh.flipSided boolean 2010-07-19 16:13:40 +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 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 0aac038d58 - JSLinted 2010-06-19 18:13:00 +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 06c7ec335f - Added Camera3D.autoUpdateMatrix
- Added Object3D.autoUpdateMatrix
2010-06-05 21:16:16 +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 2a334e0862 Credit where credit is due. 2010-05-16 16:38:54 +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 4f22f423b5 Fixed incorrect rotation matrix calculation. Particles examples clean up. Added Cube and Plane primitives. Added Cube geometry example. 2010-04-24 21:25:21 +01:00
Mr.doob a90c4e107f First public version. Still a lot to do 2010-04-24 04:01:19 +01:00