Jump to content

mouse + model rotation


waverider
 Share

Recommended Posts

Hy there! i'm working on a cancer project and BJS has proven to be more than resourceful, i want to control my cancer victim  model with the mouse movement, its rotation is not that great. drag the camera right to view other models, click on the model you want to rotate and check animate..Thanks for your taking your time

https://www.babylonjs-playground.com/#XPP99Q#1

Link to comment
Share on other sites

You could switch between two cameras - a free camera and an arcrotate camera, positioned with the same position vector.

A quick demo would be - https://playground.babylonjs.com/#68ZA74 . The main camera is a free camera. until you click on one of the meshes you can use it. Once you click on one of the meshes, the arcRotate camera will be activated and you will rotate around the selected object.

Of course, this is just a demo and can (and should, actually) be extended.

Link to comment
Share on other sites

:) Hi guys. Didn't the user want to rotate the item, not the camera?

Waverider, just move the arc camera.target to the clicked-upon mesh.position.  Then spin the mesh.  (or the camera, around the mesh)  :)

Or am I off-topic?  Probably so.  Interesting that you arranged these models in a circle, and not in a slideshow-like line... along an axis such as X.  hmm.  I would also consider a "rack of little icons/buttons" parented to camera (always on-screen)... to allow users to pick which models they want to view.  Just thoughts.  Party on.

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