Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ***************************************************************************************************************************
- POWER EIGHT:
- //float pi = $PI;
- vector v = v@P;
- vector c = v@P;
- int iterations = chi('iterations');
- float n = chf('exponent');
- float phase = chf('phase_shift');
- for(int i=0; i<iterations; i++){
- float r = sqrt(pow(v.x, 2) + pow(v.y, 2) + pow(v.z, 2));
- float phi = n * asin(v.z/ r) + phase;
- float theta = n * atan2(v.y, v.x);
- float newx = pow(r, n) * cos(theta) * cos(phi);
- float newy = pow(r, n) * sin(theta) * cos(phi);
- float newz = pow(r, n) * -sin(phi);
- v = set(newx, newy, newz) * r + c;
- if(length(v) > chf('t')){
- f@density = 0.0;
- f@temperature = 0.0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement