Jump to content

LoadMesh and add boundingBox


Gutgiut
 Share

Recommended Posts

Hi,

I'm starting programming with BABYLONJS and loving it.

I've watched MVA - Babylonjs course and have a question, how can you load a mesh and add to it a boundingbox so you can get it's size and also control colisions

My code looks like this:

// load mesh
engine.displayLoadingUI();
BABYLON.SceneLoader.ImportMesh("", "models/motor_boat/", "motor_boat.babylon", scene, function (yacht) {
    engine.hideLoadingUI();
    yacht[0].name = "boat";

// boat dimentions
	var size = yacht[0].getBoundingInfo().boundingBox.vectors.extendSize;
	console.log(size);
});

console prints undefined

What am I doing wrong?

Tks

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...