English 中文(简体)
通用宽松算法(不适用于特定的GUI API)
原标题:General easing algorithms (Not for sepecific GUI API)

I m developing a control program for a Quadrocopter (AR Drone) under C# I want to ease the input from keyboards (Which do not have axes like joysticks)...

因此,我需要一个方法的集合,用户可以从中选择不同类型的容易。

最佳回答

iTween有很多,而且是在麻省理工学院的许可证下。你可以试着从那里借一些。

问题回答

制作了这些简化的算法来过滤任何类型的归一化信号。

http://github.com/eppz/eppz.easing

// Linear
y = x

// Ease_In
y = x^2

// Ease_In_2
y = x^3

// Ease_In_3
y = x^8

// Ease_Out
y = 1-(1-x)^2

// Ease_Out_2
y = 1-(1-x)^3

// Ease_Out_3
y = 1-(1-x)^8

// Ease_In_Out
y = (x<0.5) ? (2x)^2/2 : 0.5+(1-(2(1-x))^2)/2
y = (x<0.5) ? 2x^2 : -2x^2+4x-1

// Ease_In_Out_2
y = (x<0.5) ? (2x)^3/2 : 0.5+(1-(2(1-x))^3)/2
y = (x<0.5) ? 4x^3 : 4x^3-12x^2+12x-3

// Ease_In_Out_3
y = (x<0.5) ? (2x)^8/2 : 0.5+(1-(2(1-x))^8)/2
y = (x<0.5) ? 128x^8 : 0.5+(1-(2(1-x))^8)/2

// Ease_In_Circular
y = 1-sqrt(1-x^2)

// Ease_Out_Circular
y = sqrt(1-(1-x)^2)
y = sqrt(-(x-2)x)

// Ease_In_Out_Circular
y = (x<0.5) ? (1-sqrt(1-(2x)^2))/2 : 0.5+sqrt(1-((2(1-x))^2))/2
y = (x<0.5) ? 0.5(1-sqrt(1-4x^2)) : 0.5(sqrt(-4(x-2)x-3)+1)

// Ease_In_Bounce
y = 2x^3-x^2
y = x^2(2x-1)

// Ease_In_Bounce_2
y = 3x^3-2x^2
y = x^2(3x-2)

// Ease_In_Bounce_3
y = 4x^3-3x^2
y = x^2(4x-3)

// Ease_Out_Bounce
y = 1-(2(1-x)^3-(1-x)^2)
y = x(x(2x-5)+4)

// Ease_Out_Bounce_2
y = 1-(3(1-x)^3-2(1-x)^2)
y = x(x(3x-7)+5)

// Ease_Out_Bounce_3
y = 1-(4(1-x)^3-3(1-x)^2)
y = x(x(4x-9)+6)

// Ease_In_Out_Bounce
y = (x<0.5) ? (2(2x)^3-(2x)^2)*0.5 : 1-(2(2(1-x))^3-(2(1-x))^2)*0.5
y = (x<0.5) ? 8x^3-2x^2 : 8x^3-22x^2+20x-5

// Ease_In_Out_Bounce_2
y = (x<0.5) ? (3(2x)^3-2(2x)^2)*0.5 : 1-(3(2(1-x))^3-2(2(1-x))^2)*0.5
y = (x<0.5) ? 12x^3-4x^2 : 12x^3-32x^2+28x-7

// Ease_In_Out_Bounce_3
y = (x<0.5) ? (4(2x)^3-3(2x)^2)*0.5 : 1-(4(2(1-x))^3-3(2(1-x))^2)*0.5
y = (x<0.5) ? 16x^3-6x^2 : 16x^3-42x^2+36x-9




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签