[PLUGIN]Math-update 9/11(additional features)

Completed plugins, behaviors and effects.

Post » Wed Apr 13, 2011 1:15 am


new additions 9-10-11
[quote]
hi guys, big update. For those of you who could just never get the whole moving things with lerp thing, of for those who get sick of typing in the events. Math now has actions to autointerpolate over time. there are two different ways.

first is to create a value to interpolate, that you can retrieve from expressions.

The second is to interpolate object positions,rotations,and dimensions automatically over a given time. like being able to order an object to a location. there are also triggered conditions for when interpolation completes, and actions to pause and resume interpolation. using the automated interpolated value actions and expressions, you could automate anything like pv's, opacity, and color.

also, the interpolation allows you to set a speed curve control point anything from 0 to 1, 0 is ease in, 0.5 is linear, and 1 is ease out.

hope it comes in handy, have fun!!!
[/quote]

new additions 9-11-11
[quote]


  • added the ability to set the current value, of interpolated values, which will create the value if it doesn't exist.


  • you can now access values like this: math.yourvaluename
    and you have not yet created the value, it will return 0


  • if you do it like this: math.yourvaluename(somedefaultvalue)
    and you have not yet created the value, it will return your default value


  • added the ability to change the total time for the interpolation on the fly, as well as the time elapsed, and interpolation curve control point


special thanks to FrenchYann and Somebody for suggestions and testing
[/quote]
(latest update (9-11-11   10:30am:additional bug fixes)
this will be an evergrowing plugin of math functions:
http://dl.dropbox.com/u/1013446/sharinplugs/math/plugins.rar


AngleLerp(a,b,t)
is like lerp(a,b,t) for angles

basically you can lerp two angles, between 0 and 360 (EDIT:no longer has the limitation of having to be angles between 0 and 360), and not have to worry about crossing the 0/360 line just lerp and be happy, knowing that everything is taken care of, and your brainchildren are safe

the second one is Get T which is simply typed t
it's for helping with lerp functions, it's the opposite of lerp
if lerp is x==lerp(a,b,t)
then t==t(a,b,x)

in simpler terms, t(a,b,x) will give a value between 0 and 1 that represents how far between a and b x is.

I'll give more detailed examples later, but this one should suffice for people who already understand lerp and can do this without the t function: say you're looping between 2 and 6 and you want to set create a sprite between point a and b that starts at a and ends at b as you go through the loop evenly spaced in between you would just do
lerp(a,b,t(2,6,loopindex))

hidden functions:
the intersectx, and intersecty expressions[/size:39mnea6i]
they aren't on the expression list, but they work

example cap here:
http://dl.dropbox.com/u/1013446/New%20folder%20%286%29/New%20folder/intersection.cap

these give you the point at which two lines intersect

you can do this 4 ways
specify 4 xy coordinates:
[quote]intersectx(x1,y1,x2,y2,x3,y3,x4,y4)
intersecty(x1,y1,x2,y2,x3,y3,x4,y4)[/quote]
specify 3 xy coordinates(the first two form a line, the 3rd is assumed to be on a perpendicular line):
[quote]intersectx(x1,y1,x2,y2,x3,y3)
intersecty(x1,y1,x2,y2,x3,y3)

[/quote]
specify 4 objects
[quote]intersectx("object1name","object2name","object3name","object4name")
intersecty("object1name","object2name","object3name","object4name")[/quote]
specify 3 objects (the first two form a line, the 3rd is assumed to be on a perpendicular line):
[quote]intersectx("object1name","object2name","object3name")
intersecty("object1name","object2name","object3name")[/quote]

all 4 methods are available in the example cap, just toggle them on and off

lucid2011-09-11 15:28:04
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Wed Apr 13, 2011 3:37 am

Beats my clamp method.;(
Image Image
B
161
S
48
G
90
Posts: 7,350
Reputation: 66,755

Post » Mon Apr 18, 2011 3:40 am

derp i need to try this
B
52
S
7
G
6
Posts: 1,945
Reputation: 7,610

Post » Sun May 15, 2011 3:49 pm

Does not work for me. It keeps saying AngleLerp is not a recognised system expression
B
7
S
2
G
2
Posts: 45
Reputation: 1,465

Post » Sun May 15, 2011 4:38 pm

If you didn't click on the object to get the expression in the event editor, you will need to reference the object like so: math.anglelerp(a,b,t)
Image Image
B
161
S
48
G
90
Posts: 7,350
Reputation: 66,755

Post » Sun May 15, 2011 6:40 pm

Thank you, works like a charm now.
B
7
S
2
G
2
Posts: 45
Reputation: 1,465

Post » Fri Jun 17, 2011 8:22 pm

k, latest addition is the intersectx, and intersecty expressions
they aren't on the expression list, but they work
http://dl.dropbox.com/u/1013446/New%20f ... r/math.rar

example cap here:
http://dl.dropbox.com/u/1013446/New%20f ... ection.cap

these give you the point at which two lines intersect

you can do this 4 ways
specify 4 xy coordinates:
[quote:25zqgnkk]intersectx(x1,y1,x2,y2,x3,y3,x4,y4)
intersecty(x1,y1,x2,y2,x3,y3,x4,y4)[/quote:25zqgnkk]
specify 3 xy coordinates(the first two form a line, the 3rd is assumed to be on a perpendicular line):
[quote:25zqgnkk]intersectx(x1,y1,x2,y2,x3,y3)
intersecty(x1,y1,x2,y2,x3,y3)

[/quote:25zqgnkk]
specify 4 objects
[quote:25zqgnkk]intersectx("object1name","object2name","object3name","object4name")
intersecty("object1name","object2name","object3name","object4name")[/quote:25zqgnkk]
specify 3 objects (the first two form a line, the 3rd is assumed to be on a perpendicular line):
[quote:25zqgnkk]intersectx("object1name","object2name","object3name")
intersecty("object1name","object2name","object3name")[/quote:25zqgnkk]

all 4 methods are available in the example cap, just toggle them on and off
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Fri Jun 17, 2011 9:05 pm

Wow. That is so cool, it hurts my head just thinking of it's potential. Awesome, man.
If your vision so exceeds your ability, then look to something closer.
Moderator
B
120
S
28
G
68
Posts: 4,844
Reputation: 48,289

Post » Sat Jun 25, 2011 3:48 pm

Question regarding (plugin)math.

Can i use this plugin to display the 'Yaw' angle of 3d object.(with text object)

If the player holds down the left mouse the object rotates(yaw) to the left.
If he holds down right mouse, the object rotates(yaw) to the right.

i tried the following -

Set text to int(abs(math.AngleLerp(0, 360, BaseB.Yaw)))

and,

Set text to int(math.AngleLerp(0, 360, BaseB.Yaw))

and,

Set text to int(abs(math.AngleLerp(BaseB.Yaw, BaseB.Yaw, BaseB.Yaw)))

Can't get it to work?

Also, could i have the number reset to 0 if the model turns full circle.

thanks in advance.
B
19
S
6
G
7
Posts: 1,205
Reputation: 7,298

Post » Sat Jun 25, 2011 4:08 pm

I thought yaw didn't reset when you got to 360.
Image Image
B
161
S
48
G
90
Posts: 7,350
Reputation: 66,755

Next

Return to Completed addons

Who is online

Users browsing this forum: No registered users and 0 guests