Subtracting points in a three-dimensional JSON file using three.js

I have a file in three.js json format that contains a model exported from Blender using BufferGeometry, along with its corresponding texture file.

The model has some unwanted noise on it that I am aiming to clean up by manipulating the json file itself after export (I need to eliminate certain vertices without performing a smoothing or decimation operation, making it more practical to work with the json data directly).

Therefore, I have a few questions regarding data manipulation within the file:

  1. Aside from removing point data, what other adjustments should I make to the file? Should I also eliminate corresponding UV's and normals, along with adjusting indexes?
  2. Instead of completely removing points from the list, could they be marked as null to maintain index mapping even if the data is absent?
  3. If removing data consistently from each array in the json file is not viable, is there a way to recalculate the indices without reverting to Blender or a similar platform? Is reconfiguring the entire index array necessary, or can it possibly be removed altogether?

It is worth noting that the point removal process is currently executed server-side (using Python), but there is potential for it to be handled in the browser if that proves to be a more efficient approach. Additionally, the model contains a significant number of vertices, totaling around 250k.

Answer №1

Your approach to removing vertices on the server seems to be the most appropriate method, especially if it includes re-indexing.

  1. Removing the vertices along with their associated attributes such as normals and UVs is crucial. Updating the indexing, especially for shared vertices among multiple triangles, can be a complex task. Handling this in the browser might pose significant challenges.
  2. Populating the vertex list with values is essential. If you wish to preserve some vertices, adjusting the indexing to exclude unwanted vertices is an option, although it may not be a simple task.
  3. There are three draw modes to consider: THREE.TrianglesDrawMode, THREE.TriangleStripDrawMode, and THREE.TriangleFanDrawMode. Indexing is necessary for shared vertices in THREE.TrianglesDrawMode. Removing indexing would require defining each triangle with duplicate vertices data. Setting up the geometry for THREE.TriangleStripDrawMode and THREE.TriangleFanDrawMode involves critical arrangement of shared vertices in the buffer, making it as challenging as repositioning the indices.

Instead of removing noisy vertices, have you considered adjusting them? This approach is simpler, involves easier mathematics, and eliminates the need for re-indexing.

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

Discovering the significance of a function's scope

I'm a bit confused about how the answer is coming out to be 15 in this scenario. I do understand that the function scope of doSomething involves calling doSomethingElse, but my calculation isn't leading me to the same result as 15. function doSo ...

Ajax dropdown menu displaying 'Loading Data' message during processing

Is it possible to display a Please wait.. or Loading... label underneath my Combo box while data is loading? I would like to show a Loading... message under the switch box when switching between Male and Female. https://i.sstatic.net/zpFDF.jpg This is th ...

Tips on incorporating the Browserified npm package into an Angular controller

After spending countless hours searching for a solution to integrate Browserify with my project, I found myself struggling to find a tutorial or example that addressed my specific issue. Most resources focused on bundling code rather than demonstrating how ...

dynamic jquery checkbox limit

I am working with the following HTML code: <input type="checkbox" id="perlengkapans" data-stok="[1]" onchange="ambil($(this))"> name item 1 <input type="checkbox" id="perlengkapans" data-stok="[4]" onchange="ambil($(this))"> name item 2 &l ...

The column must have a defined value and cannot be left empty

I encountered an issue while trying to populate a database with seed data. The error message I received is: name: 'SequelizeDatabaseError', parent: Error: Column 'id' cannot be null code: 'ER_BAD_NULL_ERROR', errno: 1048, sql ...

Tips for filtering queries based on the maximum size of an attribute within a JSON object array

I am struggling to create a query that selects the JSON object with the highest float attribute in an array, based on a 'date' field. The challenge lies in pulling the correct array index along with its associated data. Despite attempting a CROS ...

Updating Variable Values in PHP

Currently, I am working on a project about online shopping using PHP. However, I have encountered an issue regarding changing the currency value. I need to convert the currency to another based on the exchange rate provided. <select onchange=""> ...

Numerous buttons activating a single modal component

I have an array called videos, which contains objects of the type Video (defined below). My goal is to create a functionality where clicking on a specific video button opens a modal containing information about that particular video. interface VideosInfo ...

Transform the Material UI grid orientation to horizontal row for content display

I'm just starting out with material UI and I've put together a grid that includes two components - an autocomplete and a button. Right now, they're stacked on top of each other, but I want to align them side by side in a row. Here's the ...

Adjust the input and transition the UI slider

Currently, I am facing an issue with two sliders and inputs. When the number in the top slider is changed, the number and slide in the bottom block do not update accordingly. What steps should I take to address this? $(document).ready(function() { var $ ...

Tips for retrieving the text value on keyboard enter press without triggering form submission

I am currently working on a feature where hitting the Enter key in a textbox should not automatically submit the form. The textbox is located within a form: @Html.TextBoxFor(model => model.ID, new { @class = "form-control input-sm", placehold ...

Transferring an object from one inventory to another

I'm in the process of developing a task manager that enables users to add and remove tasks. I am also working on enabling the ability for users to transfer tasks from one list to another. The current code I have written doesn't seem to be functio ...

Searching through multiple sub-documents using MongoDB filters

I have a specific dataset stored in mongo DB that contains information on fruits and cars, with an indication of their active status. My goal is to filter this data to display only the active subdocuments, which include active cars and active fruits. ...

Python accessing data with a JSON object path

I'm struggling with a nested json structure and trying to work with objectpath, the python API version. However, I am having trouble selecting and filtering specific information, especially when it comes to nested data within the structure. For examp ...

Looping through a single object with an Ajax call

When I make this ajax call, it only displays the last object from the JSON file instead of all objects. Can someone help me understand why? Ajax Call var ajax = new XMLHttpRequest(); var data = 'data.json'; var url = 'http://localhost: ...

Managing the AJAX response from a remote CGI script

I'm currently working on a project that involves handling the response of a CGI script located on a remote machine within a PHP generated HTML page on an apache server. The challenge I am facing relates to user authentication and account creation for ...

Activate and deactivate animation using one button with jQuery

Looking for a solution using Jquery. Can you animate an element when clicking a button and then stop the animation with the same button? Here is an example code snippet in JavaScript: $('<div>').css({ 'width':'200 ...

Leveraging Greasemonkey along with jQuery to capture and manipulate JSON/AJAX data on a webpage

In my previous inquiry on Stack Overflow, I received some insight into my issue regarding Greasemonkey interpreting jQuery. However, the challenge remains in directing GM to retrieve data from a specific location and place it into an array. When visiting ...

Is there a way to access Xively data without needing to authenticate?

I'm attempting to retrieve information from xively.com to my Android device. The issue I'm experiencing is that I must verify my identity before being able to view the data. However, based on the documentation available here, if the data is publi ...

Collaborative session sharing between two node applications through Single Sign-On (SSO

I currently have a website created with express and node.js. I need to add a nodebb forum to this website, which is a separate node application. Both the main site and the forum use Facebook login, but users have to log in separately using the same Faceboo ...