VOOZH about

URL: https://www.geeksforgeeks.org/javascript/p5-js-turnaxis-variable/

⇱ p5.js turnAxis variable - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

p5.js turnAxis variable

Last Updated : 12 May, 2021

The turnAxis variable is used to store the axis triggered by the deviceTurned() method. This takes place when a mobile device is rotated in any of the X, Y or Z axis. This variable is only defined within the scope of the deviceTurned() function.

Syntax:

turnAxis

The below example demonstrates the turnAxis variable in p5.js:

Example:

Output:

👁 Image
Reference:https://p5js.org/reference/#/p5/turnAxis
Comment