Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. OrientationSensor
  4. populateMatrix()

OrientationSensor: populateMatrix() method

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Secure context: This feature is available only insecure contexts (HTTPS), in some or allsupporting browsers.

ThepopulateMatrix() method of theOrientationSensor interface populates the given target matrix with therotation matrix based on the latest sensor reading. The rotation matrix is shownbelow.

The formulas used to convert the sensor's quaternion to the provided matrix.

where:

  • W = cos(θ/2)
  • X = Vx * sin(θ/2)
  • Y = Vy * sin(θ/2)
  • Z = Vz * sin(θ/2)

Syntax

js
populateMatrix(targetMatrix)

BecauseOrientationSensor is a base class,populateMatrixmay only be read from one of its derived classes.

Parameters

targetMatrix

TBD

Return value

None (undefined).

Examples

js
// TBD

Specifications

Specification
Orientation Sensor
# orientationsensor-populatematrix

Browser compatibility

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp