georage Posted July 29, 2016 Share Posted July 29, 2016 Has anyone figured out how to determine the volume of a mesh? I have a parent and child mesh in this playground, but can't figure out how to determine the volume from the vertices of the combined mesh so went with this ugly kludge, but I don't even know how to make the playground output console messages. I notice in testing that the parent mesh does have vertices saved, but I am not sure how to access them. (looks like _boundingInfo -> boundingbox -> vectors ??? ) http://www.babylonjs-playground.com/#1YODXL#4 I am attaching a jpg showing the object array returned in my testing ... can anyone tell me how to access the values? (and also how to make playgrounds show console.log messages?) THANKS! Quote Link to comment Share on other sites More sharing options...
Nabroski Posted July 29, 2016 Share Posted July 29, 2016 Hello i think @Wingnut will tell you more about it Just shortly if you see underscore and name _name these are Protected members of a Class (or in Javascipt offen called an Object, same thing, maybe, you have to do you own research on this topic) you don't have to access them, i would recommend as learning experience avoiding to access them, and find out through reading of tutorials, whats the actual function call that you need to simpfy things, people wrote books about it: console.log(box1) box1 is a "Class" with many members _boundingInfo is a protected member you want to access one of them you have to go in though a dot box1.boundingInfo() i made a quick playground you can see, hopefully, what i do.http://www.babylonjs-playground.com/#1YODXL#5 https://github.com/BabylonJS/Babylon.js/blob/9019f5d151943212e9602c1a6ed5b13800ed6ab2/src/Debug/babylon.debugLayer.js georage and adam 2 Quote Link to comment Share on other sites More sharing options...
JohnK Posted July 29, 2016 Share Posted July 29, 2016 Showing console.log messages is done in the same way as you would do it normally in your browser of choice by opening the console from developer menu. Note that the PG adds new messages to the bottom of existing PG messages so clear the console before clicking on run. adam and georage 2 Quote Link to comment Share on other sites More sharing options...
georage Posted July 29, 2016 Author Share Posted July 29, 2016 Thanks a lot guys. Thanks especially for the playground Nabrowski, it tells me everything I need to know. I do appreciate you taking the time to demonstrate. Quote Link to comment Share on other sites More sharing options...
Wingnut Posted July 29, 2016 Share Posted July 29, 2016 Wingnut Inc... "tell you more about it" -dept... is on vacation in the Bahamas. @Nabroski will be taking care of business while they're out partying. GameMonetize, adam and JohnK 3 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.