So im 100% brandnew to this. I just discovered it about two days ago. The whole reason i was looking into babylonjs is to make a app for a website that can change the dimensions of a 3d object via text inputs.
So let me get to the point. If i make an obj of lets say a cube ( it doesnt really matter what it is…just for an example) and import it into babylonjs …and i know when i made it in the other program it was 1x1x1 inches…how do i get babylonjs to “refence” that and change its units to what im considering to be one inch.
Like i said im brand new to all of this even coding. I’m a machinist that uses fusion 360 on a daily basis but this is a new realm for me.
Every 3D rendering app has internal units that dont pertain to any world measuring units , they are just numbers. Then some of those apps do have options to choose to use real world measuring units but again this is just a representation. For example you can still dictate to the app at what ratio the internal units are applied to the used world measuring units. Simple case is it is just 1:1. But it is possible to use any ratio.
Some apps will specify what they consider their internal unit to convert to when using 1:1. So they might consider 1 unit internally to be 1 meter ( seems to be a common one )
Anyway im not sure how this is applied to interchange formats ( when exporting a model ) using FBX or OBJ or GLTF/GLB. Most exporters have options about how to scale the output. I think some formats do have a internal variable to try read and use in this regard.
When using a real time rendering engine like babylon , what stops you from just labeling your units to anything you like. I mean Its just relative right? Or is there something else that concerns you?
But I know the question then is what is the actual scale of the scene , for example if you loaded several models from different sources.
Here you will find there is no consistency that i know of. You can export a model , import it into another app and export it from that app , then when importing back into the original you find the scale is not the same. ( There might be some consistency in some interchange formats but as mentioned this is also dependent on how the person exported the model )
Most importers have a field where you can choose to apply a normalized scalar value to the imported model if you like. Any model loaded into babylon can be scaled once loaded.
Okay whoa. So are you saying that in the playground for example a unit is just that? a unit?
so if i had a slider bar that i could scrub back and forth to change the length of a cube …say it was the 1x1x1 and wanted it make it 6x1x1 …i would just have to label it as inches on say the UI? assuming its a 1:1 ratio
Oh- So here’s a part I designed in a playground, exported, and 3d printed yesterday so I would not have to do it in Fusion. Concept to finished part took about 2.5 hours. It’s a snap apart guide for making a wiring harness.
Yeah! yeah. this is very much along the lines of what i was looking for. I’m going to fiddle around with this tonight after work. thanks guys for the feedback so far. I may revisit this with more questions later. So i wont be marking it as a solution just yet. Very exciting stuff.
So I’ve opened a can of worms with this. becuase i dont know coding yet. i’ve been trying to learn over the past week. I can 3d model all day long but coding is hurting my brain. Here is a perfect example of what im trying to make… a 3d viewer with the ability to manipulate its shape. here But like i said I’m completely new to this. So i guess what im asking…is something like this possible and babylon? Where should i start?