jwildfire.org

The official JWildfire forum
It is currently Thu Sep 19, 2019 2:11 pm

All times are UTC+01:00




Post new topic  Reply to topic  [ 3 posts ] 
Author Message
 Post subject: dc_carpet3D
PostPosted: Wed Feb 20, 2019 9:08 pm 
Offline
User avatar

Joined: Sun May 31, 2015 2:39 pm
Posts: 604
Added variables to dc_carpet to make it work very well with 3D/solid flames. Make sure you have preserveZ enabled and change pitch.

Example image:

Image

simple solid flame:
Code:
<flame smooth_gradient="0" version="JWildfire V4.00 revision 2 (20.12.2018)" size="1080 1080" center="0.006091741628931735 -0.423376043210754" scale="434.1215181261745" rotate="0.0" filter="0.5" filter_type="GLOBAL_SMOOTHING" filter_kernel="GAUSSIAN" filter_indicator="0" filter_sharpness="4.0" filter_low_density="0.025" oversample="2" post_noise_filter="0" post_noise_filter_threshold="0.35" quality="10.0" background_type="GRADIENT_2X2_C" background_ul="0.0 0.0 0.0" background_ur="0.0 0.0 0.0" background_ll="0.0 0.0 0.0" background_lr="0.0 0.0 0.0" background_cc="0.0 0.0 0.0" bg_transparency="0" brightness="4.0" saturation="1.0" gamma="4.0" gamma_threshold="0.01" vibrancy="1.0" contrast="1.0" white_level="220.0" temporal_samples="1.0" cam_zoom="1.0" cam_pitch="0.5794493116621174" cam_yaw="0.0" cam_persp="0.0" cam_xfocus="0.0" cam_yfocus="0.0" cam_zfocus="0.0" cam_pos_x="0.0" cam_pos_y="0.0" cam_pos_z="0.0" cam_zpos="0.0" cam_dof="0.0" cam_dof_area="0.5" cam_dof_exponent="2.0" low_density_brightness="0.24" balancing_red="1.0" balancing_green="1.0" balancing_blue="1.0" cam_dof_shape="BUBBLE" cam_dof_scale="1.0" cam_dof_rotate="0.0" cam_dof_fade="1.0" preserve_z="1" antialias_amount="0.0" antialias_radius="0.0" post_symmetry_type="NONE" post_symmetry_order="3" post_symmetry_centre_x="0.0" post_symmetry_centre_y="0.0" post_symmetry_distance="1.25" post_symmetry_rotation="6.0" frame="1" frame_count="300" fps="30" post_blur_radius="0" post_blur_fade="0.95" post_blur_falloff="2.0" zbuffer_scale="1.0" sld_render_enabled="1" sld_render_ao_enabled="1" sld_render_ao_intensity="0.6" sld_render_ao_search_radius="4.0" sld_render_ao_blur_radius="1.5" sld_render_ao_radius_samples="6" sld_render_ao_azimuth_samples="7" sld_render_ao_falloff="0.5" sld_render_ao_affect_diffuse="0.1" sld_render_shadow_type="FAST" sld_render_shadow_smooth_radius="1.0" sld_render_shadowmap_size="2048" sld_render_shadowmap_bias="0.01" post_bokeh_filter_kernel="SINEPOW15" post_bokeh_intensity="0.005" post_bokeh_brightness="1.0" post_bokeh_size="2.0" post_bokeh_activation="0.2" sld_render_material_count="2" sld_render_material_diffuse0="0.14" sld_render_material_ambient0="1.52" sld_render_material_phong0="0.0634" sld_render_material_phong_size0="12.0" sld_render_material_phong_red0="1.0" sld_render_material_phong_green0="1.0" sld_render_material_phong_blue0="1.0" sld_render_material_refl_map_intensity0="0.5" sld_render_material_refl_map_filename0="" sld_render_material_refl_mappping0="BLINN_NEWELL" sld_render_material_light_diif_func0="COSA_SQUARE" sld_render_material_diffuse1="0.1" sld_render_material_ambient1="1.0" sld_render_material_phong1="0.6" sld_render_material_phong_size1="15.0" sld_render_material_phong_red1="1.0" sld_render_material_phong_green1="1.0" sld_render_material_phong_blue1="1.0" sld_render_material_refl_map_intensity1="0.5" sld_render_material_refl_map_filename1="" sld_render_material_refl_mappping1="BLINN_NEWELL" sld_render_material_light_diif_func1="COSA" sld_render_ligtht_count="2" sld_render_light_altitude0="146.6666" sld_render_light_azimuth0="-10.41247303" sld_render_light_intensity0="1.0" sld_render_light_red0="1.0" sld_render_light_green0="1.0" sld_render_light_blue0="1.0" sld_render_light_shadows0="1" sld_render_light_shadow_intensity0="1.0" sld_render_light_altitude1="55.0" sld_render_light_azimuth1="-15.0" sld_render_light_intensity1="0.5" sld_render_light_red1="1.0" sld_render_light_green1="1.0" sld_render_light_blue1="1.0" sld_render_light_shadows1="0" sld_render_light_shadow_intensity1="0.7" mixer_mode="OFF">
  <xform weight="0.5" color="0.47567276071837483" symmetry="0.26374804781838335" mirror_pre_post_translations="0" material="0.0" material_speed="0.0" mod_gamma="0.0" mod_gamma_speed="0.0" mod_contrast="0.0" mod_contrast_speed="0.0" mod_saturation="0.0" mod_saturation_speed="0.0" mod_hue="0.0" mod_hue_speed="0.0" opacity="0.0" custom_wf_full="0.5" custom_wf_full_fx_priority="0" custom_wf_full_origin="0.5" custom_wf_full_color_a="0.5" custom_wf_full_color_b="1.0" custom_wf_full_color_c="1.0" custom_wf_full_color_d="1.0" custom_wf_full_color_e="0.5" custom_wf_full_color_f="1.0" custom_wf_full_stretch_x="1.0" custom_wf_full_stretch_y="1.0" custom_wf_full_scale_x="1.0" custom_wf_full_scale_y="1.0" custom_wf_full_scale_z="1.0" custom_wf_full_offset_z="0.0" custom_wf_full_reset_z="0.0" custom_wf_full_code_full_variation="2F2A0A20204A57696C6466697265202D20616E20696D61676520616E6420616E696D6174696F6E2070726F636573736F72207772697474656E20696E204A617661200A2020436F707972696768742028432920313939352D3230313120416E6472656173204D617363686B650A0A202054686973206973206672656520736F6674776172653B20796F752063616E2072656469737472696275746520697420616E642F6F72206D6F6469667920697420756E64657220746865207465726D73206F662074686520474E55204C6573736572200A202047656E6572616C205075626C6963204C6963656E7365206173207075626C697368656420627920746865204672656520536F66747761726520466F756E646174696F6E3B206569746865722076657273696F6E20322E31206F6620746865200A20204C6963656E73652C206F722028617420796F7572206F7074696F6E2920616E79206C617465722076657273696F6E2E0A200A20205468697320736F66747761726520697320646973747269627574656420696E2074686520686F706520746861742069742077696C6C2062652075736566756C2C2062757420574954484F555420414E592057415252414E54593B20776974686F7574200A20206576656E2074686520696D706C6965642077617272616E7479206F66204D45524348414E544142494C495459206F72204649544E45535320464F52204120504152544943554C415220505552504F53452E205365652074686520474E55200A20204C65737365722047656E6572616C205075626C6963204C6963656E736520666F72206D6F72652064657461696C732E0A0A2020596F752073686F756C642068617665207265636569766564206120636F7079206F662074686520474E55204C65737365722047656E6572616C205075626C6963204C6963656E736520616C6F6E672077697468207468697320736F6674776172653B200A20206966206E6F742C20777269746520746F20746865204672656520536F66747761726520466F756E646174696F6E2C20496E632E2C203531204672616E6B6C696E2053742C20466966746820466C6F6F722C20426F73746F6E2C204D410A202030323131302D31333031205553412C206F7220736565207468652046534620736974653A20687474703A2F2F7777772E6673662E6F72672E0A2A2F0A7061636B616765206F72672E6A77696C64666972652E6372656174652E74696E612E766172696174696F6E3B0A0A696D706F727420737461746963206F72672E6A77696C64666972652E626173652E6D6174686C69622E4D6174684C69622E666162733B0A696D706F727420737461746963206F72672E6A77696C64666972652E626173652E6D6174686C69622E4D6174684C69622E666D6F643B0A0A696D706F7274206F72672E6A77696C64666972652E6372656174652E74696E612E626173652E4C617965723B0A696D706F7274206F72672E6A77696C64666972652E6372656174652E74696E612E626173652E58466F726D3B0A696D706F7274206F72672E6A77696C64666972652E6372656174652E74696E612E626173652E58595A506F696E743B0A0A7075626C696320636C617373204443436172706574334446756E6320657874656E647320566172696174696F6E46756E63207B0A0970726976617465207374617469632066696E616C206C6F6E672073657269616C56657273696F6E554944203D20314C3B0A0A0970726976617465207374617469632066696E616C20537472696E6720504152414D5F4F524947494E203D20226F726967696E223B0A0970726976617465207374617469632066696E616C20537472696E6720504152414D5F434F4C4F525F41203D2022636F6C6F725F61223B0A0970726976617465207374617469632066696E616C20537472696E6720504152414D5F434F4C4F525F42203D2022636F6C6F725F62223B0A0970726976617465207374617469632066696E616C20537472696E6720504152414D5F434F4C4F525F43203D2022636F6C6F725F63223B0A0970726976617465207374617469632066696E616C20537472696E6720504152414D5F434F4C4F525F44203D2022636F6C6F725F64223B0A0970726976617465207374617469632066696E616C20537472696E6720504152414D5F434F4C4F525F45203D2022636F6C6F725F65223B0A0970726976617465207374617469632066696E616C20537472696E6720504152414D5F434F4C4F525F46203D2022636F6C6F725F66223B0A0970726976617465207374617469632066696E616C20537472696E6720504152414D5F535452455443485F58203D2022737472657463685F78223B0A0970726976617465207374617469632066696E616C20537472696E6720504152414D5F535452455443485F59203D2022737472657463685F79223B0A0970726976617465207374617469632066696E616C20537472696E6720504152414D5F5343414C455F58203D20227363616C655F78223B0A0970726976617465207374617469632066696E616C20537472696E6720504152414D5F5343414C455F59203D20227363616C655F79223B0A0970726976617465207374617469632066696E616C20537472696E6720504152414D5F5343414C455A203D20227363616C655F7A223B0A0970726976617465207374617469632066696E616C20537472696E6720504152414D5F4F46465345545A203D20226F66667365745F7A223B0A0970726976617465207374617469632066696E616C20537472696E6720504152414D5F52455345545A203D202272657365745F7A223B0A0A0970726976617465207374617469632066696E616C20537472696E675B5D20706172616D4E616D6573203D207B20504152414D5F4F524947494E2C20504152414D5F434F4C4F525F412C20504152414D5F434F4C4F525F422C20504152414D5F434F4C4F525F432C0A090909504152414D5F434F4C4F525F442C20504152414D5F434F4C4F525F452C20504152414D5F434F4C4F525F462C20504152414D5F535452455443485F582C20504152414D5F535452455443485F592C20504152414D5F5343414C455F582C20504152414D5F5343414C455F592C0A090909504152414D5F5343414C455A2C20504152414D5F4F46465345545A2C20504152414D5F52455345545A207D3B0A097072697661746520646F75626C65206F726967696E203D20302E353B0A097072697661746520646F75626C6520636F6C6F725F61203D20302E353B0A097072697661746520646F75626C6520636F6C6F725F62203D20312E303B0A097072697661746520646F75626C6520636F6C6F725F63203D20312E303B0A097072697661746520646F75626C6520636F6C6F725F64203D20312E303B0A097072697661746520646F75626C6520636F6C6F725F65203D20302E353B0A097072697661746520646F75626C6520636F6C6F725F66203D20312E303B0A097072697661746520646F75626C6520737472657463685F78203D20312E303B0A097072697661746520646F75626C6520737472657463685F79203D20312E303B0A097072697661746520646F75626C65207363616C655F78203D20312E303B0A097072697661746520646F75626C65207363616C655F79203D20312E303B0A097072697661746520646F75626C65207363616C655F7A203D20312E303B0A097072697661746520646F75626C65206F66667365745F7A203D20302E303B0A097072697661746520646F75626C652072657365745F7A203D20302E303B0A0A09404F766572726964650A097075626C696320766F6964207472616E73666F726D28466C616D655472616E73666F726D6174696F6E436F6E746578742070436F6E746578742C2058466F726D207058466F726D2C2058595A506F696E742070416666696E6554502C2058595A506F696E74207056617254502C0A090909646F75626C652070416D6F756E7429207B0A09092F2A0A0909202A2064635F63617270657420627920587972757330322C20687474703A2F2F61706F7068797369732D37782E6F72672F657874656E73696F6E73206164646564207661726961626C65732062790A0909202A20427261642053746566616E6F760A0909202A2F0A0909696E74207830203D202870436F6E746578742E72616E646F6D2829203C20302E3529203F202D31203A20313B0A0909696E74207930203D202870436F6E746578742E72616E646F6D2829203E20302E3529203F202D31203A20313B0A0A0909646F75626C652078203D2070416666696E6554502E78202B207830202A20737472657463685F782C2079203D2070416666696E6554502E79202B207930202A20737472657463685F793B0A0909646F75626C652078305F786F725F7930203D2028646F75626C652920287830205E207930293B0A0909646F75626C65206868203D202D48202B2028636F6C6F725F62202D2078305F786F725F793029202A20483B0A0A09097056617254502E78202B3D2070416D6F756E74202A20287058466F726D2E6765745859436F65666630302829202A2078202B207058466F726D2E6765745859436F65666631302829202A2079202B207058466F726D2E6765745859436F6566663230282929202A207363616C655F783B0A09097056617254502E79202B3D2070416D6F756E74202A20287058466F726D2E6765745859436F65666630312829202A2078202B207058466F726D2E6765745859436F65666631312829202A2079202B207058466F726D2E6765745859436F6566663231282929202A207363616C655F793B0A09097056617254502E636F6C6F72203D20666D6F642866616273287056617254502E636F6C6F72202A20636F6C6F725F61202A2028636F6C6F725F63202B20686829202B2078305F786F725F7930202A2028636F6C6F725F64202D20686829202A20636F6C6F725F65292C0A09090909636F6C6F725F66293B0A0A09096966202870436F6E746578742E697350726573657276655A436F6F7264696E617465282929207B0A0909097056617254502E7A202B3D2070416D6F756E74202A2070416666696E6554502E7A3B0A09097D0A0909646F75626C6520647A203D207056617254502E636F6C6F72202A207363616C655F7A202B206F66667365745F7A3B0A09096966202872657365745F7A203E203029207B0A0909097056617254502E7A203D20647A3B0A09097D20656C7365207B0A0909097056617254502E7A202B3D20647A3B0A09097D0A097D0A0A09404F766572726964650A097075626C696320537472696E675B5D20676574506172616D657465724E616D65732829207B0A090972657475726E20706172616D4E616D65733B0A097D0A0A09404F766572726964650A097075626C6963204F626A6563745B5D20676574506172616D6574657256616C7565732829207B0A090972657475726E206E6577204F626A6563745B5D207B206F726967696E2C20636F6C6F725F612C20636F6C6F725F622C20636F6C6F725F632C20636F6C6F725F642C20636F6C6F725F652C20636F6C6F725F662C20737472657463685F782C20737472657463685F792C0A090909097363616C655F782C207363616C655F792C207363616C655F7A2C206F66667365745F7A2C2072657365745F7A207D3B0A097D0A0A09404F766572726964650A097075626C696320766F696420736574506172616D6574657228537472696E6720704E616D652C20646F75626C65207056616C756529207B0A090969662028504152414D5F4F524947494E2E657175616C7349676E6F72654361736528704E616D652929207B0A0909096F726967696E203D207056616C75653B0A09097D20656C73652069662028504152414D5F434F4C4F525F412E657175616C7349676E6F72654361736528704E616D652929207B0A090909636F6C6F725F61203D207056616C75653B0A09097D20656C73652069662028504152414D5F434F4C4F525F422E657175616C7349676E6F72654361736528704E616D652929207B0A090909636F6C6F725F62203D207056616C75653B0A09097D20656C73652069662028504152414D5F434F4C4F525F432E657175616C7349676E6F72654361736528704E616D652929207B0A090909636F6C6F725F63203D207056616C75653B0A09097D20656C73652069662028504152414D5F434F4C4F525F442E657175616C7349676E6F72654361736528704E616D652929207B0A090909636F6C6F725F64203D207056616C75653B0A09097D20656C73652069662028504152414D5F434F4C4F525F452E657175616C7349676E6F72654361736528704E616D652929207B0A090909636F6C6F725F65203D207056616C75653B0A09097D20656C73652069662028504152414D5F434F4C4F525F462E657175616C7349676E6F72654361736528704E616D652929207B0A090909636F6C6F725F66203D207056616C75653B0A09097D20656C73652069662028504152414D5F535452455443485F582E657175616C7349676E6F72654361736528704E616D652929207B0A090909737472657463685F78203D207056616C75653B0A09097D20656C73652069662028504152414D5F535452455443485F592E657175616C7349676E6F72654361736528704E616D652929207B0A090909737472657463685F79203D207056616C75653B0A09097D20656C73652069662028504152414D5F5343414C455F582E657175616C7349676E6F72654361736528704E616D652929207B0A0909097363616C655F78203D207056616C75653B0A09097D20656C73652069662028504152414D5F5343414C455F592E657175616C7349676E6F72654361736528704E616D652929207B0A0909097363616C655F79203D207056616C75653B0A09097D20656C73652069662028504152414D5F5343414C455A2E657175616C7349676E6F72654361736528704E616D6529290A0909097363616C655F7A203D207056616C75653B0A0909656C73652069662028504152414D5F4F46465345545A2E657175616C7349676E6F72654361736528704E616D6529290A0909096F66667365745F7A203D207056616C75653B0A0909656C73652069662028504152414D5F52455345545A2E657175616C7349676E6F72654361736528704E616D6529290A09090972657365745F7A203D207056616C75653B0A0909656C7365207B0A09090953797374656D2E6F75742E7072696E746C6E2822704E616D65206E6F74207265636F676E697A65643A2022202B20704E616D65293B0A0909097468726F77206E657720496C6C6567616C417267756D656E74457863657074696F6E28704E616D65293B0A09097D0A097D0A0A09404F766572726964650A097075626C696320537472696E67206765744E616D652829207B0A090972657475726E202264635F6361727065743344223B0A097D0A0A097072697661746520646F75626C6520483B0A0A09404F766572726964650A097075626C696320766F696420696E697428466C616D655472616E73666F726D6174696F6E436F6E746578742070436F6E746578742C204C6179657220704C617965722C2058466F726D207058466F726D2C20646F75626C652070416D6F756E7429207B0A090948203D20302E31202A206F726967696E3B0A0A097D0A0A7D" coefs="1.0 0.0 0.0 1.0 0.0 0.0" chaos="0.0 1.0"/>
  <xform weight="0.5" color="0.0" symmetry="1.0" mirror_pre_post_translations="0" material="0.0" material_speed="0.0" mod_gamma="0.0" mod_gamma_speed="0.0" mod_contrast="0.0" mod_contrast_speed="0.0" mod_saturation="0.0" mod_saturation_speed="0.0" mod_hue="0.0" mod_hue_speed="0.0" mobiq="1.0" mobiq_fx_priority="0" mobiq_qat="1.0" mobiq_qax="0.0" mobiq_qay="0.0" mobiq_qaz="0.0" mobiq_qbt="0.0" mobiq_qbx="0.0" mobiq_qby="0.0" mobiq_qbz="0.0" mobiq_qct="0.0" mobiq_qcx="0.0" mobiq_qcy="0.0" mobiq_qcz="0.0" mobiq_qdt="1.0" mobiq_qdx="0.0" mobiq_qdy="0.0" mobiq_qdz="0.0" coefs="1.0 0.0 0.0 1.0 0.0 0.0" chaos="1.0 0.0"/>
  <palette count="256" format="RGB">
D95E32CF6A40A5938F9F9FA098AAB68DA2B27196B34E95BD3C8FC21866A63879AE669EC3
6FA4BF94B6C0B9C5C5D2D4C6E4E2C9EEEACEEACFB1DECDABD5C2A2C9BA9FAB9E98988879
926F5D712D206321146616006418006726106D2F146B351C3E3C5443405C30548E4579AC
679BC380A8BA9EC0C2B3C4CBB4C3C8B0C3C1A6C2C288B1CF72A6CB76A3C48BA5B990A7B0
9E9F97A29684B35D3CB05432AB562FAD5A30B06F4F9C9899A5A6A3A7C0BDADBFBFABB2AB
B2ABA2ADA187B76454B55746A7472FA6492EA1472F9B492C9B452A974424964726864B2D
86492E8E4326943F269A43279F452AA0502BAA5F37AE7651ACA092B3A4A1B2B2A8B7B5A9
B7ADA3C1B1A2C5B29CCAAB8FC48763B55837AE4D2CA1341DA13217A93719BF451EBE4623
B5462AB8532FC36B43C57855C3AD98CCBCA5C2BDB1B9C2C1BDC6C5BEC8C0C6CCBFC8C7B2
CCC8ABD4C9A8D9C2A3D2C3A4CEC3ADB3B1A592969774787B77656F81493273412A632F17
642A1A56230E5A1C11460400371B1A3E1F1E672519702613772A166D2F206240364B485C
50506A7D4F387D49347B452D6F3E276A32317139238B432DA0502BB15C37BDA394BAB1A4
BBBBAFB4C2B8B8C3BFC5C9BBCFCCBDE5CAACE6CCA9ECCEA8EFDBAFF5E9B7F0EAB8E4DAB1
C9B197D68C68ED703ADD7041CBB190E0C09DE0CE9EDDC69DD6C0A0B0B7AF9AABB77997B3
7595B4678AAA5C88AB5B87AA65758E687186763F3C7B382C854023853427892B1D7D2414
70241A3E3D650F43990248A8005AAF2556983B5169455573546287687B9E909694B18174
D86C46CE6840D56237C14B1DA4340F6913025E05006607007924018425089C33169F3E1B
A44C24A24E29A75025AA4E20AF5322AE5B2FB66238AC9585B0A493C1B5A5CAC0B6CDCCBA
C8CEC0C3CBC3BCC7C3B5C1BEA5AFB09EA29D958C87AA6354BC643CCC5C36C95C31BF5229
BB5026B74D26B74B25B14922AD4C21AB4923B04123AF3D1FB13917B13A18AA4519A24C2A
A04E2FA96B549C87819D97A19C9AAA9392A296868FA160429249298A42227F3A1D89391E
8C352499452EAA6043A89284  </palette>
</flame>
Custom_wf_full code
Code:
/*
  JWildfire - an image and animation processor written in Java 
  Copyright (C) 1995-2011 Andreas Maschke

  This is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 
  General Public License as published by the Free Software Foundation; either version 2.1 of the 
  License, or (at your option) any later version.
 
  This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without 
  even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 
  Lesser General Public License for more details.

  You should have received a copy of the GNU Lesser General Public License along with this software; 
  if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
package org.jwildfire.create.tina.variation;

import static org.jwildfire.base.mathlib.MathLib.fabs;
import static org.jwildfire.base.mathlib.MathLib.fmod;

import org.jwildfire.create.tina.base.Layer;
import org.jwildfire.create.tina.base.XForm;
import org.jwildfire.create.tina.base.XYZPoint;

public class DCCarpet3DFunc extends VariationFunc {
	private static final long serialVersionUID = 1L;

	private static final String PARAM_ORIGIN = "origin";
	private static final String PARAM_COLOR_A = "color_a";
	private static final String PARAM_COLOR_B = "color_b";
	private static final String PARAM_COLOR_C = "color_c";
	private static final String PARAM_COLOR_D = "color_d";
	private static final String PARAM_COLOR_E = "color_e";
	private static final String PARAM_COLOR_F = "color_f";
	private static final String PARAM_STRETCH_X = "stretch_x";
	private static final String PARAM_STRETCH_Y = "stretch_y";
	private static final String PARAM_SCALE_X = "scale_x";
	private static final String PARAM_SCALE_Y = "scale_y";
	private static final String PARAM_SCALEZ = "scale_z";
	private static final String PARAM_OFFSETZ = "offset_z";
	private static final String PARAM_RESETZ = "reset_z";

	private static final String[] paramNames = { PARAM_ORIGIN, PARAM_COLOR_A, PARAM_COLOR_B, PARAM_COLOR_C,
			PARAM_COLOR_D, PARAM_COLOR_E, PARAM_COLOR_F, PARAM_STRETCH_X, PARAM_STRETCH_Y, PARAM_SCALE_X, PARAM_SCALE_Y,
			PARAM_SCALEZ, PARAM_OFFSETZ, PARAM_RESETZ };
	private double origin = 0.5;
	private double color_a = 0.5;
	private double color_b = 1.0;
	private double color_c = 1.0;
	private double color_d = 1.0;
	private double color_e = 0.5;
	private double color_f = 1.0;
	private double stretch_x = 1.0;
	private double stretch_y = 1.0;
	private double scale_x = 1.0;
	private double scale_y = 1.0;
	private double scale_z = 1.0;
	private double offset_z = 0.0;
	private double reset_z = 0.0;

	@Override
	public void transform(FlameTransformationContext pContext, XForm pXForm, XYZPoint pAffineTP, XYZPoint pVarTP,
			double pAmount) {
		/*
		 * dc_carpet by Xyrus02, http://apophysis-7x.org/extensions added variables by
		 * Brad Stefanov
		 */
		int x0 = (pContext.random() < 0.5) ? -1 : 1;
		int y0 = (pContext.random() > 0.5) ? -1 : 1;

		double x = pAffineTP.x + x0 * stretch_x, y = pAffineTP.y + y0 * stretch_y;
		double x0_xor_y0 = (double) (x0 ^ y0);
		double hh = -H + (color_b - x0_xor_y0) * H;

		pVarTP.x += pAmount * (pXForm.getXYCoeff00() * x + pXForm.getXYCoeff10() * y + pXForm.getXYCoeff20()) * scale_x;
		pVarTP.y += pAmount * (pXForm.getXYCoeff01() * x + pXForm.getXYCoeff11() * y + pXForm.getXYCoeff21()) * scale_y;
		pVarTP.color = fmod(fabs(pVarTP.color * color_a * (color_c + hh) + x0_xor_y0 * (color_d - hh) * color_e),
				color_f);

		if (pContext.isPreserveZCoordinate()) {
			pVarTP.z += pAmount * pAffineTP.z;
		}
		double dz = pVarTP.color * scale_z + offset_z;
		if (reset_z > 0) {
			pVarTP.z = dz;
		} else {
			pVarTP.z += dz;
		}
	}

	@Override
	public String[] getParameterNames() {
		return paramNames;
	}

	@Override
	public Object[] getParameterValues() {
		return new Object[] { origin, color_a, color_b, color_c, color_d, color_e, color_f, stretch_x, stretch_y,
				scale_x, scale_y, scale_z, offset_z, reset_z };
	}

	@Override
	public void setParameter(String pName, double pValue) {
		if (PARAM_ORIGIN.equalsIgnoreCase(pName)) {
			origin = pValue;
		} else if (PARAM_COLOR_A.equalsIgnoreCase(pName)) {
			color_a = pValue;
		} else if (PARAM_COLOR_B.equalsIgnoreCase(pName)) {
			color_b = pValue;
		} else if (PARAM_COLOR_C.equalsIgnoreCase(pName)) {
			color_c = pValue;
		} else if (PARAM_COLOR_D.equalsIgnoreCase(pName)) {
			color_d = pValue;
		} else if (PARAM_COLOR_E.equalsIgnoreCase(pName)) {
			color_e = pValue;
		} else if (PARAM_COLOR_F.equalsIgnoreCase(pName)) {
			color_f = pValue;
		} else if (PARAM_STRETCH_X.equalsIgnoreCase(pName)) {
			stretch_x = pValue;
		} else if (PARAM_STRETCH_Y.equalsIgnoreCase(pName)) {
			stretch_y = pValue;
		} else if (PARAM_SCALE_X.equalsIgnoreCase(pName)) {
			scale_x = pValue;
		} else if (PARAM_SCALE_Y.equalsIgnoreCase(pName)) {
			scale_y = pValue;
		} else if (PARAM_SCALEZ.equalsIgnoreCase(pName))
			scale_z = pValue;
		else if (PARAM_OFFSETZ.equalsIgnoreCase(pName))
			offset_z = pValue;
		else if (PARAM_RESETZ.equalsIgnoreCase(pName))
			reset_z = pValue;
		else {
			System.out.println("pName not recognized: " + pName);
			throw new IllegalArgumentException(pName);
		}
	}

	@Override
	public String getName() {
		return "dc_carpet3D";
	}

	private double H;

	@Override
	public void init(FlameTransformationContext pContext, Layer pLayer, XForm pXForm, double pAmount) {
		H = 0.1 * origin;

	}

}


You do not have the required permissions to view the files attached to this post.


Top
   
 Post subject: Re: dc_carpet3D
PostPosted: Wed Feb 20, 2019 9:51 pm 
Offline
User avatar

Joined: Thu May 16, 2013 1:05 am
Posts: 487
Location: Vancouver,BC Canada
Thanks m8


Top
   
 Post subject: Re: dc_carpet3D
PostPosted: Thu Feb 21, 2019 4:40 am 
Offline
User avatar

Joined: Mon Jun 08, 2015 4:40 am
Posts: 307
Thanks.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 3 posts ] 

All times are UTC+01:00


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited
Theme Created by HOLLYSMOKE
Theme updated to phpBB 3.1.6 by KamijouTouma
Theme Version is 3.1.6-ss2