Max_Cohen

FreeCamera rotation only for Alpha

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!)

Share this post


Link to post
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.

Share this post


Link to post
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

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.