@kevinroast kevinroast released this Mar 3, 2014 · 2 commits to master since this release

Assets 2

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.

@kevinroast kevinroast released this Feb 11, 2014 · 4 commits to master since this release

Assets 2

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.

Assets 2

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)

@kevinroast kevinroast released this Jan 3, 2014 · 17 commits to master since this release

Assets 2

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.

@kevinroast kevinroast released this Dec 30, 2013 · 21 commits to master since this release

Assets 2
  • 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)

@kevinroast kevinroast released this Nov 28, 2013 · 22 commits to master since this release

Assets 2
  • 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)

@kevinroast kevinroast released this Nov 18, 2013 · 24 commits to master since this release

Assets 2

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)

@kevinroast kevinroast released this Nov 11, 2013 · 27 commits to master since this release

Assets 2

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()

@kevinroast kevinroast released this Nov 4, 2013 · 30 commits to master since this release

Assets 2

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).

Nov 3, 2013
New lower quality but much higher performant polygon inflation algori…
…thm. Fixed issue where textured quads need each tri t

o be inflated individually.
Fix normals for scaled objects with inverted transposed normal matrix. Added uv coord test case for it.
Fix to issue found by nenek - plain shaded solid objects should not be excluded from sorting. Added uv coord test case for
 it.
Minor tweaks to hidden line angle defaults.