Jump to content

Rotate object with drag on window.


Bob Razowsky
 Share

Recommended Posts

Hi bob, welcome to the forum.  I once played with  a "scrub rotater".

http://playground.babylonjs.com/#1HXY4E

Click low on any box, hold the mouse button down, and move the arrow around... the box rotates (in one direction).

It's not exactly what you asked for, but it might work.  The shift/alt/control and click code is not mine... it came from another person's demo.  I just "connected" the onMouseMove trigger/value-changes... to the object rotation actions. 

Hope this helps.

Link to comment
Share on other sites

@Wingy: did the link in your post went missing? It sounds like there should be a link but I don't see any.

 

I tried a very super basic version on my own: http://www.babylonjs-playground.com/#2AKWXH

 

It only works while dragging on the mesh... it breaks if you drag outside the mesh :P But it could be changed to screen coordinates, too, if you want to drag on the whole screen. Maybe that helps as a super basic idea. As I cant see wingys link, I don't what he did. But I assume it's a lot more sophisticated than what I did quick and dirty :D

Link to comment
Share on other sites

I see. As I said, it was just a rough try, there might be even better solutions for the problem, but if you are happy with the result you could mark the topic as answered (there should be a button somewhere).

 

If you need anything else let us know :) Ohw and don't forget to show us the final result of what you created! ;)

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