ragingclaw Posted August 3, 2016 Share Posted August 3, 2016 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/ Quote Link to comment Share on other sites More sharing options...
Wingnut Posted August 3, 2016 Share Posted August 3, 2016 Hi @ragingclaw Cool... I just got done doing a playground (for someone else) that did something similar, and here it is. http://babylonjs-playground.com/#28LCTD#2 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. Quote Link to comment Share on other sites More sharing options...
ragingclaw Posted August 3, 2016 Author Share Posted August 3, 2016 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! Wingnut 1 Quote Link to comment Share on other sites More sharing options...
Wingnut Posted August 3, 2016 Share Posted August 3, 2016 "down the barrel" That's an interesting way of... umm... no, that's a scary way of putting it. Let's hope you are using metaphors/idioms. heh Quote Link to comment Share on other sites More sharing options...
ragingclaw Posted August 4, 2016 Author Share Posted August 4, 2016 haha yeah, a metaphor of course. though some real world table flipping is not out of the question at this point. Wingnut 1 Quote Link to comment Share on other sites More sharing options...
ragingclaw Posted August 4, 2016 Author Share Posted August 4, 2016 Ok @Wingnut using your playground I was able to get panning to work Step 1 of 1000000 done. Thanks so much for the help (im sure i will be back with more issues soon) Wingnut 1 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.