Jump to content

Rotation UniversalCamera

Andrey Zimin

Recommended Posts

I have - const camera = new BABYLON.UniversalCamera

and this 

camera.keysUp = [87]
camera.keysDown = [83]
camera.keysLeft = [65]
camera.keysRight = [68]

W - up

A - left

S - down

D - right

Question: How change mouse left button on keyboard?

How made this ?

I - Camera rotation Up

J - Camera rotation left

K - Camera rotation down

L - Camera rotation right




Link to comment
Share on other sites

This could be done by manually handling keyboard input. See this post http://www.html5gamedevs.com/topic/12625-keyboard-controls-and-the-debug-console/

Then every frame you can check to see if the key is pressed and move the camera.

See this playground of everything working: http://playground.babylonjs.com/#UK9FXK#3

Hope this helps.

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.

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.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...