Bob Razowsky Posted July 30, 2015 Share Posted July 30, 2015 Hi everybody, What I want is pretty similar to the ArcRotateCamera. I want my object to rotate when the user clicks in the window and move the pointer. The render would be similar than with ArcRotateCamera, but I don't want the camera to move, it has to be the object. Thanks for your help! JackFalcon 1 Quote Link to comment Share on other sites More sharing options...
Gerente Posted July 30, 2015 Share Posted July 30, 2015 Rotations: http://www.babylonjs-playground.com/?17 Quote Link to comment Share on other sites More sharing options...
Wingnut Posted July 30, 2015 Share Posted July 30, 2015 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. Quote Link to comment Share on other sites More sharing options...
Bob Razowsky Posted July 31, 2015 Author Share Posted July 31, 2015 Hi Wingnut! Thanks for your help!Your code seems to be a good starting point, I'll try to tweak it to avoid using Ctrl/Alt/Shift, even though I might loose a few hair in the process!I'll keep you updated. Quote Link to comment Share on other sites More sharing options...
iiceman Posted July 31, 2015 Share Posted July 31, 2015 @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 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 Quote Link to comment Share on other sites More sharing options...
Bob Razowsky Posted July 31, 2015 Author Share Posted July 31, 2015 Iiceman, your solution worked like a charm! Thank you so much! I just had to tweak it so the dragging works anywhere, and it's excatly what I wanted! Here is Wingnut's "scrub rotater" if you want to take a look at it : http://playground.babylonjs.com/#1HXY4E Quote Link to comment Share on other sites More sharing options...
iiceman Posted July 31, 2015 Share Posted July 31, 2015 Glad it helped. Maybe you can post your version of the playground so I can check how you modified it? Quote Link to comment Share on other sites More sharing options...
Bob Razowsky Posted July 31, 2015 Author Share Posted July 31, 2015 Here : http://www.babylonjs-playground.com/#2AKWXH#2 I just added an invisible ground, I think I saw the idea in one of Temechon's posts.It works for what I want to do beacause I want to reset the rotation of my object when pointer is up.If you don't it's a bit bugged! Quote Link to comment Share on other sites More sharing options...
iiceman Posted July 31, 2015 Share Posted July 31, 2015 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! Quote Link to comment Share on other sites More sharing options...
Bob Razowsky Posted July 31, 2015 Author Share Posted July 31, 2015 Thanks for eveything, I'll post the final result soon! Quote Link to comment Share on other sites More sharing options...
Wingnut Posted July 31, 2015 Share Posted July 31, 2015 Thanks ice, and hi guys. Yeah, that was weird. My post ATE the url to the playground. huh. fixed. (brain damage, I suspect) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.