Jump to content

Locked Axis


Mezzorio
 Share

Recommended Posts

I am setting up some camera rotation things and I want to know how to lock the camera rotation, so when I move the mouse on the y axis (the camera is pointing at the mouse btw) it is locked to stay looking at part of the screen that for examples sake is above 30% from bottom and below 70% of the scene?

Also i want to know if i can set up a mouse hover for movement the pseudo code would follow;

-detect mouse position

-if position is under 40% from left to middle rotate camera left,

if position is between 40-60% rotation left at a slower speed

if position is greater than 60% from left to right rotate camera right

I currently have it spinning the scene following the mouse, as simple as;

function mouseMove(e){

camera.rotation.y = scene.pointerX/1000;

camera.detachControl(canvas);
            }

 

note: the detach control removes the click to drag default feature that i do not want.

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