Exploring Point Clouds with Three.js

My Three.js point creations are appearing as squares instead of rounds. I've come across blending factors in the documentation, but I'm unsure how to apply them to my points or if it's the correct method for achieving rounded points.

Answer №1

An interesting technique I discovered involves creating an SVG circle element, rendering it to a canvas using canvg, and then rendering that canvas to a texture for use in a point cloud.

By adding gradients to the circle, I can create the appearance of shininess on a 3D sphere using a simple 2D circle.

If you're interested, I have a project on Github that showcases this concept. You can check it out here: https://github.com/alexpreynolds/cubemaker, along with a demo at:

If you prefer just plain circles without the shiny effect, you can simply remove the gradients or draw directly onto a canvas element without using SVG at all.

Answer №2

It has been noted that Alex Reynolds provided a correct answer regarding customization of points in Three.js. I aim to further enhance this by elaborating on the two main methods to achieve this.

  • According to the documentation, one way to customize points is through textures (

    THREE.PointsMaterial({map:texture})
    ):

    • A common approach is to utilize your own image as a texture:

      var texture=THREE.ImageUtils.loadTexture('url-to-my-image');
      
    • Alternatively, you can create something in a canvas and employ it as a texture. This encompasses direct drawing on the canvas, SVG importation as proposed by Alex Reynolds, or any other appropriate technique. By exploring his suggestions and examining three.js examples, you can discover various ways to render 2D text on sprites.

      var texture=THREE.Texture(canvas);
      

    For additional insights on utilizing textures with Points, refer to the plethora of examples available in three.js.

  • Another method involves using shaders:

    For those familiar with shaders, creating a concise fragment shader can yield the most refined and precise results for customizing points.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Exporting data from a table with an identifier

Is there a way to export the HTML table data so that it retains its original format? The data[] array serves as the source for the table displayed below. By clicking on the dataToArray button, you can export this HTML table data back into an array. Howeve ...

Tips for incorporating a personalized block in tinyMce

I successfully implemented a custom formatting block for TinyMCE by using the following code: style_formats: [ {title : 'Code', block : 'pre', classes : 'pre-code', exact: true},] Here is the link to my CodePen example: http ...

The AJAX load event listener triggers prior to receiving a response from the server

When working on a script to upload images via AJAX, the process is as follows: a user selects an image using a form file input field. The form contains an onsubmit function that prevents the page from reloading after submission. Within this function, data ...

The frequency of database updates exceeds expectations - involving vue.js this.$router.push and express operations

Having some trouble updating a MongoDB with this code. It seems to be updating three times instead of just once due to having three dates in the posts.date field. Utilizing Vue, Mongo, and Express for this project, I have the following data structure: { ...

Is it possible to implement CSS code from a server request into a React application?

With a single React app that hosts numerous customer websites which can be customized in various ways, I want to enable users to apply their own CSS code to their respective sites. Since users typically don't switch directly between websites, applying ...

Using Angularjs and PHP: incorporating URL parameters into the $http.get() function

I am currently working on a web project in Eclipse with three main files: "controller.js", "home.html," and "array.php". The goal is for the .php file to echo a PHP array encoded in a JSON string: <?php $arr = array(array(title => "hello", auth ...

"Ensure that the jspdf header is configured to display on every page

Currently, I am integrating jspdf code with a jQuery script and the jspdf.debug.js file. My HTML table (angular ng-repeat) is very large and spans multiple pages. While jspdf does a great job repeating the header of the table nicely, I have some invoice in ...

CSS navbar with a unique design: Issue with List Hover not Persisting

I'm facing a common issue with a pure CSS navbar. I have constructed a navbar using ul and li elements, but I am unable to make the menus stay visible when I hover over them. The problem lies in the fact that the menu opens only when I hover over the ...

Creating Comet applications without the need for IFrames

Currently embarking on my journey to develop an AJAX application with server side push. My choice of tools includes Grizzly Comet on Glassfish V2. While exploring sample applications, I've noticed that most utilize IFrames for content updates on the c ...

I need help using i18N to translate the SELECT option in my VUE3 project. Can someone guide me

<n-select v-model:value="value" :options="options" /> options: [ { label: "Every Person", value: 'file', }, { label: 'Drive My Vehicle', ...

Navigate to the next page in Angular ui-grid when the down key is pressed on the last row of the grid

Is there a way to navigate to the next page if the down key is pressed in the last row of the grid? const gridScope = angular.element(document.getElementById("MainWrap")).scope(); gridScope.gridApi.pagination.nextPage(); What is the best method to detect ...

Determine if a link can be activated or disabled

Controlling the clickability of a link and displaying an error based on the result of an ajax call is my current objective. <a class="lnkCustomer" href="http://localhost/viewcustomer" target="_blank" data-customerno="2 ...

Issue with localStorage failing to save comments added at the beginning

Here is a link to the fiddle I am working on. My goal is to store prepended comments in a ul by saving the ul as a variable, and use localStorage to save it in the browser. The HTML structure of the project: <h1>Commentia!!!</h1> <textarea ...

What could be causing the loading issues with my three.js examples?

After downloading Mr. Doob's three.js project, I noticed that the examples in the folder work fine if they don't involve a model or texture. However, the ones with models or textures appear blank for some reason. This issue perplexes me as I am a ...

Encountering an issue during the user login or registration process

Issue: I've been facing a challenge with storing user signup and login information in my database and redirecting the user to another page using the useNavigate Hook. Every time I try clicking on the signup or login button on the frontend, it fails an ...

Customize your validation with jQuery Validate using .addMethod for attribute-specific validation purposes

I'm having trouble implementing data attribute-based validation in my project. Specifically, when I include my custom numeric method, it doesn't seem to be functioning as expected. $.validator.addMethod('[data-v-numeric="numeric"]' ...

What could be the reason why my focus and blur event listener is not being activated?

It seems like everything is in order here, but for some reason, the event just won't fire... const element = (this.agGridElm.nativeElement as HTMLElement); element.addEventListener('focus', (focusEvent: FocusEvent) => { element.classLi ...

Prevent the user from accessing their account if the reCaptcha has not been completed

I am facing an issue with disabling a button in a login template using c# code-behind. I have attempted to do it through a JavaScript method on the front-end, but so far, I have been unsuccessful. You can check out the details here! This is what I have tr ...

Header Stability TransitionAndView

I'm not very experienced with JavaScript, so please bear with me. I'm attempting to create a fixed header that transitions to 50% opacity when scrolled down and returns to full opacity (opacity: 1.0) when scrolled back to the top. Here is my cur ...

Why aren't my laptop media query CSS styles being applied?

My laptop size media query is not applying the CSS styles I want. I have tried using both min and max width but without success. I am trying to replicate the layout found here: @media screen and (min-width: 960px) and (max-width:1199px){ .grid-co ...