Logo by lycium - 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: Check out the originating "3d Mandelbulb" thread here
 
*
Welcome, Guest. Please login or register. January 16, 2019, 03:59:10 AM


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 222 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 909 Last post December 09, 2006, 11:41:48 PM
by David Makin
Simple 3D IFS in POV-Ray IFS - Iterated Function Systems utak3r 1 3038 Last post March 19, 2010, 08:16:44 AM
by Nahee_Enterprises
Simple menger variant Images Showcase (Rate My Fractal) Lee Oliver 0 530 Last post September 16, 2010, 10:15:05 PM
by Lee Oliver
Plain and Simple Mandelbulb3D Gallery lenord 0 420 Last post February 27, 2011, 07:14:47 PM
by lenord
Antenna Simple FractalForums.com Banner Logos The Rev 0 982 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.137 seconds with 29 queries. (Pretty URLs adds 0.005s, 2q)