Jump to content

Position of Mesh


freetoplay
 Share

Recommended Posts

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.

Link to comment
Share on other sites

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:
image.thumb.png.a8b804a65a18ed3f90c027c923a7cc77.png

Link to comment
Share on other sites

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?

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...