Jump to content

FreeCamera rotation only for Alpha


Max_Cohen
 Share

Recommended Posts

@RaananW / others... if MC DID mean FreeCamera... and wants to prevent a freeCamera's .beta-like movement (x-axis rotation), how might that be done? 

Should freeCams HAVE a .pitchLimit and .yawLimit?

In a PM, I showed Max this:

scene.beforeRender = function() {
     myFreeCamera.rotation.x = 0;  // or possibly use myFreeCamera.cameraDirection.x = 0;    (thx Raanan) 
};

But, this method is rather hacky and forceful.  Does anyone know better ways of preventing FreeCamera x-rot?  (thx!)

Link to comment
Share on other sites

The cleanest way I could think of is to create new inputs (keyboard and pointers/mouse) and prevent rotation on the local(!) x axis. which is technically - keeping camera.cameraDirection.x at 0.

Another hack would be to remove the up and down keys from the keyboard, so the inputs wouldn't react to upa nd down. But this is not a true solution to the question. Just partly working.

Link to comment
Share on other sites

13 hours ago, Wingnut said:

scene.beforeRender = function() {
     myFreeCamera.rotation.x = 0;
};

Hi, there! Thanks all for your answers and ideas. This is working to me.

Now, I want to read docs and want to do this idea. If I will do it, I will write my way there.

13 hours ago, RaananW said:

I could think of is to create new inputs

 

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