Let’s say you want to draw a line or a circle, not a wireframe Mesh. First we need to set up the renderer, scene and camera (see the Creating a scene page). Here is the code that we will use: const renderer = new THREE.WebGLRenderer(); renderer.setSize( window.innerWidth, window.innerHeight ); document.body.appendChild( renderer.domElement ); const camera = new… Continue reading Drawing Lines
Month: May 2025
Real-Time Shadows in Complex Scenes: Balancing Quality and Performance in Three.js
Overview Shadows enhance realism but are also one of the most expensive rendering features in 3D. In Three.js, real-time shadows are usually created using shadow maps, but their quality depends on many factors like resolution, bias, and camera settings. Common Shadow Types in Three.js BasicShadowMap: Fast, low-quality PCFSoftShadowMap: Smooth edges, balanced quality VSMShadowMap: For soft,… Continue reading Real-Time Shadows in Complex Scenes: Balancing Quality and Performance in Three.js
Using GPUComputationRenderer for Real-Time Fluid and Particle Simulations in Three.js
Overview The GPUComputationRenderer utility in Three.js allows you to offload heavy calculations—like physics, fluid dynamics, or particle systems—onto the GPU using fragment shaders. This enables real-time, high-performance simulations that would otherwise be too expensive on the CPU. What is GPUComputationRenderer? It’s a helper class in Three.js that turns fragment shaders into GPU-based computation kernels. Instead… Continue reading Using GPUComputationRenderer for Real-Time Fluid and Particle Simulations in Three.js
Understanding Everything About Fill Rate in NetSuite
Fill rate is a supply chain performance metric that measures the percentage of customer orders fulfilled from available stock without backordering or delays. Formula: Fill Rate (%) = (Number of Orders Fulfilled from Inventory / Total Number of Orders) × 100 Fill rate can be analyzed across different dimensions: Order Fill Rate (complete orders) Line… Continue reading Understanding Everything About Fill Rate in NetSuite
How does Firebase handle offline capabilities?
Example: Firebase provides offline capabilities through its Realtime Database and Firestore. These features allow applications to remain responsive even when network connectivity is lost. Firebase caches a copy of the cloud data onto the device, enabling read and write operations to be performed locally. Once the connection is reestablished, changes are synchronized with the server.… Continue reading How does Firebase handle offline capabilities?
What are the security rules in Firebase? How would you set them to prevent unauthorized access?
Firebase security rules are server-side configurations that control read and write operations to your database. They use a custom, JSON-like language and can be set in the Firebase console or by deploying from local files using Firebase CLI. To prevent unauthorized access, you would structure your rules based on user authentication status and data paths.… Continue reading What are the security rules in Firebase? How would you set them to prevent unauthorized access?
How would you implement User Authentication using Firebase in a Single Page Application?
Firebase Authentication provides backend services to authenticate users in Single Page Applications (SPA). To implement, initialize Firebase SDK in your SPA. Use the ‘firebase.auth()’ function for authentication. For sign-up, use ‘createUserWithEmailAndPassword(email, password)’ method. It creates a new user account using an email and password and returns user data. To log-in existing users, use ‘signInWithEmailAndPassword(email, password)’.… Continue reading How would you implement User Authentication using Firebase in a Single Page Application?
Code snippet to demonstrate how to read and write data in Firebase Realtime Database?
Firebase Realtime Database is a NoSQL cloud database that allows you to store and sync data between your users in real-time. Here’s an example of how to read and write data using JavaScript: To write data: var database = firebase.database();function writeUserData(userId, name, email) { firebase.database().ref(‘users/’ + userId).set({username: name,email: email });} In this code snippet, we’re… Continue reading Code snippet to demonstrate how to read and write data in Firebase Realtime Database?
Vue 3 and TypeScript: Advanced Patterns
Integrating TypeScript with Vue 3 can greatly improve the maintainability and robustness of your applications. Using advanced patterns like type-safe components and generics can make your code more predictable and error-resistant. Setting Up Type-Safe Components To make your Vue components type-safe, define the props with TypeScript interfaces. Example: <script lang=”ts” setup> import { defineProps }… Continue reading Vue 3 and TypeScript: Advanced Patterns
Rule 86B of the Central Goods and Services Tax (CGST)
Rule 86B of the Central Goods and Services Tax (CGST) Rules, effective from January 1, 2021, imposes a restriction on the utilization of Input Tax Credit (ITC) for certain taxpayers. Applicability of Rule 86B This rule applies to registered persons whose taxable supplies (excluding exempt and zero-rated supplies) exceed ₹50 lakh in a month. Under… Continue reading Rule 86B of the Central Goods and Services Tax (CGST)