Numa Posted March 28, 2016 Share Posted March 28, 2016 Hi there, I'm importing a model from raw obj data, and I'm getting strange bounding boxes: 1.The little grey cube on the left is the first to come in and its bounding box is correct. 2.the second grey cube comes next and it looks like its bounding box has grown to be "as wide" as both cubes combined. 3.The big blue box comes in and again, its bounding box seems to be as wide as cubes + itself, and so on. That's my theory at least, no idea what's going on. This is what I use to import the model: var base64Data= "IyBCbGVuZGVyIHYyLjc0IChzdWIgMCkgT0JKIEZpbGU6ICdmYWNlLmJsZW5kJwojIHd3dy5ibGVuZGVyLm9yZwptdGxsaWIgamFjazEubXRsCm8gVGhvdWdodF8yX1Rob3VnaHQyCnYgMC4yMDY5NzMgMy4wMDgyNzIgMi42MDMyOTUKdiAwLjIwNjk3MyAzLjQyMjIxOCAyLjYwMzI5NQp2IDAuMjA2OTczIDMuMDA4MjcyIDMuMDE3MjQyCnYgMC4yMDY5NzMgMy40MjIyMTggMy4wMTcyNDIKdiAtMC4yMDY5NzMgMy4wMDgyNzIgMi42MDMyOTUKdiAtMC4yMDY5NzMgMy40MjIyMTggMi42MDMyOTUKdiAtMC4yMDY5NzMgMy4wMDgyNzIgMy4wMTcyNDIKdiAtMC4yMDY5NzMgMy40MjIyMTggMy4wMTcyNDIKdnQgMC41NTkwNTkgMC41NjM5ODAKdm4gMS4wMDAwMDAgMC4wMDAwMDAgMC4wMDAwMDAKdm4gMC4wMDAwMDAgMC4wMDAwMDAgMS4wMDAwMDAKdm4gLTEuMDAwMDAwIDAuMDAwMDAwIDAuMDAwMDAwCnZuIDAuMDAwMDAwIDAuMDAwMDAwIC0xLjAwMDAwMAp2biAwLjAwMDAwMCAtMS4wMDAwMDAgMC4wMDAwMDAKdm4gMC4wMDAwMDAgMS4wMDAwMDAgMC4wMDAwMDAKdXNlbXRsIE1hdGVyaWFsLjAwMQpzIG9mZgpmIDIvMS8xIDQvMS8xIDMvMS8xIDEvMS8xCmYgNC8xLzIgOC8xLzIgNy8xLzIgMy8xLzIKZiA4LzEvMyA2LzEv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shes.showBoundingBox = true; } }); I also get that error but it doesn't prevent the model from showing up: I'd love some help on this Cheers, Numa Quote Link to comment Share on other sites More sharing options...
jerome Posted March 28, 2016 Share Posted March 28, 2016 could you try to call mesh.refreshBoundingInfo() in your code, just before mesh.showBoundBox = true ? http://doc.babylonjs.com/classes/2.3/Mesh#refreshboundinginfo-rarr-void Quote Link to comment Share on other sites More sharing options...
Numa Posted March 28, 2016 Author Share Posted March 28, 2016 It doesn't seem to make a difference I tried using the asset manager too: var loader = new BABYLON.AssetsManager(scene); var jack = loader.addMeshTask("jack", "", "", modelData); Am I using the correct format for my modelData string? ie. "data:blablablablabla" ? or am I missing some sort of obj indicator similar to what's used for images: "data:image/png;base64," ? Also, I decode my string manually, should I be inputting the raw base64 data? I'm thinking those errors I'm getting on load might prevent the process to fully complete and JS just keeps going with whatever it's got at that point. Thanks! Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 28, 2016 Share Posted March 28, 2016 Is there any parent/children relationship between your objects? Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted March 28, 2016 Share Posted March 28, 2016 Your origin of your raw object is not at 0,0,0 in your object file, and does not have a correct local axis? Please post a screen shot of your 3d file. Quote Link to comment Share on other sites More sharing options...
Numa Posted March 28, 2016 Author Share Posted March 28, 2016 @deltakosh No nothing at that stage. Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted March 28, 2016 Share Posted March 28, 2016 Its the structure of your 3d file for sure then. I can say with a certain degree of confidence that you have multiple objects all with different orgins in your 3d file, this is babylons attempt to organize them and import them. I have seen it happen sometimes with my files. The solution separate all the objects into separate files OR, in your single file make sure all the objects are set to the global position 0,0,0 then move them once they are in babylon. Kind of a headache but that's how I worked around that. Also just by looking at your model, why would you not just construct that with prefabs in babylon? Quote Link to comment Share on other sites More sharing options...
Numa Posted March 28, 2016 Author Share Posted March 28, 2016 Oh ok ok, yes that's what's going on! The mesh in the 3d model is off to the side, its pivot point is at 0,0,0. I need my meshes to be brought where they should be, and with their pivot at their origin, not 0,0,0. So what I used to do in unity (before I moved to babylon) was: 1. Work out the center of the mesh (center of its bounding box in unity) 2. Move the pivot point to the center of the mesh. I think the problem is Babylon seems to include the mesh's pivot point in the bounding box, not just the mesh's vertices. What would be a good way to work out where the center of my mesh is? Pryme8 1 Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted March 28, 2016 Share Posted March 28, 2016 return of the normalize on all the points? <<--- huge guess... what 3d program are you doing to construct the raw? Quote Link to comment Share on other sites More sharing options...
Numa Posted March 28, 2016 Author Share Posted March 28, 2016 That one was made in blender but I need to be able to import pretty much anything so I need to clean up whatever is imported to make sure the pivot is right. Maybe work out the highest/lowest/rightest/leftest points on my mesh and compute my own bounding box? sounds like a pain Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted March 28, 2016 Share Posted March 28, 2016 the correct solution is to make sure you have correctly built 3d files. It would be interesting to have a method for overwriting the imported axis like you are suggesting though. But yea convention is just set up your Obj file correctly and reexport it. Once you get used to this process the 3d model to game engine pipeline becomes easier. But all of this is very important especially as you get into skin weights and other more advance model manipulations. Quote Link to comment Share on other sites More sharing options...
Numa Posted March 28, 2016 Author Share Posted March 28, 2016 The obj is set up correctly. But I need multiple meshes per file, and I need them to come in at their correct world position, with their pivot at the centre of the mesh. Just so you get an idea of why that is, check out http://jig.space We basically have an online editor where people can bring in models and create step by step presentations for instructions / how to's / education / etc. They need to be able to articulate / rotate every part and I can't control what people import, I need to clean up / double check them myself We were building this in Unity, but their webgl builds are huge and slow and we need to move to three.js / babylon to get better loading/parsing times. -- In Babylon is there a way to compute a bounding box from an array of vertices? Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted March 28, 2016 Share Posted March 28, 2016 average of all the points then will give you "center" for the most part, you might want to do limits on it, like an average range or something incase there is some odd point way off to infinity... When they import find the average, then have a option for them to offset the origin Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 29, 2016 Share Posted March 29, 2016 You can easily get the center of your mesh with mesh.getBoundingInfo().boundingSphere.centerWorld. Quote Link to comment Share on other sites More sharing options...
Numa Posted March 29, 2016 Author Share Posted March 29, 2016 @Deltakosh Thanks for that, I gave it a go and the bounding sphere gives me exactly the same result ie the center of the bounding sphere/box which is not where it should be for some reason. How is the bounding box calculated exactly? I made this example: In blender: In babylon: Again, the first cube gets its correct bounding box, the second one gets the total bounding box for both meshes. I'm drawing a little sphere at the center of the second bounding box. The problem doesn't seem to be the origin of the meshes, looks more like the bounding box isn't what it should be. thoughts? EDIT: It looks like the second mesh contains both meshes (see _totalVertices: 24 / 48). Am I doing something horribly wrong or is the importer working in mysterious ways? Thanks! Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted March 29, 2016 Share Posted March 29, 2016 I posted a response then I realized read it.. And deleted it it cause of deunkeness... I will address this tommrow when sober night <3 Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted March 29, 2016 Share Posted March 29, 2016 One thing I did notice in my druken stupor, why is the indices count the same when the verticies are obviously not Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted March 29, 2016 Share Posted March 29, 2016 What happens when you manually change the render Id? Quote Link to comment Share on other sites More sharing options...
JohnK Posted March 29, 2016 Share Posted March 29, 2016 The above topic seems to tackle the same issue of positioning meshes after loading. Unfortunately it only seems resolved by some custom coding (not given). To draw the mesh in the correct place somewhere in the Babylon code the translation vector from the world origin for the mesh must be known or calculated. Perhaps one of the experts could point out where if possible. Quote Link to comment Share on other sites More sharing options...
Wingnut Posted March 29, 2016 Share Posted March 29, 2016 Yeah, it looks like the bounding boxes are being "summed". They are being "cumulative". Strangest thing I've ever seen. It is acting like each mesh is actually a sub-mesh of a master mesh... and this all-encompassing bounding box is doing just that... all-encompassing. Each mesh is not being treated independently of others. There's more than a simple positioning problem here. There's something strange/wrong with the bounding boxes for each mesh, and because of that, positions and pivot centers are landing in the wrong places. Unwanted sub-meshing... maybe that's what we will name it for now. I'll be glad to do my NORMAL assistance... where I talk and talk and talk until everyone forgets what the bug was, or loses interest. Or maybe, we should keep trying to figure out what is happening here. Okay, okay, not "we". SOMEONE. I have the skills to add colors, fog, godrays, sparkly-particles, and nearly any other effect... to the issue. But, I have found that... no matter how much frosting, makeup, fashion, and marbleTexture you add to a dog turd (a bug), it still doesn't taste good. It just LOOKS like it could taste good. http://www.html5gamedevs.com/topic/20932-sceneloaderload-should-be-depreciated/#comment-119123 Append (instead of load) is the subject, there. Maybe this is the wrong approach, but, doesn't this problem ACT somewhat like... each imported mesh is being appended into a constantly-enlarging central bounding box? And, we have not heard of this issue... until very recently. And very recently, is when this sceneLoader.Append() talk started. Coincidence? Maybe not. *shrug* Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 29, 2016 Share Posted March 29, 2016 Based on your description, the second object has twice more vertices than expected. Can you check why in blender? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 29, 2016 Share Posted March 29, 2016 Other question: How do you load your scene? Quote Link to comment Share on other sites More sharing options...
Numa Posted March 29, 2016 Author Share Posted March 29, 2016 Thanks everyone for your help. The model is just 2 boxes, nothing special about it. The same exact datastring loads fine in three.js and unity. I'm pretty sure the problem is in the loading. This was all in my original post hehe : this is what I'm using to load the file: var base64Data= "IyBCbGVuZGVyIHYyLjc0IChzdWIgMCkgT0JKIEZpbGU6ICdmYWNlLmJsZW5kJwojIHd3dy5ibGVuZGVyLm9yZwptdGxsaWIgamFjazEubXRsCm8gVGhvdWdodF8yX1Rob3VnaHQyCnYgMC4yMDY5NzMgMy4wMDgyNzIgMi42MDMyOTUKdiAwLjIwNjk3MyAzLjQyMjIxOCAyLjYwMzI5NQp2IDAuMjA2OTczIDMuMDA4MjcyIDMuMDE3MjQyCnYgMC4yMDY5NzMgMy40MjIyMTggMy4wMTcyNDIKdiAtMC4yMDY5NzMgMy4wMDgyNzIgMi42MDMyOTUKdiAtMC4yMDY5NzMgMy40MjIyMTggMi42MDMyOTUKdiAtMC4yMDY5NzMgMy4wMDgyNzIgMy4wMTcyNDIKdiAtMC4yMDY5NzMgMy40MjIyMTggMy4wMTcyNDIKdnQgMC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IxLzM3IDU0LzIyLzM3IDQ5LzIzLzM3IDQ4LzI0LzM3CmYgNTQvMjEvMzcgNTMvMjIvMzcgNTAvMjMvMzcgNDkvMjQvMzcKZiA1NS8yMS8zNyA1Ny8yMi8zNyA1OC8yMy8zNyA1Ni8yNC8zNwpmIDU0LzIxLzM2IDUyLzIyLzM2IDU2LzIzLzM2IDU4LzI0LzM2CmYgNTEvMjEvMzQgNTMvMjIvMzQgNTcvMjMvMzQgNTUvMjQvMzQKZiA1Mi8yMS8zNSA1MS8yMi8zNSA1NS8yMy8zNSA1Ni8yNC8zNQo=";var modelData = "data:" + window.atob(base64Data); BABYLON.SceneLoader.ImportMesh("", "", modelData, scene, function (meshes) {for (var i = ; i < meshes.length; i++) { meshes.showBoundingBox = true; } }); I also get that error but it doesn't prevent the model from showing up: I tried using the asset manager too: var loader = new BABYLON.AssetsManager(scene); var jack = loader.addMeshTask("jack", "", "", modelData); Am I using the correct format for my modelData string? ie. "data:blablablablabla" ? or am I missing some sort of obj indicator similar to what's used for images: "data:image/png;base64," ? Also, I decode my string manually, should I be inputting the raw base64 data? EDIT: Just tried this and I'm getting the same result of course, although no errors this time. BABYLON.SceneLoader.Append("", modelData, scene); for (var i = 0; i < scene.meshes.length; i++) { scene.meshes[i].showBoundingBox = true; } Thanks Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 29, 2016 Share Posted March 29, 2016 Please share the scene somewhere so we can see it live Or share the .babylon file Quote Link to comment Share on other sites More sharing options...
Numa Posted March 30, 2016 Author Share Posted March 30, 2016 Sure No idea how to save a scene to .babylon, and the playground didn't work so I put it there: https://jig.space/BabylonTest/viewer.html 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.