Jump to content

Control arcrotate camera zooming with respect to cursor position


masterdon
 Share

Recommended Posts

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.

 

Link to comment
Share on other sites

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

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