freetoplay Posted August 26, 2018 Share Posted August 26, 2018 When I use the Asset Manager to import my meshes, it seems to be positioned at a weird angle vs when I import my meshes via append (see screenshots). The first screenshot shows what happens when I use the Asset Manager, how do I make it look like the 2nd screenshot? Quote Link to comment Share on other sites More sharing options...
brianzinn Posted August 26, 2018 Share Posted August 26, 2018 If you are using createDefaultCameraOrLight(), like your "camera question", you are using an ArcRotateCamera. http://doc.babylonjs.com/babylon101/cameras#arc-rotate-camera Check out the alpha + beta + radius in the image in the docs. Here is your duck from another angle: http://www.babylonjs-playground.com/#TT2BK1#3 edit: The difference you are experience may be due to one method creating a new scene and the other appending to existing scene. You would need to share the full code. Quote Link to comment Share on other sites More sharing options...
freetoplay Posted August 26, 2018 Author Share Posted August 26, 2018 Thanks again! I have been trying to play with those values, but so far, I have not been able to get it fully facing the front. I am using the math and code from the previous "camera" thread: http://www.babylonjs-playground.com/#TT2BK1#4 Do you have any additional pointers? Quote Link to comment Share on other sites More sharing options...
brianzinn Posted August 26, 2018 Share Posted August 26, 2018 Great that you found which mesh had a good bounding box! You will need to track which mesh (ie: .meshes[3]) has the bounding box and then perhaps a beta + alpha in radians. I am not aware of mesh metadata that exposes preferred viewing angles: http://www.babylonjs-playground.com/#TT2BK1#5 If you are building something to generically load different meshes, here is some of the staging data that remix3D (I think) is using for their meshes to provide a consistent experience: Quote Link to comment Share on other sites More sharing options...
freetoplay Posted August 26, 2018 Author Share Posted August 26, 2018 I realized that the BabylonJS viewer can do this pretty easily. https://codepen.io/anon/pen/zJqYMW With the exception of the duck (which seems to have its own set position), the above code seems to do exactly what I want it to do, given a mesh that doesn't have its own position set. However, it seems like Viewer doesn't support any frameworks yet. Do you think that the Viewer is a better alternative than writing my own viewer, even if it means waiting for framework support? Quote Link to comment Share on other sites More sharing options...
brianzinn Posted August 26, 2018 Share Posted August 26, 2018 It works on straight up HTML, but it's open source as well. Which framework are you using? Quote Link to comment Share on other sites More sharing options...
freetoplay Posted August 26, 2018 Author Share Posted August 26, 2018 I tried using it with Vue, but there appears to be some conflicts because it uses its own custom DOM element. Quote Link to comment Share on other sites More sharing options...
brianzinn Posted August 26, 2018 Share Posted August 26, 2018 There is some work on loaders in this project, if you check the issues: https://github.com/Beg-in/vue-babylonjs/ 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.