masterdon Posted May 2, 2017 Share Posted May 2, 2017 Hi Team. We have developed the platform for designing 2d models of buildings and work spaces. However, we were thinking to migrate from existing js to babylon for two reasons: to improve usability in designing and support to 3d model rendering. Our use cases are something like this.and i have already started working on it. so i will post the query for each topic. 1) a 2dplayground with just zoom in zoom out effect. I am using below code. which has both rotation and zoom effect. var camera = new BABYLON.ArcRotateCamera("Camera", 0, 0.8, 100, new BABYLON.Vector3.Zero(), scene); camera.attachControl(canvas, true); I have seen a solution in one of the topic to detachControl for removing rotation effect. However that also removes zooming. I want to only keep zoom in zoom and no rotation pertaining to workspace. 2) Option to add elements to scene from panel. user can drag and drop elements like lines,circles on predefined shape/rectangular model available in space. What would the best case to allow users to only drag and drop on certain edges of the rectangle. 3) I have another example where i am trying to create basic solid line in rectangle. which throws some error: http://www.babylonjs-playground.com/#272WI1#90 Thanks for Help in Advance, MasterDon Quote Link to comment Share on other sites More sharing options...
Gijs Posted May 2, 2017 Share Posted May 2, 2017 For #1 you can do this: camera.inputs.attached['pointers'].detachControl(canvas); Quote Link to comment Share on other sites More sharing options...
masterdon Posted May 3, 2017 Author Share Posted May 3, 2017 Wow. that works. Thanks a lot Gijs. Currently i have created the plane, which will have rotation disabled when planning is done in 2D mode. http://www.babylonjs-playground.com/#7EJ4CM . rotation will be enabled only in 3D mode. Can anyone guide me one second point. how should i create the option to add solid lines that depicts walls of structure. I was thinking to consider using lines or planes. I have a requirement that lines can be of different type depicting different parts of structure(windows,walls,free walls, slider windows,etc.). should have ability to set height,width, gradient, ability to drag and drop in 2d i.e. wrt x & y axis. 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.