
I have never heard before of superformulas, but HEY! THEY ARE GREAT

Just bitmap for now, but 3D should be easy if you just need a "Bumped" 2D image.
Have fun

Moderator: Moderators
Code: Select all
// GielisSuperformula - thanks kattle!
float R, T, Xp, Yp, N1, N2, N3, M, Tp, S, Z;
M=5; N1=1; N2=7; N3=8; S=.8; Z=14;
if (this.X!=0 || this.Y!=0) {
Xp=(this.X-0.5)*Z; Yp=(this.Y-0.5)*Z;
T=atan2(Yp,Xp); R=sqrt(Xp*Xp + Yp*Yp);
Tp=R-pow(pow(abs(cos(M*T/4)/1),N2)+pow(abs(sin(M*T/4)/1),N3),-1/N1);
if (Tp<0) {
this.Pixel.r=Tp*(0-S);
this.Pixel.g=Tp*(0-S);
this.Pixel.b=Tp*(0-S);
this.Pixel.a=Tp*(0-S);
}
}