Swipe Rotate - Is there an easier way?

Discussion and feedback on Construct 2

Post » Tue Feb 14, 2017 3:52 am

I'm trying to spin a knob using a touch swipe control scheme for mobile.

first I tried using the physics behavior... no good.

so now I'm manually checking the direction of the swipe, and then the position of the swipe - since that would change the spin direction.

if there's no easier way, can anyone make suggestions to make this capx tighter? I actually have only tested this with the mouse so
far...

I'd also like to make it more kinetic and tried using Touchspeed, but I'm not sure how accurate the mouse is in replicating that. Currently that part is just commented out, but it wasn't working very well especially swiping up.
https://dl.dropboxusercontent.com/u/362 ... _spin.capx
B
88
S
29
G
14
Posts: 1,154
Reputation: 15,003

Post » Tue Feb 14, 2017 6:24 am

Here's a math idea that simplifies it a bit.
Basically it's a torque calulation using a cross product.
https://dl.dropboxusercontent.com/u/542 ... _knob.capx
B
91
S
31
G
102
Posts: 5,232
Reputation: 67,250

Post » Tue Feb 14, 2017 6:44 am

@R0J0hound wow, that does simplify it...

For the torque calc, I don't understand what the multiplying it by 3 does? lowering this gives it more drag maybe? I'd like to play around with the sensitivity and drag.
B
88
S
29
G
14
Posts: 1,154
Reputation: 15,003

Post » Tue Feb 14, 2017 7:04 am

@R0J0hound actually, I think I got it... just had to mess with the numbers. this is great thanks for the help!

simple and brilliant... (I should study calculus II!)
B
88
S
29
G
14
Posts: 1,154
Reputation: 15,003

Post » Tue Feb 14, 2017 7:37 am

The 3 was arbitrary because without it the object wouldn't spin enough. The math is just vector algebra an I probably butchered it a bit.
B
91
S
31
G
102
Posts: 5,232
Reputation: 67,250

Post » Tue Feb 14, 2017 3:39 pm

R0J0hound wrote:The math is just vector algebra an I probably butchered it a bit.

oh haha.. I thought cross product was a calc thing..but maybe that's 3D?

https://betterexplained.com/articles/cross-product/
B
88
S
29
G
14
Posts: 1,154
Reputation: 15,003

Post » Sun Apr 02, 2017 3:47 pm

Could you guys please reupload this capx

Thanks so much!

R0J0hound wrote:Here's a math idea that simplifies it a bit.
Basically it's a torque calulation using a cross product.
https://dl.dropboxusercontent.com/u/542 ... _knob.capx
B
9
S
3
Posts: 26
Reputation: 794

Post » Sun Apr 02, 2017 4:01 pm

@Milupa5 sorry! I don't have it the capx anymore - but I took a screenshot to show someone a while ago..

Image
B
88
S
29
G
14
Posts: 1,154
Reputation: 15,003

Post » Sun Apr 02, 2017 4:20 pm

You could probably use touch speed instead of distance.
Image ImageImage
B
168
S
50
G
163
Posts: 8,221
Reputation: 105,061

Post » Sun Apr 02, 2017 8:53 pm

B
91
S
31
G
102
Posts: 5,232
Reputation: 67,250

Next

Return to Construct 2 General

Who is online

Users browsing this forum: jakezinis and 3 guests