johnpribesh Posted February 22, 2016 Share Posted February 22, 2016 I am wondering if there is a way to scale or resize an importMesh. I need to enlarge the mesh from its original import size. I am currently doing the following, but it has no effect on the size of the mesh: BABYLON.SceneLoader.ImportMesh("", "meshes/", selectedMesh, scene, function(addedMeshes) { // tried this addedMeshes[0].scaling.x = 67; // Also tried this addedMeshes[0].scaling = new BABYLON.Vector3(67, 67, 67); }); Is there a way I can just resize/scale the imported mesh? Quote Link to comment Share on other sites More sharing options...
adam Posted February 22, 2016 Share Posted February 22, 2016 Not sure why that isn't working. Check to make sure you are referencing the correct mesh. 67 is going to make the mesh huge. I'd try something like 2 (twice the original size) or 0.5. Quote Link to comment Share on other sites More sharing options...
Stvsynrj Posted February 22, 2016 Share Posted February 22, 2016 Hi ! You should add the debugLayer and check the meshTree to see if you are really referencing the right object in the scene like object[0] can be a light. (i got that problem too) Quote Link to comment Share on other sites More sharing options...
johnpribesh Posted February 23, 2016 Author Share Posted February 23, 2016 @adam So using 2, its seems to attempt to work but doesnt. see screenshot it puts a tiny dot at twice the height of the mesh @Stvsynrj How do I add the debuglayer, can you point me to a doc? Quote Link to comment Share on other sites More sharing options...
johnpribesh Posted February 23, 2016 Author Share Posted February 23, 2016 Quote Link to comment Share on other sites More sharing options...
johnpribesh Posted February 23, 2016 Author Share Posted February 23, 2016 @Stvsynrj I found the docs:scene.debugLayer.show(); Wingnut 1 Quote Link to comment Share on other sites More sharing options...
Wingnut Posted February 23, 2016 Share Posted February 23, 2016 I bet that's a "piece" of the avatar up in the air, there. I bet it's a control gizmo (that guy's left nut)... with an over-scaled bounding box around it. I bet addedMeshes[0] is a "nad". If you put it into a vise, the avatar automatically does what you ask of it. errr... maybe not. Quote Link to comment Share on other sites More sharing options...
johnpribesh Posted February 23, 2016 Author Share Posted February 23, 2016 @Wingnut I think you are correct, atleast about the piece part, whether its a nut or not... well leave that up for debate. According to the debugger perhaps is his eye. Is there a way I can print the name of the meshes on import, so I can figure out the proper index? Quote Link to comment Share on other sites More sharing options...
johnpribesh Posted February 23, 2016 Author Share Posted February 23, 2016 Figured that out too. Look like its just: console.log(addedMeshes[0].name); Quote Link to comment Share on other sites More sharing options...
Wingnut Posted February 23, 2016 Share Posted February 23, 2016 Yep, you're on your way. Cool. Welcome to the forum, by the way. You'll learn that MANY things in BJS... can be figured out faster than asking on the forum. I used to ask a lot of things, too. I got over it. Now I just talk aimlessly. heh I did my first mesh import to the playground... recently. http://www.babylonjs-playground.com/#1CMD3G#7 See that line if (text) ? Essentially, that means... if the model is finally done loading. That can be a place of rough water for new importing folk. Scopes and delays.... part of the fun. johnpribesh 1 Quote Link to comment Share on other sites More sharing options...
johnpribesh Posted February 23, 2016 Author Share Posted February 23, 2016 Haha thanks! this is the first time I've ever used BJS or any webgl/3d stuff so a little overwhelming, but Im starting to get it. Yep looks like your right @Wingnut, and @Stvsynrj the issue was the index of the mesh I was using. Thanks for all the help guys! Wingnut 1 Quote Link to comment Share on other sites More sharing options...
Wingnut Posted February 23, 2016 Share Posted February 23, 2016 Cool. The playground searcher... rocks. http://doc.babylonjs.com/playground don't try searching for something.something ...the period screws it up. But... fun things like godrays and particles and spherical harmonics... will get you a pile of fun urls to tour. Notice the ZIP choice at the top. Take ANY playground demo home and unzip it somewhere... its ready to run... and hack. But.... just use the playground itself, make a change, hit run, make a change, hit run... it's totally addictive and uber-fun. The whole atmosphere of the forum, framework, users... its great. You can't help but have a blast around here. What part of the planet you on, John? (if you don't mind me asking) Quote Link to comment Share on other sites More sharing options...
johnpribesh Posted February 23, 2016 Author Share Posted February 23, 2016 Yea some of the playground stuff is pretty intense, awesome. Im currently in the Washington DC Area working as a javascript developer. Hope to move away from here and work remote before the year is up. cost of living and traffic are way too insane for me around here Wingnut 1 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 23, 2016 Share Posted February 23, 2016 Hey! this is cool I'm living near Seattle (Duvall if you this little town) Ok and now I read correctly your post and saw that you are in Washington DC not Washington state ;D 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.