Page 1 of 1

Display equations, and visualize energy.

PostPosted: Tue Feb 06, 2018 12:56 am
by nemrod
Hi,
Algodoo could be more educational if the equations used to solve physics were displayed somewhere in objects properties. (in the informations properties maybe ?)
Would be also very cool if there were some sort of visualisation of energy (by type ?) with colors.
Ex:
kinetic energy dispay mode : all objects are rendered with a gradient color according to their kinetic energy.
(or other alternatives more human readable than number and vectors)

Re: Display equations, and visualize energy.

PostPosted: Tue Aug 07, 2018 12:32 am
by FRA32
While not included in algodoo itself, one can cause these effects by use of the integrated scripting language Thyme. Your example would be realized by inserting this script into the "Poststep" field of all objects that should have the gradient (replace anything in <> with the actual values):

(e)=>{
Color1 = <[r,g,b,a]>; <- Color 1 of your gradient(Low energy)
Color2 = <[r,g,b,a]>; <- Color 2 of your gradient(High energy)
gradScale = <x>; <- Scale of the gradient, larger number means more energy required to reach Color2
Ekin = density*area/2*math.vec.len(vel)^2;
funcVal = 0.5^(Ekin/gradScale);
color = Color1*funcVal+Color2*(1-funcVal)
}

If you plug [.8,0,0,1],[0,.9,.9,1] and 4 as values in, you get a nice color change between red and cyan. Other possibilities would be to use the graph window in the properties menu, which graphs various object properties(Including some energies) depending on other properties(mostly time).
If you directly message me on the forum, I could help you by providing more scripts, should you desire something that can be done using them.