#version 3.8; #include "markov.inc" #global_settings{ assumed_gamma 1.0 } #default{ finish{ ambient 0.1 diffuse 0.9 }} #declare State = array[3]{rgb<1,0,0>, rgb<0,1,0>, rgb<0,0,1>}; #declare Hist_3 = array[27]{ "RRR", "RRG", "RRB", "RGR", "RGG", "RGB", "RBR", "RBG", "RBB", "GRR", "GRG", "GRB", "GGR", "GGG", "GGB", "GBR", "GBG", "GBB", "BRR", "BRG", "BRB", "BGR", "BGG", "BGB", "BBR", "BBG", "BBB" }; #declare TransitionMatrix_3 = array[27]{ // R G B array[3]{0.0, 0.5, 0.5}, //RRR array[3]{0.0, 1.0, 0.0}, //RRG array[3]{0.0, 1.0, 0.0}, //RRB array[3]{0.0, 0.8, 0.2}, //RGR array[3]{0.0, 0.8, 0.2}, //RGG array[3]{0.0, 0.8, 0.2}, //RGB array[3]{0.0, 1.0, 0.0}, //RBR array[3]{0.0, 1.0, 0.0}, //RBG array[3]{0.0, 1.0, 0.0}, //RBB array[3]{0.0, 1.0, 0.0}, //GRR array[3]{0.0, 1.0, 0.0}, //GRG array[3]{0.0, 1.0, 0.0}, //GRB array[3]{0.0, 0.8, 0.2}, //GGR array[3]{0.5, 0.0, 0.5}, //GGG array[3]{0.0, 0.8, 0.2}, //GGB array[3]{0.0, 1.0, 0.0}, //GBR array[3]{0.0, 1.0, 0.0}, //GBG array[3]{0.0, 1.0, 0.0}, //GBB array[3]{0.0, 1.0, 0.0}, //BRR array[3]{0.0, 1.0, 0.0}, //BRG array[3]{0.0, 1.0, 0.0}, //BRB array[3]{0.0, 0.8, 0.2}, //BGR array[3]{0.0, 0.8, 0.2}, //BGG array[3]{0.0, 0.8, 0.2}, //BGB array[3]{0.0, 1.0, 0.0}, //BBR array[3]{0.0, 1.0, 0.0}, //BBG array[3]{0.5, 0.5, 0.0}, //BBB }; #declare Order = 3; #declare History = array[3]{0,0,0}; #declare Stream = seed(8); #declare Mc_3 = MCMarkov(TransitionMatrix_3, Order, History, Stream); #for(X,0,99) #for(Y,0,99) #declare NewState = MCnextState(Mc_3); sphere{, 0.5 pigment{colour State[NewState]}} //#debug concat("new State : <", vstr(3,State[NewState],",",0,0), ">\n") //#debug concat("new history : ", Hist_3[MCgetHist(Mc_3)], "\n\n") #end #end camera{ angle 5.8 location<99/2,99/2,-1000> look_at<99/2,99/2,0> } light_source{ <99/2,99/2,-1000>, rgb 1 }