Jump to content

Google Maps style camera ( inverse arc rotate camera)


Recommended Posts

Hey everyone! I am trying to figure out how to implement a google maps style camera. What I mean by this is a camera that pans by default.. so, the inverse behavior of the arc rotate camera. I looked around the forum for camera panning but everything just circles back to 'the arc rotate camera supports panning.' How can I make it so it pans by default and you hold control to rotate it? Ive just got mountains of fail in front of me. The best way to describe it is im trying to replicate the camera movement here: http://middle-earth.thehobbit.com/

Link to comment
Share on other sites

Hi @ragingclaw  Cool... I just got done doing a playground (for someone else) that did something similar, and here it is.


Click/drag OFF the plane (actually a canvas2D)... and the camera is normal.  Drag ON the plane, and the camera's TARGET gets moved (line 95).

Pretty sneaky... sliding around the camera's target to do camera dollying, eh?  I hope this technique doesn't make you sad about the mountains of fail.  ;)

I've done a lot of forum helping today, so I will leave the "hold shift to disable drag-on-map" for you to ponder and code.  But please, DO feel free to ask questions.  We hate hearing about mountains of fail.  BJS tries to be easy, and when it isn't... we're sad... and we feel we need to add-to our tutorials... just like I feel, now.  I hope this gets you rolling.  That playground is a modification of our drag'n'drop playground demo... http://babylonjs-playground.com/?18

Be well, talk soon.

Link to comment
Share on other sites

Thanks! that is what i was trying to do as well, move the camera target. I thought that would be the best way but couldn't get it working. My mountains of fail is me trying to do crazy stuff before grasping the basics, but i dont have time to start small with my deadlines so it's down the barrel for me. i'll take a look at the playgrounds and report back (probably tomorrow). 


Thanks dude!

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.

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.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...