Only in mandelbulber-modified/: .cproject Only in mandelbulber-modified/: .project diff -r -c /home/jeremy/Downloads/mandelbulber1.12-1/src/fractal.cpp mandelbulber-modified/src/fractal.cpp *** /home/jeremy/Downloads/mandelbulber1.12-1/src/fractal.cpp 2012-06-09 22:22:33.000000000 +0800 --- mandelbulber-modified/src/fractal.cpp 2012-11-14 12:26:52.045001826 +0800 *************** *** 59,64 **** --- 59,67 ---- double p = par.doubles.power; //mandelbulb power CVector3 constant; + double append_z[6]; + double append_c[6]; + int append_n = 0; double fixedRadius = par.mandelbox.doubles.foldingSphericalFixed; double fR2 = fixedRadius * fixedRadius; *************** *** 76,81 **** --- 79,91 ---- double tgladColor = 1.0; + for(int component = 0; component < 6 && append_n < 6; ++component) + if(par.mandelbox.doubles.appendVectorComponents[component] != 0) + { + append_z[append_n] = par.mandelbox.doubles.appendVectorComponents[component]; + ++append_n; + } + if (par.juliaMode) { constant = par.doubles.julia; *************** *** 83,88 **** --- 93,100 ---- else { constant = z * par.doubles.constantFactor; + for(int component = 0; component < append_n; ++component) + append_c[component] = append_z[component]; } bool hybridEnabled = false; *************** *** 500,515 **** z.z = -par.mandelbox.doubles.foldingValue - z.z; tgladColor += par.mandelbox.doubles.colorFactorZ; } } ! r = z.Length(); ! double r2 = r * r; ! z += par.mandelbox.doubles.offset; if (r2 < mR2) { z *= tglad_factor1; tgladDE *= tglad_factor1; tgladColor += par.mandelbox.doubles.colorFactorSp1; } --- 512,543 ---- z.z = -par.mandelbox.doubles.foldingValue - z.z; tgladColor += par.mandelbox.doubles.colorFactorZ; } + for (int component = 0; component < append_n; component++) + { + if (append_z[component] > par.mandelbox.doubles.foldingLimit) + { + append_z[component] = par.mandelbox.doubles.foldingValue - append_z[component]; + } + else if (append_z[component] < -par.mandelbox.doubles.foldingLimit) + { + append_z[component] = -par.mandelbox.doubles.foldingValue - append_z[component]; + } + } } ! double r2 = z.x * z.x + z.y * z.y + z.z * z.z; ! for(int component = 0; component < append_n; component++) ! r2 += append_z[component] * append_z[component]; ! r = sqrt(r2); z += par.mandelbox.doubles.offset; if (r2 < mR2) { z *= tglad_factor1; + for(int component = 0; component < append_n; ++component) + { + append_z[component] *= tglad_factor1; + } tgladDE *= tglad_factor1; tgladColor += par.mandelbox.doubles.colorFactorSp1; } *************** *** 517,522 **** --- 545,554 ---- { double tglad_factor2 = fR2 / r2; z *= tglad_factor2; + for(int component = 0; component < append_n; ++component) + { + append_z[component] *= tglad_factor2; + } tgladDE *= tglad_factor2; tgladColor += par.mandelbox.doubles.colorFactorSp2; } *************** *** 526,534 **** z = par.mandelbox.mainRot.RotateVector(z); z = z * scale + constant; tgladDE = tgladDE*fabs(scale)+1.0; ! r = z.Length(); break; } --- 558,571 ---- z = par.mandelbox.mainRot.RotateVector(z); z = z * scale + constant; + for(int component = 0; component < append_n; ++component) + append_z[component] = append_z[component] * scale + append_c[component]; tgladDE = tgladDE*fabs(scale)+1.0; ! r2 = z.x * z.x + z.y * z.y + z.z * z.z; ! for(int component = 0; component < append_n; component++) ! r2 += append_z[component] * append_z[component]; ! r = sqrt(r2); break; } diff -r -c /home/jeremy/Downloads/mandelbulber1.12-1/src/fractal.h mandelbulber-modified/src/fractal.h *** /home/jeremy/Downloads/mandelbulber1.12-1/src/fractal.h 2012-06-09 22:22:33.000000000 +0800 --- mandelbulber-modified/src/fractal.h 2012-11-14 12:26:52.153002356 +0800 *************** *** 151,156 **** --- 151,157 ---- double sharpness; double solid; double melt; + double appendVectorComponents[6]; CVector3 offset; sFractalMandelboxVary4D vary4D; }; diff -r -c /home/jeremy/Downloads/mandelbulber1.12-1/src/interface.cpp mandelbulber-modified/src/interface.cpp *** /home/jeremy/Downloads/mandelbulber1.12-1/src/interface.cpp 2012-06-09 22:22:33.000000000 +0800 --- mandelbulber-modified/src/interface.cpp 2012-11-14 12:26:52.053001862 +0800 *************** *** 424,429 **** --- 424,433 ---- params->fractal.mandelbox.doubles.rotation[fold][axis][component] = atofData( gtk_entry_get_text(GTK_ENTRY(Interface.edit_mandelboxRotation[fold][axis][component]))) / 180.0 * M_PI; + for (int component = 0; component < 6; ++component) + params->fractal.mandelbox.doubles.appendVectorComponents[component] = atofData(gtk_entry_get_text(GTK_ENTRY( + Interface.edit_mandelboxAppendVector[component]))); + params->fractal.mandelbox.doubles.colorFactorR = atofData(gtk_entry_get_text(GTK_ENTRY(Interface.edit_mandelboxColorFactorR))); params->fractal.mandelbox.doubles.colorFactorX = atofData(gtk_entry_get_text(GTK_ENTRY(Interface.edit_mandelboxColorFactorX))); params->fractal.mandelbox.doubles.colorFactorY = atofData(gtk_entry_get_text(GTK_ENTRY(Interface.edit_mandelboxColorFactorY))); *************** *** 831,836 **** --- 835,844 ---- gtk_entry_set_text(GTK_ENTRY(Interface.edit_FractalConstantFactor), DoubleToString(params->fractal.doubles.constantFactor)); gtk_entry_set_text(GTK_ENTRY(Interface.edit_FoldingIntPowFoldingFactor), DoubleToString(params->fractal.doubles.FoldingIntPowFoldFactor)); gtk_entry_set_text(GTK_ENTRY(Interface.edit_FoldingIntPowZFactor), DoubleToString(params->fractal.doubles.FoldingIntPowZfactor)); + for(int component = 0; component < 6; ++component) + { + gtk_entry_set_text(GTK_ENTRY(Interface.edit_mandelboxAppendVector[component]), DoubleToString(params->fractal.mandelbox.doubles.appendVectorComponents[component])); + } gtk_entry_set_text(GTK_ENTRY(Interface.edit_volumetricLightMainIntensity), DoubleToString(params->doubles.volumetricLightIntensity[0])); gtk_entry_set_text(GTK_ENTRY(Interface.edit_volumetricLightAux1Intensity), DoubleToString(params->doubles.volumetricLightIntensity[1])); *************** *** 1336,1341 **** --- 1344,1350 ---- Interface.boxMandelboxColor2 = gtk_hbox_new(FALSE, 1); Interface.boxMandelboxColor3 = gtk_hbox_new(FALSE, 1); Interface.boxMandelboxOffset = gtk_hbox_new(FALSE, 1); + Interface.boxMandelboxAppendVector = gtk_hbox_new(FALSE, 1); Interface.boxViewDistance = gtk_hbox_new(FALSE, 1); Interface.boxVolumetricLight = gtk_vbox_new(FALSE, 1); Interface.boxVolumetricLightGeneral = gtk_hbox_new(FALSE, 1); *************** *** 1676,1681 **** --- 1685,1693 ---- Interface.edit_mandelboxVaryScale = gtk_entry_new(); Interface.edit_mandelboxVaryWAdd = gtk_entry_new(); + for(int component = 0; component < 6; ++component) + Interface.edit_mandelboxAppendVector[component] = gtk_entry_new(); + Interface.edit_cadd = gtk_entry_new(); Interface.edit_volumetricFogDensity = gtk_entry_new(); *************** *** 2640,2649 **** gtk_box_pack_start(GTK_BOX(Interface.tab_box_mandelbox), Interface.frMandelboxMainParams, false, false, 1); gtk_container_add(GTK_CONTAINER(Interface.frMandelboxMainParams), Interface.boxMandelboxMainParams); gtk_box_pack_start(GTK_BOX(Interface.boxMandelboxMainParams), Interface.boxMandelboxMainParams1, false, false, 1); ! gtk_box_pack_start(GTK_BOX(Interface.boxMandelboxMainParams1), CreateEdit("2", "Scale", 6, Interface.edit_mandelboxScale), false, false, 1); ! gtk_box_pack_start(GTK_BOX(Interface.boxMandelboxMainParams1), CreateEdit("3,0", "Sharpness", 6, Interface.edit_mandelboxSharpness), false, false, 1); ! gtk_box_pack_start(GTK_BOX(Interface.boxMandelboxMainParams1), CreateEdit("1,0", "Solid", 6, Interface.edit_mandelboxSolid), false, false, 1); ! gtk_box_pack_start(GTK_BOX(Interface.boxMandelboxMainParams1), CreateEdit("0,0", "Melt", 6, Interface.edit_mandelboxMelt), false, false, 1); gtk_box_pack_start(GTK_BOX(Interface.boxMandelboxMainParams), Interface.boxMandelboxMainParams2, false, false, 1); gtk_box_pack_start(GTK_BOX(Interface.boxMandelboxMainParams2), CreateEdit("1", "Folding limit", 6, Interface.edit_mandelboxFoldingLimit), false, false, 1); --- 2652,2661 ---- gtk_box_pack_start(GTK_BOX(Interface.tab_box_mandelbox), Interface.frMandelboxMainParams, false, false, 1); gtk_container_add(GTK_CONTAINER(Interface.frMandelboxMainParams), Interface.boxMandelboxMainParams); gtk_box_pack_start(GTK_BOX(Interface.boxMandelboxMainParams), Interface.boxMandelboxMainParams1, false, false, 1); ! gtk_box_pack_start(GTK_BOX(Interface.boxMandelboxMainParams1), CreateEdit("3", "Scale", 6, Interface.edit_mandelboxScale), false, false, 1); ! gtk_box_pack_start(GTK_BOX(Interface.boxMandelboxMainParams1), CreateEdit("4,0", "Sharpness", 6, Interface.edit_mandelboxSharpness), false, false, 1); ! gtk_box_pack_start(GTK_BOX(Interface.boxMandelboxMainParams1), CreateEdit("2,0", "Solid", 6, Interface.edit_mandelboxSolid), false, false, 1); ! gtk_box_pack_start(GTK_BOX(Interface.boxMandelboxMainParams1), CreateEdit("1,0", "Melt", 6, Interface.edit_mandelboxMelt), false, false, 1); gtk_box_pack_start(GTK_BOX(Interface.boxMandelboxMainParams), Interface.boxMandelboxMainParams2, false, false, 1); gtk_box_pack_start(GTK_BOX(Interface.boxMandelboxMainParams2), CreateEdit("1", "Folding limit", 6, Interface.edit_mandelboxFoldingLimit), false, false, 1); *************** *** 2658,2663 **** --- 2670,2691 ---- gtk_box_pack_start(GTK_BOX(Interface.boxMandelboxOffset), CreateEdit("1", "Z", 6, Interface.edit_mandelboxOffsetZ), false, false, 1); gtk_box_pack_start(GTK_BOX(Interface.boxMandelboxOffset), CreateWidgetWithLabel("GeneralizedFoldBox type", Interface.comboGeneralizedFoldBoxType), false, false, 1); + gtk_box_pack_start(GTK_BOX(Interface.boxMandelboxMainParams), Interface.boxMandelboxAppendVector, false, false, 1); + gtk_box_pack_start(GTK_BOX(Interface.boxMandelboxAppendVector), gtk_label_new("Appended vector components"), false, false, 1); + { + GtkWidget *vbx; + for(int component = 0; component < 6; ++component) + { + if(component % 2 == 0) + { + vbx = gtk_vbox_new(true, 0); + gtk_box_pack_start(GTK_BOX(Interface.boxMandelboxAppendVector), vbx, false, false, 1); + } + gtk_box_pack_start(GTK_BOX(vbx), Interface.edit_mandelboxAppendVector[component], false, false, 1); + //gtk_entry_set_width_chars(GTK_ENTRY(Interface.edit_mandelboxAppendVector), 6); + } + } + gtk_box_pack_start(GTK_BOX(Interface.tab_box_mandelbox), Interface.frMandelboxRotations, false, false, 1); gtk_container_add(GTK_CONTAINER(Interface.frMandelboxRotations), Interface.boxMandelboxRotations); gtk_box_pack_start(GTK_BOX(Interface.boxMandelboxRotations), Interface.boxMandelboxRotationMain, false, false, 1); diff -r -c /home/jeremy/Downloads/mandelbulber1.12-1/src/interface.h mandelbulber-modified/src/interface.h *** /home/jeremy/Downloads/mandelbulber1.12-1/src/interface.h 2012-06-09 22:22:33.000000000 +0800 --- mandelbulber-modified/src/interface.h 2012-11-14 12:26:52.053001862 +0800 *************** *** 195,200 **** --- 195,201 ---- GtkWidget *boxMandelboxColor2; GtkWidget *boxMandelboxColor3; GtkWidget *boxMandelboxOffset; + GtkWidget *boxMandelboxAppendVector; GtkWidget *boxViewDistance; GtkWidget *boxIFSDefaults; GtkWidget *boxVolumetricLight; *************** *** 483,488 **** --- 484,490 ---- GtkWidget *edit_mandelboxOffsetZ; GtkWidget *edit_mandelboxSolid; GtkWidget *edit_mandelboxMelt; + GtkWidget *edit_mandelboxAppendVector[6]; GtkWidget *edit_viewMinDistance; GtkWidget *edit_viewMaxDistance; GtkWidget *edit_FractalConstantFactor; diff -r -c /home/jeremy/Downloads/mandelbulber1.12-1/src/Render3D.cpp mandelbulber-modified/src/Render3D.cpp *** /home/jeremy/Downloads/mandelbulber1.12-1/src/Render3D.cpp 2012-06-09 22:22:33.000000000 +0800 --- mandelbulber-modified/src/Render3D.cpp 2012-11-14 12:26:52.029001746 +0800 *************** *** 352,358 **** //rotate coordinate system from screen to fractal coordinates and perspective projection CVector3 point = Projection3D(CVector3(x2, y, z2), vp, mRot, perspectiveType, fov, zoom); - if (counter == 1) { viewVectorStart = point; --- 352,357 ---- diff -r -c /home/jeremy/Downloads/mandelbulber1.12-1/src/settings.cpp mandelbulber-modified/src/settings.cpp *** /home/jeremy/Downloads/mandelbulber1.12-1/src/settings.cpp 2012-06-09 22:22:33.000000000 +0800 --- mandelbulber-modified/src/settings.cpp 2012-11-14 12:26:52.113002163 +0800 *************** *** 364,370 **** fprintfDot(fileSettings, "mandelbox_offset_X", params.fractal.mandelbox.doubles.offset.x, 0.0, compare); fprintfDot(fileSettings, "mandelbox_offset_Y", params.fractal.mandelbox.doubles.offset.y, 0.0, compare); fprintfDot(fileSettings, "mandelbox_offset_Z", params.fractal.mandelbox.doubles.offset.z, 0.0, compare); - for (int component = 0; component < 3; ++component) { sprintf(parameterName, "mandelbox_rotation_main_%s", component_names[component]); --- 364,369 ---- *************** *** 390,395 **** --- 389,402 ---- fprintfDot(fileSettings, "mandelbox_solid", params.fractal.mandelbox.doubles.solid, 1.0, compare); fprintfDot(fileSettings, "mandelbox_melt", params.fractal.mandelbox.doubles.melt, 0.0, compare); } + if(!compare || params.fractal.formula == tglad) + { + for(int component = 0; component < 6; ++component) + { + sprintf(parameterName, "mandelbox_append_vector%d", component + 1); + fprintfDot(fileSettings, parameterName, params.fractal.mandelbox.doubles.appendVectorComponents[component], 0.0, compare); + } + } fprintfDot(fileSettings, "view_distance_max", params.doubles.viewDistanceMax, 50, compare); fprintfDot(fileSettings, "view_distance_min", params.doubles.viewDistanceMin, 1e-15, compare); *************** *** 889,894 **** --- 897,908 ---- else if (!strcmp(str1, "mandelbox_fold_mode")) params.fractal.genFoldBox.type = (enumGeneralizedFoldBoxType)atoi(str2); else if (!strcmp(str1, "mandelbox_solid")) params.fractal.mandelbox.doubles.solid = atof2(str2); else if (!strcmp(str1, "mandelbox_melt")) params.fractal.mandelbox.doubles.melt = atof2(str2); + else if (!strcmp(str1, "mandelbox_append_vector1")) params.fractal.mandelbox.doubles.appendVectorComponents[0] = atof2(str2); + else if (!strcmp(str1, "mandelbox_append_vector2")) params.fractal.mandelbox.doubles.appendVectorComponents[1] = atof2(str2); + else if (!strcmp(str1, "mandelbox_append_vector3")) params.fractal.mandelbox.doubles.appendVectorComponents[2] = atof2(str2); + else if (!strcmp(str1, "mandelbox_append_vector4")) params.fractal.mandelbox.doubles.appendVectorComponents[3] = atof2(str2); + else if (!strcmp(str1, "mandelbox_append_vector5")) params.fractal.mandelbox.doubles.appendVectorComponents[4] = atof2(str2); + else if (!strcmp(str1, "mandelbox_append_vector6")) params.fractal.mandelbox.doubles.appendVectorComponents[5] = atof2(str2); else if (!strcmp(str1, "view_distance_max")) params.doubles.viewDistanceMax = atof2(str2); else if (!strcmp(str1, "view_distance_min")) params.doubles.viewDistanceMin = atof2(str2);