Skip to content

Tag Archives: JavaScript-p5.js

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
The function requestPointerLock() is used to  locks the pointer to its current position and  then makes it invisible. All browser does not support this method.… Read More
The function exitPointerLock() quit the previously used Pointer Lock for example if the pointer is locked then it unlock it and vice-versa. It is used… Read More
 The function deviceMoved() works in the device, and it is called when the device is moved by more than the threshold value along all the… Read More
The applyMatrix() function in p5.js is used to multiply the matrix given as the parameters with the current matrix. This is can be used to… Read More
The shader() function in p5.js makes it possible to use a custom shader to fill in shapes in the WEBGL mode. A custom shader could… Read More
In this article, we will learn how to apply different types of material in WebGL. Light reflects off objects differently depending on their angle of… Read More
In this article, we will learn how to apply different types of lights in p5.js. Lighting is a simple but powerful way to provide depth… Read More
The exp() function returns the value of n (any number) to the Euler’s number e(2.71828…) raised to the power n (e^n). Syntax: exp(n) Parameters: This… Read More

Start Your Coding Journey Now!