A little gift for jph_wacheski
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
Superformulas
Moderator: Moderators
Superformulas
- Attachments
-
- superformula.zgeproj
- (1.73 KiB) Downloaded 572 times
- jph_wacheski
- Posts: 1005
- Joined: Sat Feb 16, 2008 8:10 pm
- Location: Canada
- Contact:
supercool!
Hay that is wicked! I knew you could implement that equation in ZGE with way more speed and eloquence than I.., amazing.
This looks to b very usefull indeed,. so many uses for these shapes,. particles, mesh textures, level designs,. etc.
We should post some nice values in this thread,. or wait, there where a bunch on the wikipedia post,.I going to go try those,. . brb
yup these work fine; http://en.wikipedia.org/wiki/Superformula
2111 for an eye,. sweet PGC, tasty.
This looks to b very usefull indeed,. so many uses for these shapes,. particles, mesh textures, level designs,. etc.
We should post some nice values in this thread,. or wait, there where a bunch on the wikipedia post,.I going to go try those,. . brb
yup these work fine; http://en.wikipedia.org/wiki/Superformula
2111 for an eye,. sweet PGC, tasty.
iterationGAMES.com
- jph_wacheski
- Posts: 1005
- Joined: Sat Feb 16, 2008 8:10 pm
- Location: Canada
- Contact:
the minimized ver of the above
Here is the ver. of this as I am using it now,.
I was trying to fold it into a Library Component to reuse the formula but I'm just cuting and pasting this when I need another,. simple enouph.
How about a 3d mesh ver. ?
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);
}
}
How about a 3d mesh ver. ?
iterationGAMES.com
Updated to use the "float" keyword inside the ZExpressions, and added 3D code
However, I'm still working on the Normals, since it might be a little tricky to fix them. However you can just toggle autonormals to get a nice effect.
PS: you can use my "Better Sphere" ZExpression before the 3D one to get a better "upper" surface;
However, I'm still working on the Normals, since it might be a little tricky to fix them. However you can just toggle autonormals to get a nice effect.
PS: you can use my "Better Sphere" ZExpression before the 3D one to get a better "upper" surface;
- Attachments
-
- superformula.zgeproj
- (2.45 KiB) Downloaded 497 times
In the fall of 1972 President Nixon announced that the rate of increase of inflation was decreasing. This was the first time a sitting president used the third derivative to advance his case for reelection.
-=Hugo Rossi=-
-=Hugo Rossi=-
- jph_wacheski
- Posts: 1005
- Joined: Sat Feb 16, 2008 8:10 pm
- Location: Canada
- Contact:
nicely done.
Very very cool!
lov the 3d!,. will be great for all sorts of nicely organic primatives to build stuff from,. here is a few minuets of testing,.
thnks bro,. you roc.
lov the 3d!,. will be great for all sorts of nicely organic primatives to build stuff from,. here is a few minuets of testing,.
thnks bro,. you roc.
- Attachments
-
- superformula_3D_jan1109.zip
- plant life, .. .exe
- (33.31 KiB) Downloaded 588 times
iterationGAMES.com