Logo by blob - Contribute your own Logo!

END OF AN ERA, FRACTALFORUMS.COM IS CONTINUED ON FRACTALFORUMS.ORG

it was a great time but no longer maintainable by c.Kleinhuis contact him for any data retrieval,
thanks and see you perhaps in 10 years again

this forum will stay online for reference
News: Follow us on Twitter
 
*
Welcome, Guest. Please login or register. March 28, 2024, 05:07:01 PM


Login with username, password and session length


The All New FractalForums is now in Public Beta Testing! Visit FractalForums.org and check it out!


Pages: [1]   Go Down
  Print  
Share this topic on DiggShare this topic on FacebookShare this topic on GoogleShare this topic on RedditShare this topic on StumbleUponShare this topic on Twitter
Author Topic: Simple Menger  (Read 924 times)
0 Members and 1 Guest are viewing this topic.
trafassel
Fractal Bachius
*
Posts: 531


trafassel
« on: February 19, 2017, 10:46:08 PM »

Simple Menger



http://www.fractalforums.com/index.php?action=gallery;sa=view;id=20075

public override void Init(){base.Init();if(GetString("intern.Formula.TempUpdateVal")!="45ea375e46e1a8d8b84edded6f88e4c7"){SetParameterBulk("Formula.Parameters: anglex=0 angley=0 anglez=0 boxSize=2 holeSize=1 scalex=0.8 scaley=0.8 scalez=0.8 Formula.Static: Cycles=17 Julia=1 jx=0 jy=0 jz=0 Scene: CenterX=-0.101596203851992 CenterY=-0.503356209583339 CenterZ=-0.53093858838795 Radius=0.220365519803785 Transformation.Camera: AngleX=10.2074451858821 AngleY=-19.0315263881349 AngleZ=-53.2901631402185 IsometricProjection=0 Position=1 intern.Formula: TempUpdateVal=45ea375e46e1a8d8b84edded6f88e4c7");}if(GetString("intern.Formula.TempUpdateVal")!="3275c2a4ff5fcde853faa40e7ffaa9ca"){SetParameterBulk("Formula.Parameters: anglex=0 angley=0 anglez=0 boxSize=2 holeSize=1 scalex=0.8 scaley=0.8 scalez=0.8 Formula.Static: Cycles=17 Julia=1 jx=0 jy=0 jz=0 Scene: CenterX=-0.101596203851992 CenterY=-0.503356209583339 CenterZ=-0.53093858838795 Radius=0.220365519803785 Transformation.Camera: AngleX=10.2074451858821 AngleY=-19.0315263881349 AngleZ=-53.2901631402185 IsometricProjection=0 Position=1 intern.Formula: TempUpdateVal=3275c2a4ff5fcde853faa40e7ffaa9ca");}}public double boxSize;public double holeSize;public double scalex;public double scaley;public double scalez;public double anglex=0;public double angley=0;public double anglez=0;public override bool GetBool(double x,double y,double z){double cosAngleX=Math.Cos(Math.PI/180.0*anglex);double cosAngleY=Math.Cos(Math.PI/180.0*angley);double cosAngleZ=Math.Cos(Math.PI/180.0*anglez);double sinAngleX=Math.Cos(Math.PI/180.0*anglex);double sinAngleY=Math.Sin(Math.PI/180.0*angley);double sinAngleZ=Math.Sin(Math.PI/180.0*anglez);double boxSizeScalex=boxSize*scalex;double boxSizeScaley=boxSize*scaley;double boxSizeScalez=boxSize*scalez;double holeSize2=2*holeSize;x*=boxSize;y*=boxSize;z*=boxSize;if(x> boxSizeScalex)return false;if(y> boxSizeScaley)return false;if(z> boxSizeScalex)return false;if(x<-boxSizeScalex)return false;if(y<-boxSizeScaley)return false;if(z<-boxSizeScalez)return false;for (int n=1;n < _cycles;n++){double xa=Math.Abs(x);double ya=Math.Abs(y);double za=Math.Abs(z);int holeCount=0;if(xa<holeSize)holeCount++;if(ya<holeSize)holeCount++;if(za<holeSize)holeCount++;if(holeCount>=2)return false;if(x> holeSize){Red++;x-=holeSize2;}else if(x<-holeSize){Red--;x+=holeSize2;}if(y> holeSize){Blue++;y-=holeSize2;}else if(y<-holeSize){Blue--;y+=holeSize2;}if(z> holeSize){Green++;z-=holeSize2;}else if(z<-holeSize){Green--;z+=holeSize2;}x*=boxSizeScalex;y*=boxSizeScaley;z*=boxSizeScalez;if(anglex!=0)Rotate(sinAngleX,cosAngleX,ref y,ref z);if(angley!=0)Rotate(sinAngleY,cosAngleY,ref x,ref z);if(anglez!=0)Rotate(sinAngleZ,cosAngleZ,ref x,ref y);}return true;}void Rotate(double sinAngle,double cosAngle,ref double x,ref double y){double a=cosAngle * x-sinAngle * y;y=cosAngle * y+sinAngle * x;x=a;}
Logged
Pages: [1]   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
Simple 2D IFS animation Movies Showcase (Rate My Movie) David Makin 0 1915 Last post December 09, 2006, 11:41:48 PM
by David Makin
Simple 3D IFS in POV-Ray IFS - Iterated Function Systems utak3r 1 7816 Last post March 19, 2010, 08:16:44 AM
by Nahee_Enterprises
Simple menger variant Images Showcase (Rate My Fractal) Lee Oliver 0 1125 Last post September 16, 2010, 10:15:05 PM
by Lee Oliver
Plain and Simple Mandelbulb3D Gallery lenord 0 1122 Last post February 27, 2011, 07:14:47 PM
by lenord
Antenna Simple FractalForums.com Banner Logos The Rev 0 2095 Last post March 13, 2011, 07:29:13 AM
by The Rev

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM
Page created in 0.499 seconds with 26 queries. (Pretty URLs adds 0.017s, 2q)