Jump to content

Search the Community

Showing results for tags 'merged mesh center'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
    • Paid Promotion (Buy Banner)
  • Frameworks
    • Pixi.js
    • Phaser 3
    • Phaser 2
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
    • GameMonetize
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered
    • Marketplace (Sell Apps, Websites, Games)

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Twitter


Skype


Location


Interests

Found 1 result

  1. Hi, We have been using babylon2.5 (oddly, an alpha release) in our projects because it served our purposes. Now we want to update to 3.0.7 for various reasons. We have lots of meshes that are imported into an existing scene that have to be logically combined under a parent based on a predefined config. I used this following code to arrive at combination's size and center. var getCombinationData = function(meshes) { var clones = []; for (var i = 0; i < meshes.length; i++) { clones.push(meshes[i].clone("clone" + i)); } var combinedMesh = BABYLON.Mesh.MergeMeshes(clones); var boundingBox = combinedMesh.getBoundingInfo().boundingBox; var size = boundingBox.extendSize.scaleInPlace(2); var center = boundingBox.center; //dispose off the clones; for (var k = clones.length; k > 0; k--) { clones[k - 1].dispose(); } combinedMesh.dispose(); return { size: size, center: center }; }; Using babylonjs 3.0.7, the boundingBox.center is different from that obtained using 2.5, which I am assuming is right , because a box made with size and center got from the above method, neatly encapsulated the meshes. Has anything changed since 2.5 or An easy fix to doing this? The meshes can have parents ( but not different ones). Thanks.
×
×
  • Create New...