Sign in to follow this  
Vijay Kumar

Freecamera no Movement only rotation

Recommended Posts

With the FreeCamera object, you can define the keys used for the translation movement (up, down, left & right).

Set it to an empty array if you do not want the user to move :

var camera = new BABYLON.FreeCamera("camera", new BABYLON.Vector3.Zero(), scene);
camera.keysDown = camera.keysLeft = camera.keysRight = camera.keysUp = [];


Share this post

Link to post
Share on other sites

I don't know what do you plan to do with these cameras :P

  •  If you want to have only rotation, you can empty your keys arrays as I said, but you can also use another camera, ArcRotateCamera :
// ArcRotateCamera >> Camera rotating around a 3D point (here Vector zero)
// Parameters : name, alpha, beta, radius, target, scene
var arcCamera = new BABYLON.ArcRotateCamera("ArcRotateCamera", 1, 0.8, 10, new BABYLON.Vector3(0, 0, 0), scene);
arcCamera.setPosition(new BABYLON.Vector3(0, 0, 50)); = new BABYLON.Vector3(3, 0, 0);

The ArcRotateCamera has one goal : rotate around a pivot point ;) . Define this pivot trough


  • If you want to have only translation movements with keyboard (no rotation), this is a strange behavior. You will always face your scene from the same angle, for example you can not look back, so there is no defined property to disable rotation. Maybe anyone else could help on this point.

Share this post

Link to post
Share on other sites

Hi guys

I could be wrong, but this...     =>       ...symbol (in line 31 of Temechon's demo)... might not work in IE.  *shrug*

I don't know the story on that thing, but it failed when I was testing a mousewheel-active version of Temechon's demo.

I think I got the mousewheel working, in FF and IE:

Just simple +/- Z-axis adjusting on the free camera.  Nothing fancy, and nobody asked for it.  I was just curious if I could do it.  :)



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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.