Skip to content

Releases: kevinroast/phoria.js

v0.9.16

03 Mar 17:08
Compare
Choose a tag to compare

Updated gl-matrix to latest including bug fix pull request #106 - fixes issues with mat4.translate(). Restored related phoria tests to original versions now the gl-matrix translate bug is fixed.

v0.9.15

11 Feb 18:15
Compare
Choose a tag to compare

Object picking contribution from Ruan Moolman - intergrated into new Phoria.View. - Also includes utility methods to convert planer to polar and back plus poly/line intersection tests.
Added picking demo page test0p.html - showing highlight when cube is picked.

Moved mouse events into Phoria.View class. - phoria-view.js is an optional include to provide additional functionality such as high-level mouse event handling and object picking.

Upgrade to latest gl-matrix r235 - NOTE translation is now always along global axis - not object local. Fixed up tests to reflect changes.

Rotation example test0q.html using Quarternions to rotate in either World or Local object axis and avoiding gimbal-lock.

Optimization to calculate average Z during main scene processing loop

Added methods to retrieve screen coordinates bounding rectangle and world coordinates bounding cube for an entity.

v0.9.14

25 Jan 22:17
Compare
Choose a tag to compare

Added incremental rotation example (see test0r.html) and mouse events. Mouse events helpers added to new Phoria.View class (in phoria-utils.js)

Added entity method to rotate by the given yaw (heading), pitch (elevation) and roll (bank) Euler angles - entity.rotateYPR()

Phoria.Util.importGeometryWavefront now loads uv coordinates for textures from obj file format.

Added cylinder geometry generation
Added generator code for an Icosahedron.
Added simple normalised triangle subdivision algorithm - e.g. to subdivide a normalised Icosahedron to generate geodesic style sphere.

Updated test1.html to add example of new Icosahedron geometry and subdivision.

Added onBeforeScene event handler - allow modification of entity local matrix before it is multipled by the parent and before transformations occur.

Bug fix to simple physics to apply physics calculations before the local matrix is modified in the scene processing - position is now updated in onScene correctly.
Fix to basic physics simulation time calculations. Debug object now shows worldposition if present from PositionalAspect.
Bug fix to default position record for generated particle. Bug fix to default particle rendering style - useful if particles are replaced with full polygon lightsourced entities.
Implemented transparent style for wireframe and point rendered objects.

Fixed incorrect object sortmode property in a couple of test pages.

Minor improvement to fireworks demo (test9.html)

v0.9.13

03 Jan 11:46
Compare
Choose a tag to compare

Object style and polygon opacity implemented. Values from 0-1. Complete object or individual polygon setting. Usage:

obj.style.opacity = 0.5;

or for example on individual polygons:

polygons: [{vertices:[0,1,2], color:[255,0,0], opacity:0.5}]

You may also want to set the following to make transparent objects render correctly and look better:

obj.style.doublesided = true; // back faces of polygons visible
obj.style.fillmode = "fill"; // avoid overdraw from inflating polygons

Added "test1t.html" test scene for transparent polygon example see http://www.kevs3d.co.uk/dev/phoria/test1t.html

Changed minified phoria script to no longer include gl-matrix-min.js directly. NOTE! This means you must include the minified gl-matrix-min.js before phoria-min.js if you are using it.

v0.9.12

30 Dec 23:41
Compare
Choose a tag to compare
  • Implemented emit light polygons and object style (glowing).
  • Live debug example test scene - see test1d.html
  • obj.style.geometrysortmode implemented.
  • 'sprite' style is now index value not a reference to an Image element - instead references textures list on parent emitter. (see API change information below)
  • Added static helper to generate a basic entity 'style' structure.

NOTE API change!
What has changed:
'sprite' style is now index value not a reference to an Image element - instead references textures list on parent emitter.
Why did it change:
Because it ensures 'style' objects are always serialisable (plain JavaScript string/int/boolean properties only) and can be merged by a simple object combine.
How to migrate:
Find and Replace use of:

obj.style.sprite = bitmaps[0];

with:

obj.style.sprite = 0;
obj.textures.push(bitmaps[0]);

(svn r636)

v0.9.11

28 Nov 21:10
Compare
Choose a tag to compare
  • NOTE API change!
    What has changed:
    Sorting mode Entity API refactor - entity style "sortmode" property renamed to "objectsortmode". The "objectsortmode" supports 3 values of "sorted", "front", "back" - the 'front' and 'back' values allow objects to be forced to the front or back of the display list.
    Why did it change:
    Because a future version of Entity will introduce "geometrysortmode" as a way of overriding the default behaviour for sorting of the points/edges/polygons for an entity, renaming sortmode will help avoid confusion with this new property.
    How to migrate:
    Find and Replace use of "sortmode" property with "objectsortmode"
  • Improved x2 performance quicksort routine for sorting points coords/worldcoords lists.
  • Fix to not apply perspective division to z component of NDC coords - improves coarse object sorting so particles always appear in correct depth position relative to other objects.
  • Simplified and optimized scene processing loop for entity matrix processing. Clearer comments for rendering pipeline calculations.
  • Refactored scene processing to keep track of camera space coords to move sorting of geometry to after clip calculation - avoids sorting on objects that are out of visible camera space.

(svn r631)

v0.9.10

18 Nov 23:18
Compare
Choose a tag to compare

Changed hidden surface removal test to use screen coords area sign test - no longer see popping polygons as they disappear from view. Removed 'hiddenangle' style settings as no longer required.

Debug method added - to show entity XYZ axis, also show position and entity id at runtime. See Phoria.Entity.debug()

Added 'front' and 'back' to object 'sortmode' style to allow rendering over other objects for debug labels etc.

Fix to ensure newly added scene trigger functions are not executed until next scene processing loop.

Minor bug fix to potential issue with null local matrix on solid objects.

(svn r619)

v0.99

11 Nov 21:08
Compare
Choose a tag to compare

Wavefront .obj importer - add test2i.html to demonstrate loading teapot.obj file. Contribution from Daniel Mikołajczak.

  • see Phoria.Util.importGeometryWavefront()
  • scaling factor or scale to a size options, automatic centering

Changed array looping construct to avoid issues with Array prototype modifications by libraries like MooTools or prototype.js.

Simple Ajax loader util function added to avoid needing a 3rd party lib like JQuery just to perform an Ajax request.

  • see Phoria.Util.request()

v0.98

04 Nov 17:03
Compare
Choose a tag to compare

Refactored global math constants into Phoria namespace (e.g. RADIANS is now Phoria.RADIANS)
Normal matrix calculation fixes related to transformed normals - fixes issues with non-uniform object scaling and translation of objects messing up lighting.
Optimized some related normal calculations.
Improved documentation related to Distant light direction (i.e. normalized direction vector)
Improved code comments related to object->world->camera space calculations.
Allow a texture index to be set on the 'style' for an Entity - to avoid having to set texture index per polygon when all polygons are using same texture. Tweaked test0uv to demonstrate.
Fixed scene JSON serialisation (prototype) related to objects with textures applied.
Fixed top and bottom generated cube face orientation (for uv coords).