Jump to content

Freecamera no Movement only rotation


Vijay Kumar
 Share

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 = [];

 

Link to comment
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));
arcCamera.target = new BABYLON.Vector3(3, 0, 0);

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

 

  • 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.
Link to comment
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:   http://www.babylonjs-playground.com/#1B1Z28#3

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

kbye

 

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