Page 1 of 1
Is it possible to animate vectron values in its script?
Posted: Tue Jun 23, 2020 2:05 pm
by foliohattu
im Wondering if its possible to animate vectron script values by adding a key framable slider or altering its script to say that in x number of frames the number should be x ?
Trying to think a way to animate following numbers on menger sponge boolen.
Mainly the 2.1 and 3.2
vector a = mod( p*s, 2.1 )-1.0;
s *= 3.0;
vector r = abs(1.0 - 3.2*abs(a));
Does anyone know if this is possible?
Re: Is it possible to animate vectron values in its script?
Posted: Thu Jun 25, 2020 7:17 am
by bepeg4d
Hi,
you can use the
time parameter, please have a look at this example:
Code: Select all
#include "octane-oslintrin.h"
shader OslGeometry(
int Iterations = 10,
float Power = 2.0,
float Bailout = 20,
output _sdf c = _SDFDEF)
{
vector pos = P;
float power = Power;
float w = fmod(_wipes(), 300.0) / 300.0;
w += time / 300.0;
power = w * 5 + 5.0;
vector z = P;
float dr = 1.0;
float r = 0.0;
for (int i = 0; i < Iterations ; i++) {
r = length(z);
if (r>Bailout) break;
// convert to polar coordinates
float theta = acos(z[2]/r);
float phi = atan2(z[1],z[0]);
dr = pow( r, power-1.0)*power*dr + 1.0;
// scale and rotate the point
float zr = pow( r,power);
theta = theta*power;
phi = phi*power;
// convert back to cartesian coordinates
z = zr*vector(sin(theta)*cos(phi), sin(phi)*sin(theta), cos(theta));
z+=pos;
}
c.dist = 0.5*log(r)*r/dr;
}
ciao Beppe
Re: Is it possible to animate vectron values in its script?
Posted: Tue May 10, 2022 6:00 pm
by AtomicNixon
float w = fmod(_wipes(), 300.0) / 300.0;
Could you tell me the purpose of this line, and what the function _wipes() does, is for? Having real trouble getting this to work properly. More info on how the time variable works is very much needed. Also, any other undocumented variables we should know about?