Alex10 Posted May 3, 2016 Share Posted May 3, 2016 How to make a pan to turn on when click the right mouse button events? In this example, when you hold the right mouse button model does not move.http://www.babylonjs-playground.com/#2ATSCM#0 Quote Link to comment Share on other sites More sharing options...
aWeirdo Posted May 3, 2016 Share Posted May 3, 2016 camera.attachControl only needs two parameters. camera.attachControl(canvas, false); Quote Link to comment Share on other sites More sharing options...
Alex10 Posted May 3, 2016 Author Share Posted May 3, 2016 @aWeirdo In this options, the panning does not work.http://www.babylonjs-playground.com/#2ATSCM#1 Quote Link to comment Share on other sites More sharing options...
aWeirdo Posted May 3, 2016 Share Posted May 3, 2016 @Alex10 It works fine for me, try reloading :), also, the default context menu when right-clicking might be interfering, see http://www.babylonjs-playground.com/#2ATSCM#2 (blocked context-menu) Quote Link to comment Share on other sites More sharing options...
Alex10 Posted May 3, 2016 Author Share Posted May 3, 2016 @aWeirdo No, it's the right button works as the left button. I need to right buttons function as in this example:http://www.babylonjs-playground.com/#AMEB6#1 But for the loaded mesh. I need to panning right button to work like sketchfab. Quote Link to comment Share on other sites More sharing options...
aWeirdo Posted May 3, 2016 Share Posted May 3, 2016 @Alex10 Oh the ctrl panning..? seems you can't set the camera target to the actual mesh then. but you can set it to the same position as the mesh is spawned. (i don't know if this is a playground bug or intended) see http://www.babylonjs-playground.com/#2ATSCM#5 Sorry i misunderstood. "panning" is achieved by holding the CTRL key down and effects both mouse buttons, Alex10 1 Quote Link to comment Share on other sites More sharing options...
Alex10 Posted May 3, 2016 Author Share Posted May 3, 2016 Yes, thank you, this is what I needed. Here is a simplified version of the work and the like.http://www.babylonjs-playground.com/#2ATSCM#11 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.