I am looking to add inset shadow to my object using three.js, creating a unique effect similar to this image:
https://i.sstatic.net/L8Ori.png
Imagine something like a ring with engraved text.
I am looking to add inset shadow to my object using three.js, creating a unique effect similar to this image:
https://i.sstatic.net/L8Ori.png
Imagine something like a ring with engraved text.
To simplify the process, consider utilizing a normal-map for engraving instead of creating dynamic text. You can easily export a normal-map from Blender as outlined here. If dynamic text is required, generating a normal-map dynamically on a canvas might be more efficient than constructing geometry for the engraving.
Alternatively, you could create a 3D geometry with the engraving embedded. Explore the ThreeCSG library, which allows manipulation of geometries using boolean operations. By incorporating this method, you can form a 3D-text mesh, adapt it to fit the ring's curvature, and then subtract it from the ring mesh to achieve the desired engraved effect.
In my experimentation, I simulated a similar process by combining ThreeCSG to remove text geometry from a cylinder shape. The potential of this approach is showcased here: (view source here).
const textBSP = new ThreeBSP(textGeometry);
const cylinderBSP = new ThreeBSP(cylinderGeometry);
const resultGeometry = cylinderBSP.subtract(textBSP).toGeometry();
scene.add(new THREE.Mesh(resultGeometry, new THREE.MeshStandardMaterial());
While this method proved effective, there were some challenges encountered, particularly with the slow tessellation caused by threeCSG. Further refinement is needed to address issues with computed normals.
A third option involves utilizing both displacement and normal-maps for quicker processing. This technique requires adding numerous vertices to facilitate displacement effects. Refer to a helpful code snippet by mrdoob for assistance in creating a normal-map based on displacement:
I have a script with two functions. One function generates a lengthy HTML string, and the other function processes this string as a parameter. function myFirstFunction() { // Generate HTML content return myHTML; } var myHTML = myFirstFunction(); ...
Currently, I am delving into the world of Node.js and encountering a bit of a roadblock. My focus is on passing a query to Mustache. Index.js // Incorporate Express Framework var express = require('express'); // Integrate Mustache Template En ...
When dealing with floating point arithmetic in Javascript, it's common to see results like 0.2 + 0.1 = 0.30000000000000004, which can be confusing. However, a simple workaround is to multiply the numbers by 10, perform the operation, and then divide b ...
Utilizing jQuery to create a table based on the output of JSON. The JSON values are retrieved from a SoapClient, which is functioning correctly and producing the desired output. https://i.sstatic.net/vJbfW.png Now, the goal is to assign the value of the ...
In my current project, I have a scenario where I've imported a model of a spaceship that moves solely in the z-direction. Using the 'WASD' keys, I can control its movements within the scene. The camera is positioned directly behind the space ...
I've put together a list of Game of Thrones characters who might meet their demise (no spoilers included). However, I'm struggling with removing a CSS class as part of my task. Simply deleting the CSS is not the solution I am looking for. I' ...
Let's imagine we have an array of objects like this: const chefs = [ { key: 1, images: ['http://lorempixel.com/400/400/sports/', 'http://lorempixel.com/400/400/abstract/', 'http://lorempixel.com/400/400/animals/&apo ...
I am attempting to create a shape using threeJS that consists of both straight and curved edges. Here is what I currently have: https://i.sstatic.net/9pK3g.jpg My goal is to connect the two top corners with a semicircle in order to achieve a square shape ...
When working with Vue components, I receive dynamic messages from the server: module.exports = { data() { return: { windowText: '' } }, methods: { showCancelEntrieWindow(){ this.$http.post('/page', {'number& ...
Currently, I'm in the process of integrating Sanity into my blog. Using the json object returned from a query with useState, I managed to display my posts successfully. However, I am now faced with the challenge of populating a React-Modal with the ap ...
As I continue to learn JavaScript, please bear with me as I navigate through my current level of understanding. I am working on a gallery that opens a modal when an image is clicked. I have successfully gathered all the image sources into an array and used ...
After creating a comment, I can only see it when rendering the same page again. However, if I navigate to posts or myposts page and then return to the post where I created the comment, it disappears. Can someone please help me understand why this is happen ...
As a beginner in three.js and JavaScript, I am excited about the possibilities and have been creating small Three.js scenes to improve my skills. My ultimate goal is to build a 3D website, but I am currently stuck on how to allow users to upload an image f ...
A new configuration tool is under development using Angular.JS. The user interface consists of two main sections: a left panel with a tree view listing all the configuration items and a right panel displaying screens for editing these items. There are appr ...
I'm trying to figure out how to validate an input field only when it is of type number and has the validate attribute set to checkit. I'm not sure what to use in place of the asterisks to bind this to the keypress event $('*** input[type=num ...
I have a straightforward Vue component that is causing me some trouble. <template> <div class="field has-addons"> <div class="control is-expanded"> <div class="select is-fullwidth"> <select v-mode ...
As I work on integrating a 3rd party API into my website, I am currently in the testing phase using Postman (the Chrome Extension) before proceeding to write my AngularJS Service with $http. However, there is one aspect of the process that has me puzzled. ...
I have a React/Next component that retrieves data from firebase storage based on the route. For example, if the route is http://localhost:3000/training/javascript, the component will fetch data from the /training/javascript route in firebase storage. // Re ...
Having an issue with the navbar functionality on my website. It is working properly in Firefox, but not in Chrome and Safari. When scrolling back up to the very top of the page, the navbar hides due to a minor bounce effect which triggers the hide action. ...
I am currently using NestJS 6 and TypeORM to interact with a MySQL database. While attempting to write unit tests for a method that utilizes the @Transaction() and @TransactionManager() decorators, I encountered the following error message: ConnectionNotF ...