- This topic has 13 replies, 5 voices, and was last updated 2 years ago by auriea.
-
AuthorPosts
-
2020-08-26 at 6:02 pm #32018cfxsCustomer
I can’t seem to find the answer for this.
I have a sphere in my scene which I want to drag my mouse or finger over and have it spin in the direction of my mouse or finger. If I release my mouse or finger I would like to have the spin slow down until it finally stops.
What would be the approach for this?
2020-08-27 at 5:19 am #32022GLiFTeKCustomerUse the when dragged puzzle.
Then use the “when moved” puzzle.In the “when moved” puzzle, use the “stop do” option area to trigger a procedure that takes the direction and velocity of the rotation and loops a reduction of the rotational velocity until it reaches zero.
(Probably use the numbers round puzzle for exact control.)
Visit the GLIFTEK Verge3D Plugins Store!
GLIFTEK.com for Plugin Documentation & LIVE DEMOS!
LIKE The GLIFTEK Facebook Page for updates!
Join the Verge 3D Discord Server!
plz share Discord link & on your signature!2020-08-27 at 7:08 am #32030cfxsCustomerthank you for your reply. I assume that I need to add physics to my object right?
Use the when dragged puzzle.
Then use the “when moved” puzzle.
Do I combine these two? Or are they seperate?
Why the move puzzle? The object is supposed to only spin.to trigger a procedure that takes the direction and velocity of the rotation and loops a reduction of the rotational velocity until it reaches zero
This is I think the biggest issue of my question. How do I achieve this procedure?2020-08-27 at 11:04 am #32046Alexander KovelenovStaff2020-08-27 at 11:17 am #32048GLiFTeKCustomerthe move puzzle applies to translated, rotated, scaled objects.
yours would be applying to the fact that it is rotatingthis is more for a scrollable “carousel” for a spinning globe…
i think you probably would be better off using a physics puzzle for a rotating object.. looks like the “physics params” puzzle
has an option called “angular dampening” which will slow down a rotating object.you have to create a new project with physics through the app manager i’m pretty sure.. possibly you can add the code for it in.
Visit the GLIFTEK Verge3D Plugins Store!
GLIFTEK.com for Plugin Documentation & LIVE DEMOS!
LIKE The GLIFTEK Facebook Page for updates!
Join the Verge 3D Discord Server!
plz share Discord link & on your signature!2020-08-27 at 12:45 pm #32056cfxsCustomerI’ve made some progress. I have the monkey spinning when dragging with mouse and also slowing down after release. The only problem left now is how to spin it in the direction of the drag.
Hope someone can help me out.
PS: I’ve attached a screen recording and my setup in puzzles.
2020-08-27 at 1:39 pm #32076Yuri KovelenovStaffhi!
Great progress indeed. So you need to determine the sign of the dragging delta along vertical screen axis, right? Then can you possibly create a variable and remember the coordinate of the mouse cursor at the moment the user starts dragging. Then you could compare it with that at the moment the dragging is finished.
You can retrieve the mouse coordinates using these puzzles:
https://www.soft8soft.com/docs/manual/en/puzzles/HTML.html#event (select ‘mousemove’)
and
https://www.soft8soft.com/docs/manual/en/puzzles/HTML.html#get_event_property
(select ‘pageY’)Attachments:
You must be logged in to view attached files.2020-08-27 at 7:17 pm #32102cfxsCustomerthank you for explaining. Aren’t there any examples available for this?
I looked at get event property and that you print it to the console. Now how can I store that data in a variable?
2020-08-27 at 7:21 pm #32103cfxsCustomerthis is the effect I am trying to achieve.
2020-08-28 at 7:54 am #32111Yuri KovelenovStaffPlease take a look at variables and some usage examples here https://www.soft8soft.com/docs/manual/en/puzzles/Variables.html
2020-08-28 at 9:36 am #32119cfxsCustomerFinnaly got it working! For everyone who runs in to the same questions. Here is my setup.
2020-08-28 at 10:39 am #32121Yuri KovelenovStaff2020-08-29 at 4:48 am #32144GLiFTeKCustomerFinnaly got it working! For everyone who runs in to the same questions. Here is my setup.
Nice job!
Visit the GLIFTEK Verge3D Plugins Store!
GLIFTEK.com for Plugin Documentation & LIVE DEMOS!
LIKE The GLIFTEK Facebook Page for updates!
Join the Verge 3D Discord Server!
plz share Discord link & on your signature!2022-10-23 at 2:13 am #56753 -
AuthorPosts
- You must be logged in to reply to this topic.