hit2501 Posted September 8, 2015 Share Posted September 8, 2015 Hi.I want to know if scaling.x or .y or .z is the only way to get the dimensions of a mesh (imported from blender).Thanks Quote Link to comment Share on other sites More sharing options...
Temechon Posted September 8, 2015 Share Posted September 8, 2015 Personnaly, I use this: http://www.babylonjs-playground.com/#1NZLA9 To have the size, you just have to do: size.scaleInPlace(2) hit2501 1 Quote Link to comment Share on other sites More sharing options...
hit2501 Posted September 8, 2015 Author Share Posted September 8, 2015 Thank you very much Temechon I followed your Babylon example It's more closer to the real model with BoundingInfo but I don't know how to use scaleInPlace, I put: mymesh.scaleInPlace(2);But doesn't work, what am I doing wrong? Sorry if its too basic, I'm a Babylon noob.I saw that the units used to show position are different, what kind of unit is used for position and what units for boundingInfoOnce more, thank you Quote Link to comment Share on other sites More sharing options...
Temechon Posted September 9, 2015 Share Posted September 9, 2015 Sorry, I guess I was too fast as answering (very common these days, I have to calm down:) ) This gives you the 'extends' size of your mesh: the number of units between the center of the mesh and the side of the mesh (along x, y and z axis):var size = sphere.getBoundingInfo().boundingBox.extendSize;For the sphere in my example, 'size' will then correspond to its radius.For a box of scaling (1,1,1), this piece of code will returns (0.5,0.5,0.5). If you want to have the diameter, you just have to scale this radius by 2, like this:var diameter = size.scale(2);Is it clearer now? To anser to your second question, all units in Babylon are the same: position, boundingInfo, scaling... Hans 1 Quote Link to comment Share on other sites More sharing options...
Wingnut Posted September 9, 2015 Share Posted September 9, 2015 Thanks Temechon! In case anyone is wondering who asked for clarification (via PM), it was I. Yep, I understand it perfectly, now. Very good. Quote Link to comment Share on other sites More sharing options...
hit2501 Posted September 11, 2015 Author Share Posted September 11, 2015 Crystal clear. Thank you very much Temechon Temechon 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.