Jump to content

.babylon file camera rotation


bogdanfer
 Share

Recommended Posts

hello, 

just started with babylon and got an fbx file exported from blender to .babylon.
using `BABYLON.SceneLoader.Load` to get my object. 

The camera is rotation around its axis and instead I would like it to rotate around the object.

Playground: http://www.babylonjs-playground.com/#JR2HVU
don't know how to use an external file for the car, but I hope you guys can at least look at the code and maybe spot something i'm doing wrong. 

 

thank you 

Link to comment
Share on other sites

Hi bogdanfer, welcome to the forum.

https://www.babylonjs-playground.com/#JR2HVU#2

I did a little adjusting.  The camera in this rabbit test scene... is a free camera... not the best for orbiting a mesh.  Most people prefer ArcRotateCamera.

So, I made another camera at lines 28-34.  The camera at line 10 is ignored in this case.  It is there ONLY to avoid a playground warning.

For your scene, you may wish to make a new ArcRotateCamera just like I did. 

ArcRotateCamera's differ from FreeCamera's... a little bit.  Primarily, ArcCams have .alpha, .beta, and .radius properties.  FreeCams don't have those.

I hope this helps.  Holler if you have more questions.

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