I try with Accelerometer data on Android device. In script
function setup() {
createCanvas(100, 100);
}
function draw() {
background(200);
console.log(rotationX)
}
there is only a null. Why should I do to get value of rotationX?
I try with Accelerometer data on Android device. In script
function setup() {
createCanvas(100, 100);
}
function draw() {
background(200);
console.log(rotationX)
}
there is only a null. Why should I do to get value of rotationX?
Maybe you should be in webgl mode
createCanvas(100, 100, WEBGL);
Unfortunately, it doesn’t help.
The word null or the number 0 ??
Did you try other variables such as rotationZ or
It is null. RotationY and Z doesn’t work either. Any other ideas?
Is this your entire Sketch or are there more lines?
You cannot have a variable of the same name for example
It is a fragment of bigger script, but it should work separately.
In manual there is similar one:
Hello @Katarzyna,
The example works on my Android phone with Google Chrome:
https://p5js.org/reference/#/p5/rotationX
Steps:
console.log(rotationX);
:)