W3C home > Mailing lists > Public > public-canvas-api@w3.org > April to June 2016

Re: Hit regions and WebGL...

From: Justin Novosad <junov@google.com>
Date: Tue, 12 Apr 2016 21:39:59 -0400
Message-ID: <CABpaAqSEFFN+n9sccTQuqBtj13dsOC25tpxrdd7_ipsoR8J6uw@mail.gmail.com>
To: Dominic Mazzoni <dmazzoni@google.com>
Cc: public-canvas-api@w3.org, Frank.Olivier@microsoft.com
On Apr 12, 2016 7:20 PM, "Dominic Mazzoni" <dmazzoni@google.com> wrote:
> What's the equivalent of a path in WebGL? Is that even a concept that
exists now or is it something we'd have to define?

The Path2D interface could be used with WebGL, but it is not ideal since it
restricts the definition of a region to a planar geometry. It would
probably make more sense to have some sort of 3D mesh primitive to get hit
regions that map more directly to elements in a WebGL scene.

> On Tue, Apr 12, 2016 at 1:54 PM Justin Novosad <junov@google.com> wrote:
>> It was recently pointed out in another thread that there is a lack of
consideration for WebGL use cases in the design of the canvas hit region
>> I would like to reboot the discussion on this mailing list where much of
the discussions on the hit regions spec has taken place in the past.
>> Three issues with the current spec:
>> The API methods are on the CanvasRenderingContext2D (no WebGL). They
could be either moved to HTMLCanvasElement, or moved to a sub-interface
that is implemented by both CanvasRenderingContext2D and
WebGLRenderingContext (and any other place they're wanted)
>> There is a dependency on the current path and current transform of the
2d rendering context. That information could be passed in as
HitRegionOptions fields instead. Also, passing the transform as a DOMMatrix
would allow general 3D transforms to be applied, which would be desireable
for WebGL. In the whatwg edition of the spec, there is already a 'path'
field in HitRegionOptions that takes a Path2D object (another whatwg-ism).
>> (Not related to WebGL) The event processing model is inconsistent with
other APIs.  That part of the spec should probably be re-written to re-use
existing platform features. For example, hit regions could be ordinary
event targets. Also, the 'region' event member name is perhaps too generic.
>> AFAIK, no browsers have yet shipped any hit region APIs, so there is
still an opportunity to make major changes without breaking the Web.
Shipping in Chrome is possibly imminent, but we are almost certainly going
to put it on hold to take the necessary time resolve the issues mentioned
>> Thoughts?
>>     -Justin
>> P.S.: Original thread was in a whatwg issue, here:
Received on Wednesday, 13 April 2016 01:40:28 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 13 April 2016 01:40:29 UTC