Hi,
I am trying to create a simple (or not) configurator using three.js. I managed to import .obj model with OBJLoader2 and MTLLoader and it works but now I would like to add some interactive actions like width or height change.
My source object looks like this:
and my three.js example looks like this
I already know how to change textures on click but I can’t find any tutorial about dimensions/size. I will also need to replicate some elements based on width value so maybe I should import each part of the object separately or maybe there is another way to handle such a case?
Any help will be appreciated
You can, once you load the obj you would have to get the elements that you want o modify within the main obj object by their names,
for example,
new OBJLoader().load("path", function(obj){
obj.getObjectByName("roof").scale.set(10, 10, 10)
})
@Hoodgail_Benjamin Thank you. It works but I have another probably stupid question.
When I set scale top part of the element looks different. I know that scale changed but I am trying to extend only ‘middle’ part of my element.
Should I prepare two separate elements and set scale only for the second part?. If yes then how to glue two elements togother?
Here is my test project.
.