Jump to content

Rotating the camera on swipe


Dimitry
 Share

Recommended Posts

Hello!

I want to rotate the camera left on swipe left for example. 

Now I put 

camera.rotation.y = camera.rotation.y-0.5;

And it changes very abruptly. 

 

I think camera.cameraDirection = camera.cameraDirection.add(new BABYLON.Vector3 should be used but here enter the sinus and cosinus which I do not know at all :-) Could someone please help?

Link to comment
Share on other sites

Hi again, Dimitry... good to hear from you.  Have you tried our TouchCamera?

 

Here's somebody's demo... I added a touchCamera to it.  But I have no touch devices to test-with.  Does it work ok for you?  Does it swipe nicely?

 

The slim documentation is in our Camera Tutorial under "Unique Purpose Cameras" - http://babylondoc.azurewebsites.net/page.php?p=22061

 

If the touchCamera isn't quite right, it can be modified quite easily.  Keep us posted... thx!

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