swat0284 Posted March 7, 2016 Share Posted March 7, 2016 Hello, can i load a model from local disc? Let user to drag it from local disc and show model in a webpage babylon canvas? How can i calculate volume and surface area? Quote Link to comment Share on other sites More sharing options...
Wingnut Posted March 8, 2016 Share Posted March 8, 2016 Hi again, Swat! Wow, you have about 14 questions all mixed into 3 questions, there. First, drag'n'drop to browsers... it's an html thing... so you can learn about what types of files/data can be DnD... out on the web. Lots of talk "out there". But... I think you want to drag and drop models... into an already-rendered scene. Correct? Still, I would learn about what types of data can be dragged onto a canvas element (a URL might be a good datatype), and then... hmm... perhaps you would overload the BJS canvas with a onURLDroppedOntoMe() event/handler. Inside the handler, you call importMesh using the URL.babylon that was dropped onto the canvas. The "engine" doesn't report what volume and surface area that the incoming mesh will take-up. That is calculated by code in your scene... that you write. Likely, you will do bounding box measurements, and instantly scale the model... based-upon measurement findings. It will be code that runs just after the mesh loading completes. But, maybe I'm wrong, too. Others will have ideas, I'm sure. Be patient. 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.