Firs of all, sorry if here isn’t the right place to as that kind of question
I’ve been studding babylon for a month I believe and I have some core doubts that I still don’t get until now, here they are:
FaceUV numbers
How does exactly FaceUV indexes and parameters work? I’ve testing and using them but I don’t get what the values mean relatively to the image. The numbers I’m talking about are these:
faceUV[0] = new BABYLON.Vector4(0.5, 0.0, 0.75, 1.0);
faceUV[1] = new BABYLON.Vector4(0.0, 0.0, 0.25, 1.0);
faceUV[2] = new BABYLON.Vector4(0.25, 0, 0.5, 1.0);
faceUV[3] = new BABYLON.Vector4(0.75, 0, 1.0, 1.0);
I try to treat these numbers like 0.5
as 50% of the image, 1
as 100% of the image, but I don’t know if this is right or make any sense, I believe I’m wrong actually, so what exactly mean these numbers?
Clone vs instance
Is there any performance/memory issue if I instantiate many objects instead of clone them? Supposing I have a mesh for a house, but instead of clone a base house I instantiate many of them, is this bad or don’t have difference?
I’m asking this cause I’m using a for loop to create mashes based on data of each index of the array, but I don’t use clone, I use CreateBox
instead of clone a base box.
Space units
I get that if I create a cube without specify the size it will have a size of 1x1x1, but what this “1” is exactly? It make sense to attach an unit for it? Like we do with px
, em
, cm
.
I’m asking this cause I don’t know what is “too big” or “too small” 1 is small? It is big?
Does this question make any sense?
External libraries
I just realize that Babylon use some external libs such as CannonJS, but why this isn’t a dependency of the babylonjs itself? I mean, as many people I fall on the “Cannon is not defined” issue what leads me to think why this isn’t added as a dependency, I want to know this just for curiosity.
Still with the libs doubt, is there any recommended way to add these libs on the project? The cleanest way I’ve found to import this were with CDN (with babylon cdn btw), but this don’t seems much safe to me, but when I try to add as a package it shows me the “require is not defined” error. What, again, leads me to the question of “why this isn’t added on the babylonjs”?