Jump to content

Someone likes to help me integrate a new camera? (pan instead of rotate)


brean
 Share

Recommended Posts

Hi everyone!

Thank you all for your great work! working with Babylon is a lot of fun!

I am working on a visualization of some buildings (based on osmbildings.org ) for babylon.js. It works quite well, and I managed to create a camera that is panning on my map instead of rotating around an object when using a pointing device (mouse).

I disabed the camera/input system of babylon completely and listen to pointer events from the browser. I think that that's very ugly and I would like to see this integrated into Babylon. I am not so familar with TypeScript and I am not sure I understand everything of the babylon input behaviour. Here is my code:

https://www.babylonjs-playground.com/#LRMBBI

Use the mouse to move the camera as well as the mouse wheel to zoom in. Note that zooming in should move to the mouse cursor but it is a bit off.

It would be awesome if someone could help me to integrate this into the Babylon codebase.

Link to comment
Share on other sites

16 hours ago, aWeirdo said:

Why not use arcRotateCamera and set panning without ctrl and button 0 ?

Good suggestion but I noticed that the panning of the ArcRotateCamera is not constant with the mouse movement and it always zooms to the center, not to the mouse cursor. If both points can be implemented with the existing camera I would actually prefer use it instead of creating something new.

I also don't know how to extend the existing input behavior to do that, so I assume I need a new camera and/or input.

Link to comment
Share on other sites

  • 3 weeks later...

@Deltakosh This sub-forum is still mis-named a bit, isn't it?  (Feel free to ignore this comment, Brean.  Or comment, if you wish.)

hmm.  "Hired Help"? 

Unfortunately, "Hired Help" or "Hired Guns" doesn't imply that it's BOTH shoes, buyer and seller.

 - Could be experts, looking for work.

 - Could be non-experts, looking for expert help.

 - Could be experts looking for more experts.

 - Could be noobs looking to hire other noobs, but unlikely.  :)

I was the one that whined about using the word "business", but... I dunno.  It might need to come back.

hmm.  Anyone remember where the thread is at... where we talked about naming this sub-forum?

I should probably take my worthless yammering... there.  :)

 

 

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