Skip to content

Tag Archives: JavaScript-p5.js

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… Read More
The accelerationY system variable is responsible for the acceleration of the device(tablets or mobile phones) along the y-axis. It can be used with the draw() function… Read More
The accelerationZ system variable is responsible for the acceleration of the device(tablets or mobile phones) along the Z-axis. It can be used in the draw()… Read More
The accelerationX system variable is responsible for the acceleration of the device(tablets or mobile phones) along the x-axis. It can be used with the draw()… Read More
The deviceOrientation variable contains the orientation of the device. The value of this variable in the code will either be set landscape or portrait. It… Read More
The system variable rotationZ in p5.js is responsible for the rotation of mobile devices (smartphones and tablets) always along the z-axis. It can be used… Read More
The system variable rotationY in p5.js is responsible for the rotation of mobile devices (smartphones and tablets) always along the y-axis. It can be used… Read More
The system variable rotationX in p5.js is responsible for the rotation of mobile devices (smartphones and tablets) always along the x-axis. It can be used… Read More
In this article, we will see how to draw 3D geometry (containing length, width, and height) in p5.js. The default rendering in p5.js is used… Read More
The function createShader()  which loads the shaders from strings. it is call  within the function  setup. The easiest way to write shaders as strings in… Read More
The function setMoveThreshold() is used to set the movement threshold for the deviceMoved() function. The default threshold is set to 0.5. Syntax: setMoveThreshold(value) Parameter: This… Read More
The function deviceTurned() s called when the device rotates by more than 90 degrees continuously. The axis that triggers the device turned() method is stored… Read More
The function loadShader() loads the shader from files and returns them as a p5 shader object in a variable. The file extension can be .glsl… Read More
The function deviceShaken() function is called when the device total acceleration changes  accelerationX and accelerationY values is more than the threshold value. The default threshold… Read More
The resetMatrix() function is used to replace the current matrix with the identity matrix (The square matrix whose all values are zero except diagonal which… Read More