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
100
S
33
G
16
Posts: 1,204
Reputation: 16,865

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
94
S
33
G
118
Posts: 5,393
Reputation: 75,847

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
100
S
33
G
16
Posts: 1,204
Reputation: 16,865

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
100
S
33
G
16
Posts: 1,204
Reputation: 16,865

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
94
S
33
G
118
Posts: 5,393
Reputation: 75,847

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
100
S
33
G
16
Posts: 1,204
Reputation: 16,865

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
100
S
33
G
16
Posts: 1,204
Reputation: 16,865

Post » Sun Apr 02, 2017 4:20 pm

You could probably use touch speed instead of distance.
Image ImageImage
B
172
S
50
G
183
Posts: 8,439
Reputation: 115,597

Post » Sun Apr 02, 2017 8:53 pm

B
94
S
33
G
118
Posts: 5,393
Reputation: 75,847

Next

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 1 guest