masterdon Posted June 5, 2017 Share Posted June 5, 2017 I have got a playground here: 2D planner I have disabled rotation to give a 2D perspective to scene using: camera1.inputs.attached['pointers'].detachControl(canvas); Two issues: 1) user can still rotate around scene using cursor keys. up,down,right, left. Wanted to disable this behaviour. 2) Zooming only occurs with respect to setTarget position(only in y axis). However i wanted to control the zoom effect with respect to cursor position(like this https://www.wanaplan.com/try_plan). Is there any property that i need to set to start this behavior? If not, then i will be translating both setTarget and position property of camera with respect to x and z plane here(on window scroll event). Any help would be appreciated. Thanks. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 5, 2017 Share Posted June 5, 2017 1. camera1.inputs.attached['keyboard'].detachControl(canvas); 2. This is not supported out of the box but your idea seems legit to me davrous 1 Quote Link to comment Share on other sites More sharing options...
masterdon Posted June 5, 2017 Author Share Posted June 5, 2017 @Deltakosh: Thanks, ill start implementing it Should i use window.scroll event for catching zooming/zoomout, or are there handlers in babylon for same? Quote Link to comment Share on other sites More sharing options...
Wingnut Posted June 5, 2017 Share Posted June 5, 2017 Man, I dunno, Masterdon. If I were you, I would TRY to use methods that allow control-drag for target-changing, and camera mousewheel for zoom. Grouping the floorplan items, or meshMerging them, then scaling them in order to "fake the zoom"... those things will give you headaches, in my opinion. Click to put camera target somewhere over the floor plan (or control-drag)... no problem. Then mousewheel-in/out. In my opinion, TRY to ONLY use the camera for zooming and positioning, and avoid manipulating (like group scaling) the floor plan items, if possible. *shrug*. Quote Link to comment Share on other sites More sharing options...
masterdon Posted June 5, 2017 Author Share Posted June 5, 2017 @Wingnut that's the most feasible solution. Translating each element is a big pain. If I get the solution regarding border issue in 3d scene using meshes boxes, then I'll be surely going with it 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.