Each light casting shadows will render the scene in a specific way and output that we call “shadow map”. This shadow map is then used to know if a surface is in the shade or not. By default, that shadow map resolution is rather low in order to maintain solid performance. Fortunately, we can change… Continue reading Configuring the shadows
Tag: javascript code
Javascript function to flatten nested arrays into a single array
Use Array.prototype.flat() to flatten nested arrays into a single array JavaScript sample const nestedArray = [1, [2, [3, 4]]]; const flatArray = nestedArray.flat(2); console.log(flatArray); // Output: [1, 2, 3, 4]
Function to convert a string to camel case
/** * This function is used to convert a string to camel case. * @param {string} str – The string to be converted to camel case. * @returns {string} The camel case version of the input string. */ const toCamelCase = (str) =>… Continue reading Function to convert a string to camel case
Code for generating Unique ID Using timestamp
We can generate unique IDs using the following Java script code. We can use this code for requirement which needs a unique value to be generated every time or when a conditions satifies. And there are Random ID generating code are available but here we are using current date and time values to generate unique… Continue reading Code for generating Unique ID Using timestamp