-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Screen and Device local coordinates #31
Conversation
@kenchris, @alexshalamov, @anssiko PTAL |
index.bs
Outdated
|
||
<img src="images/accelerometer_coordinate_system.png" srcset="images/accelerometer_coordinate_system.svg" style="display: block;margin: auto;" alt="Accelerometer coordinate system."> | ||
The [=local coordinate system=] for the spatial sensor classes in this specification |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
defined in this specification
index.bs
Outdated
can be defined as either [=device coordinate system=] or [=screen coordinate system=]. | ||
|
||
The <dfn export>device coordinate system</dfn> is defined as a three dimensional | ||
Cartesian coordinate system (x, y, z) which is bound to the physical device. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
, before which (that is English grammar, if you don't like ", which", then use "that"
index.bs
Outdated
The <dfn export>device coordinate system</dfn> is defined as a three dimensional | ||
Cartesian coordinate system (x, y, z) which is bound to the physical device. | ||
For devices with display the origin of the [=device coordinate system=] is in the center | ||
of the device display. If the device is held in a default position the Y-axis points |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"a default position" sounds wake... will it have multiple? in its default position
index.bs
Outdated
the X-axis points towards the right of the [=dom-screen=] and Z-axis is a | ||
vector product of X and Y axes and it points towards the [=dom-screen=] viewer. | ||
|
||
The main difference between the [=device coordinate system=] and the [=screen coordinate system=] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
, before is
index.bs
Outdated
vector product of X and Y axes and it points towards the [=dom-screen=] viewer. | ||
|
||
The main difference between the [=device coordinate system=] and the [=screen coordinate system=] | ||
is that the [=screen coordinate system=] always follows [=dom-screen=] orientation, i.e. it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
follows THE
index.bs
Outdated
The main difference between the [=device coordinate system=] and the [=screen coordinate system=] | ||
is that the [=screen coordinate system=] always follows [=dom-screen=] orientation, i.e. it | ||
will swap X and Y axes in relation to the device if the [=current orientation type=] | ||
changes. In contrast, the [=device coordinate system=] will always remain the same. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should you mention use-cases?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, and we're also planning to add some illustrations, however I'd like it to be in follow up patches.
index.bs
Outdated
enum LocalCoordinateSystem { "device", "screen" }; | ||
|
||
dictionary SpatialSensorOptions : SensorOptions { | ||
LocalCoordinateSystem localCoordinates = "device"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it might be clearer if we call it "referenceFrame" or so?
LocalCoordinateSystem referenceFrame = "device";
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this comment! it is exactly what I'm thinking right now :) also we can probably mention at w3c/sensors#340, that 'local coordinate system' represents frame of reference for the sensor readings..
75aacaa
to
67b649c
Compare
@kenchris I've updated the patch, could you take another look? |
index.bs
Outdated
|
||
The <dfn export>device coordinate system</dfn> is defined as a three dimensional | ||
Cartesian coordinate system (x, y, z), which is bound to the physical device. | ||
For devices with display the origin of the [=device coordinate system=] is in the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For devices with A display COMMA, the origin
is REMOVE IN the center
index.bs
Outdated
The <dfn export>device coordinate system</dfn> is defined as a three dimensional | ||
Cartesian coordinate system (x, y, z), which is bound to the physical device. | ||
For devices with display the origin of the [=device coordinate system=] is in the | ||
center of the device display. If the device is held in its default position the Y-axis |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
position, COMMA
index.bs
Outdated
For devices with display the origin of the [=device coordinate system=] is in the | ||
center of the device display. If the device is held in its default position the Y-axis | ||
points towards the top of the display, the X-axis points towards the right of the | ||
display and Z-axis is a vector product of X and Y axes and it points towards the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... is THE vector product of the X- and Y-axes and it points OUTWARDS from the display, and towards the VIEWER.
index.bs
Outdated
@@ -33,6 +33,10 @@ urlPrefix: https://w3c.github.io/sensors; spec: GENERIC-SENSOR | |||
text: default sensor | |||
text: construct a sensor object; url: construct-sensor-object | |||
text: sensor type | |||
urlPrefix: https://w3c.github.io/screen-orientation; spec: SCREEN-ORIENTATION | |||
type: dfn | |||
text: current orientation type |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
text: current orientation type, url: dfn-current-orientation-type
(Or whatever it takes to fix the link.)
index.bs
Outdated
display viewer. | ||
|
||
The <dfn export>screen coordinate system</dfn> is defined as a three dimensional | ||
Cartesian coordinate system (x, y, z), which is bound to [=dom-screen=]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to THE
index.bs
Outdated
Cartesian coordinate system (x, y, z), which is bound to [=dom-screen=]. | ||
The origin of the [=screen coordinate system=] is in the center | ||
of the [=dom-screen=]. The Y-axis always points towards the top of the [=dom-screen=], | ||
the X-axis points towards the right of the [=dom-screen=] and Z-axis is a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a/THE
index.bs
Outdated
Reference Frame {#reference-frame} | ||
---------------- | ||
|
||
The [=local coordinate system=] for the [=spatial sensor=] classes defined |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe
The reference frame for the sensor classes defined in this specification, is a local coordinate system, which can be defined as either THE device coordinate system, or THE screen coordinate system
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reference frame also includes time, while 'local coordinate system' omits time component.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can be rephrased: "The reference frame for the sensor classes defined in this specification,
is expressed in a [=local coordinate system=]"
index.bs
Outdated
urlPrefix: https://w3c.github.io/screen-orientation; spec: SCREEN-ORIENTATION | ||
type: dfn | ||
text: current orientation type | ||
text: dom-screen; url: dom-screen |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think, if text and link are the same, you can leave just 'text:' part
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Usually that works, but in this case text: current orientation type
creates a link to https://w3c.github.io/screen-orientation/#current-orientation-type that does not exist. Should go to https://w3c.github.io/screen-orientation/#dfn-current-orientation-type thus explicit text: current orientation type; url: dfn-current-orientation-type
needed. ReSpec bug perhaps.
index.bs
Outdated
Reference Frame {#reference-frame} | ||
---------------- | ||
|
||
The [=local coordinate system=] for the [=spatial sensor=] classes defined |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reference frame also includes time, while 'local coordinate system' omits time component.
enum LocalCoordinateSystem { "device", "screen" }; | ||
|
||
dictionary SpatialSensorOptions : SensorOptions { | ||
LocalCoordinateSystem referenceFrame = "device"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer LocalCoordinateSystem coordinateSystem = "device";
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO, referenceFrame
would be more understandable for the API user (even though coordinateSystem
is a more accurate term from the physics point of view). WDYT?
index.bs
Outdated
|
||
The main difference between the [=device coordinate system=] and the [=screen coordinate system=], | ||
is that the [=screen coordinate system=] always follows the [=dom-screen=] orientation, | ||
i.e. it will swap X and Y axes in relation to the device if the [=current orientation type=] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we use term from generic sensor spec? Instead of saying 'swap' use remap readings?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here is no remap happening, we're just describing the coordinate system per se (apart from readings transformation)
"In physics, a frame of reference (or reference frame) consists of an abstract coordinate system and the set of physical reference points that uniquely fix (locate and orient) the coordinate system and standardize measurements." (wikipedia) I don't think it necessarily includes times, though I does in Einsteinian relativity. In a way, a 4 component system with time included is also a coordinate system |
This patch introduces definition for 'device' and 'screen' coordinate systems as possible local coordinates options for spatial sensor classes. The `SpatialSensorOptions` dictionary and the "construct spatial sensor object" are added, so that the client can set the local coordinate system for a Sensor instance from the constructor.
67b649c
to
182d910
Compare
PTAL at the updated patch |
|
Lgtm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah have to make a review and not comments
@@ -33,6 +33,10 @@ urlPrefix: https://w3c.github.io/sensors; spec: GENERIC-SENSOR | |||
text: default sensor | |||
text: construct a sensor object; url: construct-sensor-object | |||
text: sensor type | |||
urlPrefix: https://w3c.github.io/screen-orientation; spec: SCREEN-ORIENTATION |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trying to find out how I approve :)
Thank you for review! |
This patch introduces definition for 'device' and 'screen'
coordinate systems as possible local coordinates options
for spatial sensor classes.
The
SpatialSensorOptions
dictionary and the"construct spatial sensor object" are added, so that
the client can set the local coordinate system for a
Sensor instance from the constructor.
This patch is a part of fix for w3c/sensors#257
Preview | Diff