News: Visit us on facebook  ## The All New FractalForums is now in Public Beta Testing! Visit FractalForums.org and check it out!

 Pages:    Go Down       Author Topic: Menger Sponge, 45 Degree Rotation  (Read 331 times) Description: 0 Members and 1 Guest are viewing this topic.
trafassel
Fractal Bachius Posts: 531  « on: November 24, 2016, 07:17:51 PM »

Menger Sponge, 45 Degree Rotation http://www.fractalforums.com/index.php?action=gallery;sa=view;id=19794

double _scale=4;double _offsetX=1.5;double _offsetY=1.5;double _offsetZ=1.5;double _bailout=2;double _angleX=0;double _angleY=0;double _angleZ=0;public override void Init(){base.Init();if(GetString("intern.Formula.TempUpdateVal")!="7adef8e1846476a9a01954012d687b88"){SetParameterBulk("Formula.Parameters: angleX=0 angleY=0 angleZ=45 bailout=44 offsetX=2.4 offsetY=1.1 offsetZ=1 scale=2.5 Formula.Static: Cycles=14 Julia=1 jx=2 jy=0 jz=0 Scene: CenterX=-0.763429746082816 CenterY=0.329265727596562 CenterZ=-0.522959428364048 Radius=3.66272984947126 Transformation.Camera: AngleX=153.23529497606 AngleY=28.5401934417112 AngleZ=125.103997557095 IsometricProjection=0 Position=1 intern.Formula: TempUpdateVal=7adef8e1846476a9a01954012d687b88");}_scale=GetOrSetDouble("scale");_offsetX=GetOrSetDouble("offsetX");_offsetY=GetOrSetDouble("offsetY");_offsetZ=GetOrSetDouble("offsetZ");_bailout=GetOrSetDouble("bailout");_angleX=Math.PI/180.0*GetOrSetDouble("angleX");_angleY=Math.PI/180.0*GetOrSetDouble("angleY");_angleZ=Math.PI/180.0*GetOrSetDouble("angleZ");}public override bool GetBool(double x,double y,double z){double jx,jy,jz;if (_isJulia){jx=_jx;jy=_jy;jz=_jz;}else {jx=x;jy=y;jz=z;x=_jx;y=_jy;z=_jz;}for (int n=1;n < _cycles;n++){if(n>2 && n <0.6*_cycles){if(x<0)additionalPointInfo.red+=-x;if(y<0)additionalPointInfo.green+=-y;if(z<0)additionalPointInfo.blue+=-z;}x=Math.Abs(x);y=Math.Abs(y);z=Math.Abs(z);if(x>_bailout)return false;if(y>_bailout)return false;if(z>_bailout)return false;if (x<y){double a=x;x=y;y=a;}if (x< z){double a=x;x=z;z=a;}if (y<z){double a=y;y=z;z=a;}x=_scale*x-_offsetX*(_scale-1);y=_scale*y-_offsetY*(_scale-1);z=_scale*z-_offsetZ*(_scale-1);if(_angleX!=0)Rotate(_angleX,ref y,ref z);if(_angleY!=0)Rotate(_angleY,ref x,ref z);if(_angleZ!=0)Rotate(_angleZ,ref x,ref y);x+=jx;y+=jy;z+=jz;}return true;}void Rotate(double angle,ref double x,ref double y){double re=Math.Cos(angle );double im=Math.Sin(angle );double a=re * x-im * y;y=re * y+im * x;x=a;} Logged
 Pages:    Go Down
 Related Topics Subject Started by Replies Views Last post  A Menger Sponge Images Showcase (Rate My Fractal) David Makin 5 3308 April 02, 2007, 03:16:32 AM by bradorpoints  3D menger sponge fly through Movies Showcase (Rate My Movie) DonWebber 0 1600 September 14, 2010, 01:01:18 AM by DonWebber  Through the Menger Sponge Movies Showcase (Rate My Movie) Michael Scharrer 0 335 October 17, 2015, 05:55:43 PM by Michael Scharrer   Menger Sponge 45 Rotation Sierpinski Gasket « 1 2 » trafassel 25 2185 December 17, 2016, 01:17:32 PM by trafassel   Menger City Cruise - 360 Degree Fractal Scenery Still Frame - Fractalforums Postcard KRAFTWERK 0 399 June 13, 2017, 08:09:13 PM by KRAFTWERK