Exploring the 3 dimensions in Three.js through manipulation of a JSON object imported from Blender

Is it possible for users to manually manipulate a 3D object on my website that was created in Blender and exported in JSON format using this exporter? I want them to be able to adjust the Length, Width, and Height of the object. For instance, I have this basic cube in JSON format:

{
"metadata": {
    "generator": "io_three",
    "type": "Geometry",
    "vertices": 8,
    "faces": 6,
    "uvs": 0,
    "normals": 8,
    "version": 3
},
"uvs": [],
"name": "CubeGeometry",
"faces": [33,0,1,2,3,0,1,2,3,33,4,7,6,5,4,5,6,7,33,0,4,5,1,0,4,7,1,33,1,5,6,2,1,7,6,2,33,2,6,7,3,2,6,5,3,33,4,0,3,7,4,0,3,5],
"normals": [0.577349,-0.577349,-0.577349,0.577349,-0.577349,0.577349,-0.577349,-0.577349,0.577349,-0.577349,-0.577349,-0.577349,0.577349,0.577349,-0.577349,-0.577349,0.577349,-0.577349,-0.577349,0.577349,0.577349,0.577349,0.577349,0.577349],
"vertices": [1,-1,-1,1,-1,1,-1,-1,1,-1,-1,-1,1,1,-1,0.999999,1,1,-1,1,1,-1,1,-1]

}

I am looking for a way for users to input numeric values in a form to change the dimensions of the object, rather than using drag with the mouse.

Thank you!

Answer №1

After some searching, I discovered the answer. In case anyone is curious, here is the solution:

let model = new THREE.Object3D();
model.add(object);
model.scale.set(x, y, z);

Just make sure to replace 'object' with your actual object!

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

Can Redux enable real-time data synchronization across various devices?

In an office setting, there are two computer systems running a shared web application. One system is assigned to the employee while the other is for the admin. When the employee logs in, they see their schedule on their dashboard. Conversely, when the admi ...

Produce a dynamic floating bar graph based on date using Chart.js library in Node.js environment

Attempting to articulate my issue clearly without being overly verbose, I recently discovered the Chart.js library which perfectly suits my needs. However, as I am working with Node.js and require a png image of the graph, I am utilizing the chartjs-node-c ...

How can you determine whether the CSS of a <div> is defined in a class or an id using JavaScript/jQuery?

Hey there, I'm currently working on dynamically changing the CSS of a website. Let's say we have a div like this: <div id="fooid" class="fooclass" ></div> The div has a class "fooclass" and an ID "fooid", and we're getting its ...

Using nextjs9 to render .svg files within an img tag

Currently working on upgrading a Migration project from Nextjs7 to Nextjs9, and encountering difficulties when trying to include .svg files in the image tag. If you'd like to see a DEMO of this issue, please visit: https://codesandbox.io/s/nextjs-mh9 ...

I am having trouble displaying images with Material UI CardMedia

I'm currently using CardMedia to display images on my webpage, but unfortunately, the image is not appearing as expected. After researching a similar issue on Stack Overflow, I discovered that the suggested solution involved importing the image and t ...

Validation of phone numbers based on country codes

How can I validate phone numbers based on the selected country in Angular? Are there any Angular packages specifically for this task? I've attempted to use regex, but it only works for certain countries. I need a solution that can validate mobile an ...

Node.js SSH2-SFTP-Client Receiving Data Request

I am currently trying to retrieve a file from an FTP server using ssh2-sftp-client. The issue arises when I attempt to download the files, even though I can view the list of files successfully with the code provided below. Looking at my code snippet, you ...

Update a MongoDB collection with data retrieved from a JavaScript object mapping

I have come across a collection that has the following structure: [ { "project":"example1", "stores":[ { "id":"10" "name":"aa", ...

I'm having trouble understanding why I keep encountering this error message: "SyntaxError: Unexpected token T in JSON at position 0 at JSON.parse (<anonymous>) at XMLHtt…"

I am in the process of implementing a download button feature that will allow users to download a document from my node.js server. Check out this stylish button: https://i.stack.imgur.com/s4CjS.png For the front-end, I am utilizing Angular as the fram ...

A guide on effectively utilizing ref forwarding in compound component typing

I am currently working on customizing the tab components in Chakra-ui. As per their documentation, it needs to be enclosed within React.forwardRef because they utilize cloneElement to internally pass state. However, TypeScript is throwing an error: [tsserv ...

What is the process of displaying a view using jQuery in an MVC framework?

When I create an area, I use jQuery to call the action to create and save data to the database, and then return JSON. Now, once it is saved, I want it to be rendered in my index view. How can I achieve that with my current code? Is it possible? [HttpPo ...

`Generating dynamic content based on ajax response``

Hey there! I've got a little challenge on my hands. I've set up 3 input boxes that act as table cells (the header). When the input in one of these boxes changes, a script runs. This script triggers a function that pulls data from my database thro ...

Load distinctive javascript files that cater to the needs of the Code Igniter view

Struggling to come up with the most efficient way to load different javascript files in my CodeIgniter project. The issue at hand is that I have numerous CodeIgniter views, each needing specific javascript resources to function properly. How can I simpli ...

What is the most effective way to iterate through an array of objects and retrieve the results in a key-value format?

I am dealing with an array of objects that may seem a bit complex initially, but I will simplify it as much as possible. Each object in the array has properties like Engineering, Environment, and others, each containing a sub-object called radars. The rada ...

Generate a tag in Ionic when the user hits the go/enter key on the keyboard

I have developed a mobile app that allows users to search for specific items. Currently, when the user presses Space, it creates a tag. However, I want the tag to be created when the user presses go/search/enter on the mobile keyboard instead of spacebar. ...

pair each instance of a string

Currently, I am developing a todo list application that allows users to add to-do list items and search for specific tasks. My focus at the moment is on refining the search function. Presently, whenever a user searches for a name, only the first task ass ...

Redirect link depending on JSON callback information

I experimented with utilizing JavaScript to automatically redirect website visitors based on their country. The code snippet below demonstrates how the visitor's IP is checked to determine their country, such as CN for China, and then redirects them ...

Difficulty in processing Json output in Ruby

@response = Typhoeus::Request.get(LOCATION_API_SERVER_ADDRESS+'search?ll=' + current_user.altitude.to_s + "&query="+ params[:query] + LOCATION_API_ACCESS_CODE) @venues = ActiveSupport::JSON.decode(@response.body) @venues['response& ...

Form appears outside the modal window

I am facing an issue with my modal where the form inside is displaying outside of the modal itself. Despite trying to adjust the CSS display settings and switching to react-bootstrap from regular bootstrap, the problem persists. I am uncertain about what s ...

Managing global errors and intercepting requests in AngularJS can be easily achieved by utilizing $resource interceptors and global handlers for

My question pertains to the interceptor(responseError) of $resource. It is essential to note that I am working with angularjs version V1.3.6. The Issue: app.factory('authInterceptor',['$q', '$location', '$log', fun ...