--mettre au point le fait que j'ai separe denting et checkering voir blublu pas au point --c est melangé Mais deja a ester avec mes choix Pareil avec f_wrinkles qui manque rap a geolandscape_04 --pour cela voir blabla P33 semble inuitl -- j en suis a ridged voir lalalalalalalalalalala --apparement dent et checkering vont ensemble voir probléme --apparement ridged est trjs en fonction par defaut comme ds geoland 04 --n occuper des predefs il y a un melange ds la liste qui ne correspond pas resolu ok --j'en suis au predef 2 qui est en realite le 5 Pffff resolu ok --je ne devrais pas retrouver les patterns textedditt ds le secteur des predef A verifier landscape_gene={} function landscape_gene:init() self.func="cos(d*3)" --pattern1 predef self.textL="turbulence <0.1, 0.9, 0.3>// octaves 1 omega 0.5 lambda 0.5"--pour self.textM="scale<0.05,0.05,0.05>"--pour self.textN="rotate<0,0,0>"--pour self.aaa=0.3 --je ne sais plus self.ccc=1 -- force pattern --pattern2 predef self.textO="turbulence <0.1, 0.9, 0.3>// octaves 1 omega 0.5 lambda 0.5"--pour self.textP="scale<0.7,0.7,0.7>"--pour self.textQ="rotate<0,0,0>"--pour self.bbb=1 --je ne sais plus self.ddd=1 --force pattern 2 self.zezeze=0 --threshold self.zfzfzf=0.001--accuracy self.eee=6 --turbu octave self.iii=0.5 --omega self.jjj=2 --lambda self.kkk=1 --definition self.lll=10 --size X self.mmm=10 --size Z --my choice de pattern self.textA="leopard" self.textR="turbulence <1, 0.9, 0.3> octaves 1 omega 0.5 lambda 0.5"--pour self.textS="scale<1,1,1>rotate<0,0,0>"--pour self.textB="crackle" self.textT="turbulence <1, 0.9, 0.3> octaves 1 omega 0.5 lambda 0.5"--pour self.textU="scale<1,1,1>rotate<0,0,0>"--pour --denting self.nnn=0--Denting self.textH="turbulence <1, 0.9, 0.3> octaves 1 omega 0.5 lambda 0.5"--pour self.textI="scale<0.5,0.5,0.5>"--pour self.textJ="rotate<0,0,0>"--pour --checkering self.ooo=0--Checkering self.textD="turbulence <1, 0.9, 0.3> octaves 1 omega 0.5 lambda 0.5" self.textC="scale<0.1,0.1,0.1>" self.textK="rotate<0,0,0>"--pour --F_ridged_mf self.sss=0.1 --H self.ttt=10 --lacunarity self.uuu=3 --gustave self.vvv=0.6 --offset self.www=1.2 --gain self.xxx=2 --generator --noise self.zzz=0 --noise --wrinkle self.zazaza=3 --Wrinkling = 5 self.textE="turbulence<2,0.9,0.9> octaves 5 omega 0.5 lambda 2"--pour wturb self.textF="scale<1,1,1>"--pour wscale self.textG="rotate<0,0,0>"--pour wrotate --suite rab de frittes self.zgzgzg=1 self.zhzhzh=1 self.zizizi=1 self.zjzjzj=1 self.zkzkzk=1 self.zlzlzl=1 self.zmzmzm=1 self.znznzn=1 self.zozozo=1 self.zpzpzp=1 -- 2 list box à 3 posibilités l autre à 5 mais + si besoin Attention cela marche par ordre alphabétique. self.lilistboxx=1 --list box A pour les types de Lands self.liboxx=1 --list box B --6 checkbox self.blibli=nil--pour oui 1 pour non nil self.bloblo=nil--pour non self.bleble=nil--pour oui self.blublu=nil--pour non self.blabla=nil--pour non self.blrblr=nil--pour non -- 4 boutons ne marchent qu'en va et vient par grpoe de 2 self.bouta=nil--pour non va et vient self.boutb=1--pour oui self.boutc=1--pour oui self.boutd=nil--pour non -- textEdit self.textV=""--pour --les annulation ou changements self.zbzbzb=0 --Wturb = <0.1, 0.5, 0.3>--inutil self.zczczc=1 --Wscale = <0.5, 0.1, 0.1>--inutil self.zdzdzd=0 --Wrotate = <0, 45, 0>--inutil self.ppp=0--rot denting X --inuti self.qqq=0--rot denting y --inuti self.rrr=0--rot denting Z --inuti self.yyy=1--denteringscale Dscale --inuti self.fff=0.7 --scale x inutil self.ggg=0.7 -- y inutil self.hhh=0.7 -- z inutil --ici 6 possibilités de textures mais + si besoin self.texture="" self.t222=""-- self.t333=""-- self.t444=""-- self.t555=""-- self.t666=""-- end function landscape_gene:destroy() end function landscape_gene:load(stream) stream:readByte() self.func=stream:readString() self.aaa=stream:readDouble() self.bbb=stream:readDouble() self.ccc=stream:readDouble() self.ddd=stream:readDouble() self.eee=stream:readDouble() self.fff=stream:readDouble() self.ggg=stream:readDouble() self.hhh=stream:readDouble() self.iii=stream:readDouble() self.jjj=stream:readDouble() self.kkk=stream:readDouble() self.lll=stream:readDouble() self.mmm=stream:readDouble() self.nnn=stream:readDouble() self.ooo=stream:readDouble() self.ppp=stream:readDouble() self.qqq=stream:readDouble() self.rrr=stream:readDouble() self.sss=stream:readDouble() self.ttt=stream:readDouble() self.uuu=stream:readDouble() self.vvv=stream:readDouble() self.www=stream:readDouble() self.xxx=stream:readDouble() self.yyy=stream:readDouble() self.zzz=stream:readDouble() self.zazaza=stream:readDouble() self.zbzbzb=stream:readDouble() self.zczczc=stream:readDouble() self.zdzdzd=stream:readDouble() self.zezeze=stream:readDouble() self.zfzfzf=stream:readDouble() self.zgzgzg=stream:readDouble() self.zhzhzh=stream:readDouble() self.zizizi=stream:readDouble() self.zjzjzj=stream:readDouble() self.zkzkzk=stream:readDouble() self.zlzlzl=stream:readDouble() self.zmzmzm=stream:readDouble() self.znznzn=stream:readDouble() self.zozozo=stream:readDouble() self.zpzpzp=stream:readDouble() --2 list box self.lilistboxx=stream:readDouble() self.liboxx=stream:readDouble() --6 checkbox self.blibli=stream:readBoolean() self.bloblo=stream:readBoolean() self.bleble=stream:readBoolean() self.blublu=stream:readBoolean() self.blabla=stream:readBoolean() self.blrblr=stream:readBoolean() --4 boutons self.bouta=stream:readBoolean() self.boutb=stream:readBoolean() self.boutc=stream:readBoolean() self.boutd=stream:readBoolean() -- textEdit self.textA=stream:readString() self.textB=stream:readString() self.textc=stream:readString() self.textD=stream:readString() self.textE=stream:readString() self.textF=stream:readString() self.textG=stream:readString() self.textH=stream:readString() self.textI=stream:readString() self.textJ=stream:readString() self.textK=stream:readString() self.textL=stream:readString() self.textM=stream:readString() self.textN=stream:readString() self.textO=stream:readString() self.textP=stream:readString() self.textQ=stream:readString() self.textR=stream:readString() self.textS=stream:readString() self.textT=stream:readString() self.textU=stream:readString() self.textV=stream:readString() --les textures self.texture=stream:readString() self.t222=stream:readString() self.t333=stream:readString() self.t444=stream:readString() self.t555=stream:readString() self.t666=stream:readString() end function landscape_gene:save(stream) stream:writeByte(2) stream:writeString(self.func) stream:writeDouble(self.aaa) stream:writeDouble(self.bbb) stream:writeDouble(self.ccc) stream:writeDouble(self.ddd) stream:writeDouble(self.eee) stream:writeDouble(self.fff) stream:writeDouble(self.ggg) stream:writeDouble(self.hhh) stream:writeDouble(self.iii) stream:writeDouble(self.jjj) stream:writeDouble(self.kkk) stream:writeDouble(self.lll) stream:writeDouble(self.mmm) stream:writeDouble(self.nnn) stream:writeDouble(self.ooo) stream:writeDouble(self.ppp) stream:writeDouble(self.qqq) stream:writeDouble(self.rrr) stream:writeDouble(self.sss) stream:writeDouble(self.ttt) stream:writeDouble(self.uuu) stream:writeDouble(self.vvv) stream:writeDouble(self.www) stream:writeDouble(self.xxx) stream:writeDouble(self.yyy) stream:writeDouble(self.zzz) stream:writeDouble(self.zazaza) stream:writeDouble(self.zbzbzb) stream:writeDouble(self.zczczc) stream:writeDouble(self.zdzdzd) stream:writeDouble(self.zezeze) stream:writeDouble(self.zfzfzf) stream:writeDouble(self.zgzgzg) stream:writeDouble(self.zhzhzh) stream:writeDouble(self.zizizi) stream:writeDouble(self.zjzjzj) stream:writeDouble(self.zkzkzk) stream:writeDouble(self.zlzlzl) stream:writeDouble(self.zmzmzm) stream:writeDouble(self.znznzn) stream:writeDouble(self.zozozo) stream:writeDouble(self.zpzpzp) -- 2 list box stream:writeDouble(self.lilistboxx) stream:writeDouble(self.liboxx) --6 checkbox stream:writeBoolean(self.blibli) stream:writeBoolean(self.bloblo) stream:writeBoolean(self.bleble) stream:writeBoolean(self.blublu) stream:writeBoolean(self.blabla) stream:writeBoolean(self.blrblr) --4 boutons stream:writeBoolean(self.bouta) stream:writeBoolean(self.boutb) stream:writeBoolean(self.boutc) stream:writeBoolean(self.boutd) -- textEdit stream:writeString(self.textA) stream:writeString(self.textB) stream:writeString(self.textC) stream:writeString(self.textD) stream:writeString(self.textE) stream:writeString(self.textF) stream:writeString(self.textG) stream:writeString(self.textH) stream:writeString(self.textI) stream:writeString(self.textJ) stream:writeString(self.textK) stream:writeString(self.textL) stream:writeString(self.textM) stream:writeString(self.textN) stream:writeString(self.textO) stream:writeString(self.textP) stream:writeString(self.textQ) stream:writeString(self.textR) stream:writeString(self.textS) stream:writeString(self.textT) stream:writeString(self.textU) stream:writeString(self.textV) --les textures stream:writeString(self.texture) stream:writeString(self.t222) stream:writeString(self.t333) stream:writeString(self.t444) stream:writeString(self.t555) stream:writeString(self.t666) end function landscape_gene:getProperties() return "LandScape_Gene", "A11BD3A1EC12DDCC", "3311333333333333".. "3331111333333333".. "3333111113333333".. "3333331111133333".. "3333333111113333".. "3333333111111333".. "3333333111111333".. "3333333311111333".. "3333333311111333".. "3333333311111333".. "3333333111111333".. "3333331111113333".. "3333311111133333".. "3333111113333333".. "3331113333333333".. "3311333333333333" end function landscape_gene:getDialog(dialog) dialog:addSeparator("LandScape_Gene:") -- self.funcID=dialog:addTextEdit("z=f(x,y) or z=f(d), d=sqrt(x*x+y*y)",self.func)--; self.helpID=dialog:addButton("Help") self.lllID=dialog:addEditBox("Size X:",self.lll,-40,40,2) self.mmmID=dialog:addEditBox("Size Z:",self.mmm,-40,40,2) self.kkkID=dialog:addEditBox("Definition:",self.kkk,-25,25,2) dialog:addSeparator("") self.boutbID=dialog:addRadioButton("Height_Field",self.boutb) dialog:addSeparator("Faire level_water") self.boutaID=dialog:addRadioButton("IsoSurface",self.bouta) self.zezezeID=dialog:addEditBox("Threshold/Iso:",self.zezeze,-10,10,2) self.zfzfzfID=dialog:addEditBox("Accuracy/Iso:",self.zfzfzf,-10,10,3) dialog:addSeparator("____________________") dialog:addSeparator("MODELs PREDEFS") self.boutdID=dialog:addRadioButton("Types Predefs",self.boutd) self.lilistboxxID = dialog:addListBox ({"A_Original", "B_Broken_up_A", "C_Mountain/Valley", "DHilly_Land ", "E_Karstic_Lans", "F_Extreme_Karstic", "G_Mountainous_A", "H_Deep_Valeys", "I_Mountainous_B", "J_Broken_up_B", "K_Crackled", "L_Deep_Valleys_B"}, self.lilistboxx) --my choice --pattern 1 self.textLID=dialog:addTextEdit("Trubu",self.textL) self.textMID=dialog:addTextEdit("Scale",self.textM) self.textNID=dialog:addTextEdit("Rotation",self.textN) self.aaaID=dialog:addEditBox("Power Pattern 1:",self.aaa,-5,10,2) --pattern 2 self.textOID=dialog:addTextEdit("Turbu",self.textO) self.textPID=dialog:addTextEdit("Scale",self.textP) self.textQID=dialog:addTextEdit("Rotation",self.textQ) self.bbbID=dialog:addEditBox("Power Pattern 2:",self.bbb,-50,50,2) dialog:addSeparator("____________________") dialog:addSeparator("____________________") --fin predef --debut my choice dialog:addSeparator("MODELs MY CHOICE") self.boutcID=dialog:addRadioButton("Types My choice",self.boutc) self.textAID=dialog:addTextEdit("Pattern 1 /by def leopard/",self.textA) self.textRID=dialog:addTextEdit("Turbu",self.textR) self.textSID=dialog:addTextEdit("Transfo",self.textS) self.cccID=dialog:addEditBox("Force P1:",self.ccc,-50,50,2) self.textBID=dialog:addTextEdit("Pattern 2 /by def crackle/",self.textB) self.textTID=dialog:addTextEdit("Turbu",self.textT) self.textUID=dialog:addTextEdit("Transfo",self.textU) self.dddID=dialog:addEditBox("Force P2:",self.ddd,-50,50,2) --fin my choice dialog:addSeparator("____________________") dialog:addSeparator("____________________") dialog:addSeparator("____________________") dialog:addSeparator("ADD OTHER FUNCTIONS-") dialog:addSeparator("Noise ") self.blebleID=dialog:addCheckBox("On/Off" ,self.bleble) self.zzzID=dialog:addEditBox("Noise Power:",self.zzz,-5,10,2) dialog:addSeparator("Wrinkles transformations") self.blablaID=dialog:addCheckBox("On/Off" ,self.blabla) self.zazazaID=dialog:addEditBox("Wrinkling Power:",self.zazaza,-30,30,2) self.textEID=dialog:addTextEdit("W_Turbu",self.textE) self.textFID=dialog:addTextEdit("W_Scale",self.textF) self.textGID=dialog:addTextEdit("W_Rotation",self.textG) dialog:addSeparator("Denting transformations") self.blibliID=dialog:addCheckBox("On/Off" ,self.blibli) self.nnnID=dialog:addEditBox("Denting Power:",self.nnn,-45,10,3) self.textHID=dialog:addTextEdit("D_Turbu",self.textH) self.textIID=dialog:addTextEdit("D_Scale",self.textI) self.textJID=dialog:addTextEdit("D_Rotation",self.textJ) dialog:addSeparator("Checkering transformations") self.blubluID=dialog:addCheckBox("On/Off" ,self.blublu) self.oooID=dialog:addEditBox("Checkering Power:",self.ooo,-45,10,3) self.textDID=dialog:addTextEdit("C_Turbulence",self.textD) self.textCID=dialog:addTextEdit("C_Scale",self.textC) self.textKID=dialog:addTextEdit("C_Rotation",self.textK) dialog:addSeparator("F_ridged_mf") self.blobloID=dialog:addCheckBox("On/Off" ,self.bloblo) self.sssID=dialog:addEditBox("H 0.1:",self.sss,-30,30,2) self.tttID=dialog:addEditBox("Lacunarity 10:",self.ttt,-30,30,2) self.uuuID=dialog:addEditBox("Octaves 3:",self.uuu,-30,30,2) self.vvvID=dialog:addEditBox("Offset 0.6",self.vvv,-30,30,2) self.wwwID=dialog:addEditBox("Gain 1.2:",self.www,-30,30,2) self.xxxID=dialog:addEditBox("Generator 2:",self.xxx,-30,30,2) dialog:addSeparator("Textures :") self.textureID=dialog:addTexture(self.texture) dialog:addSeparator("__________________") dialog:addSeparator("__________________") dialog:addSeparator("__pour plus tard__") dialog:addSeparator("_____blabla_______") dialog:addSeparator("__________________") dialog:addSeparator("__en attentent____") --en attentent edittbox self.zgzgzgID=dialog:addEditBox("zgzgzg:",self.zgzgzg,-60,60,2) self.zhzhzhID=dialog:addEditBox("zhzhzh:",self.zhzhzh,-60,60,2) self.ziziziID=dialog:addEditBox("zizizi:",self.zizizi,-60,60,2) self.zjzjzjID=dialog:addEditBox("zjzjzj:",self.zjzjzj,-60,60,2) self.zkzkzkID=dialog:addEditBox("zkzkzk:",self.zkzkzk,-60,60,2) self.zlzlzlID=dialog:addEditBox("zlzlzl:",self.zlzlzl,-60,60,2) self.zmzmzmID=dialog:addEditBox("zmzmzm:",self.zmzmzm,-60,60,2) self.znznznID=dialog:addEditBox("znznzn:",self.znznzn,-60,60,2) self.zozozoID=dialog:addEditBox("zozozo:",self.zozozo,-60,60,2) self.zpzpzpID=dialog:addEditBox("zpzpzp:",self.zpzpzp,-60,60,2) --annules -- self.zbzbzbID=dialog:addEditBox("Wturb:",self.zbzbzb,-30,30,2) -- self.zczczcID=dialog:addEditBox("Wscale:",self.zczczc,-30,30,2) -- self.zdzdzdID=dialog:addEditBox("Wrotate:",self.zdzdzd,-30,30,2) -- self.pppID=dialog:addEditBox("Rotation X:",self.ppp,-360,360,1) -- self.qqqID=dialog:addEditBox("Rotation Y:",self.qqq,-360,360,1) -- self.rrrID=dialog:addEditBox("Rotation Z:",self.rrr,-360,360,1) -- self.yyyID=dialog:addEditBox("Dentering Scale:",self.yyy,-5,10,2) -- self.fffID=dialog:addEditBox("Scale X:",self.fff,-50,50,2) -- self.gggID=dialog:addEditBox("Scale y:",self.ggg,-50,50,2) -- self.hhhID=dialog:addEditBox("Scale Z:",self.hhh,-50,50,2) -- self.eeeID=dialog:addEditBox("Octaves:",self.eee,-5,10,2) -- self.iiiID=dialog:addEditBox("Omega:",self.iii,-5,10,2) -- self.jjjID=dialog:addEditBox("Lambda:",self.jjj,-5,10,2) --texteddit en attentent self.textVID=dialog:addTextEdit("blabla",self.textV) dialog:addSeparator("Futur list-boxB :") self.liboxxID = dialog:addListBox ({"1_BOXrouge", "2_CONErouge", "3_dfdffd", "4_fddffds", "5_TORUSrouge"}, self.liboxx) --ajout 6 Checkbox dialog:addSeparator("Futur CheckBox:") self.blrblrID=dialog:addCheckBox("blrblr" ,self.blrblr) dialog:addSeparator("") --ajout de textures --dialog:addSeparator("Les Textures :") --dialog:addSeparator("Texture2:") -- self.t222ID=dialog:addTexture(self.t222) --dialog:addSeparator("Texture3:") -- self.t333ID=dialog:addTexture(self.t333) --dialog:addSeparator("Texture4:") -- self.t444ID=dialog:addTexture(self.t444) --dialog:addSeparator("Texture5:") -- self.t555ID=dialog:addTexture(self.t555) --dialog:addSeparator("Texture6:") -- self.t666ID=dialog:addTexture(self.t666) dialog:addSeparator("") end function landscape_gene:valueChanged(index,value) -- HELP if index==self.helpID then messageBox("About LandScape_Gene ", --titre "Bla bla bla\n\n".. --saut 2 fois à la ligne "Caballeros y Caballeras. \n".. "A great part of these Plug-ins came from the Net. I just rewrite .inc files or macros in Lua format, through Fullmoon \n".. "create by Mr LEIRADELLA. http://www.geocities.com/andre_leiradella/ And Email:leiradella@bigfoot.com \n".. "To use with MORAY3.x. \n".. "From les Iles Caiman. \n".. "C'est la vie.\n".. "Friendly. \n".. "Sylvain. Email:sylvain@potar-hurlant.com \n".. "Ps: I build this plugin for fun. It not a professional work. Don't be cruel and have fun. \n".. "Persistence of Vision Ray Tracer Scene Description File \n\n".. " File name : LandscapeGenerator.pov \n".. " Version : 3.5 \n".. " Description : Makes isosurface landscapes \n".. " uses heightfields to test same landscape (faster!) \n".. " obviously, there are thousands of combinations possible! \n".. " here are just a few to get you started. \n".. " enjoy! \n".. " Date : May 2004 \n".. " Author : Mike Williams \n".. " Compiled : Thomas A. M. de Groot \n".. " \n".. " \n".. " blablabla \n".. " blablablablabla \n".. " !With the little help from! Marc Jacquier \n".. " \n".. " \n".. " \n\n".. " " ) return end if index==self.funcID then self.func=value self:redraw() end if index==self.aaaID then self.aaa=value self:redraw() end if index==self.bbbID then self.bbb=value self:redraw() end if index==self.cccID then self.ccc=value self:redraw() end if index==self.dddID then self.ddd=value self:redraw() end if index==self.eeeID then self.eee=value self:redraw() end if index==self.fffID then self.fff=value self:redraw() end if index==self.gggID then self.ggg=value self:redraw() end if index==self.hhhID then self.hhh=value self:redraw() end if index==self.iiiID then self.iii=value self:redraw() end if index==self.jjjID then self.jjj=value self:redraw() end if index==self.kkkID then self.kkk=value self:redraw() end if index==self.lllID then self.lll=value self:redraw() end if index==self.mmmID then self.mmm=value self:redraw() end if index==self.nnnID then self.nnn=value self:redraw() end if index==self.oooID then self.ooo=value self:redraw() end if index==self.pppID then self.ppp=value self:redraw() end if index==self.qqqID then self.qqq=value self:redraw() end if index==self.rrrID then self.rrr=value self:redraw() end if index==self.sssID then self.sss=value self:redraw() end if index==self.tttID then self.ttt=value self:redraw() end if index==self.uuuID then self.uuu=value self:redraw() end if index==self.vvvID then self.vvv=value self:redraw() end if index==self.wwwID then self.www=value self:redraw() end if index==self.xxxID then self.xxx=value self:redraw() end if index==self.yyyID then self.yyy=value self:redraw() end if index==self.zzzID then self.zzz=value self:redraw() end if index==self.zazazaID then self.zazaza=value self:redraw() end if index==self.zbzbzbID then self.zbzbzb=value self:redraw() end if index==self.zczczcID then self.zczczc=value self:redraw() end if index==self.zdzdzdID then self.zdzdzd=value self:redraw() end if index==self.zezezeID then self.zezeze=value self:redraw() end if index==self.zfzfzfID then self.zfzfzf=value self:redraw() end if index==self.zgzgzgID then self.zgzgzg=value self:redraw() end if index==self.zhzhzhID then self.zhzhzh=value self:redraw() end if index==self.ziziziID then self.zizizi=value self:redraw() end if index==self.zjzjzjID then self.zjzjzj=value self:redraw() end if index==self.zkzkzkID then self.zkzkzk=value self:redraw() end if index==self.zlzlzlID then self.zlzlzl=value self:redraw() end if index==self.zmzmzmID then self.zmzmzm=value self:redraw() end if index==self.znznznID then self.znznzn=value self:redraw() end if index==self.zozozoID then self.zozozo=value self:redraw() end if index==self.zpzpzpID then self.zpzpzp=value self:redraw() end --ListBox if index==self.lilistboxxID then self.lilistboxx=value self:redraw() end if index==self.liboxxID then self.liboxx=value self:redraw() end --6 checkbox if index==self.blibliID then self.blibli=value self:redraw() end if index==self.blobloID then self.bloblo=value self:redraw() end if index==self.blebleID then self.bleble=value self:redraw() end if index==self.blablaID then self.blabla=value self:redraw() end if index==self.blubluID then self.blublu=value self:redraw() end if index==self.blrblrID then self.blrblr=value self:redraw() end --4 boutons va et vient par grpe de 2 if index==self.boutaID then self.bouta=value self.boutb=nil self:redraw() end if index==self.boutbID then self.bouta=nil self.boutb=value self:redraw() end if index==self.boutcID then self.boutc=value self.boutd=nil self:redraw() end if index==self.boutdID then self.boutc=nil self.boutd=value self:redraw() end --exemple -- if id==self.funcID then -- self.func=value -- end -- TextEdit if index==self.textAID then self.textA=value scene:invalidate() self.redraw() end if index==self.textBID then self.textB=value scene:invalidate() end if index==self.textCID then self.textC=value scene:invalidate() end if index==self.textDID then self.textD=value scene:invalidate() end if index==self.textEID then self.textE=value scene:invalidate() end if index==self.textFID then self.textF=value scene:invalidate() end if index==self.textGID then self.textG=value scene:invalidate() end if index==self.textHID then self.textH=value scene:invalidate() end if index==self.textIID then self.textI=value scene:invalidate() end if index==self.textJID then self.textJ=value scene:invalidate() end if index==self.textKID then self.textK=value scene:invalidate() end if index==self.textLID then self.textL=value scene:invalidate() end if index==self.textMID then self.textM=value scene:invalidate() end if index==self.textNID then self.textN=value scene:invalidate() end if index==self.textOID then self.textO=value scene:invalidate() end if index==self.textPID then self.textP=value scene:invalidate() end if index==self.textQID then self.textQ=value scene:invalidate() end if index==self.textRID then self.textR=value scene:invalidate() end if index==self.textSID then self.textS=value scene:invalidate() end if index==self.textTID then self.textT=value scene:invalidate() end if index==self.textUID then self.textU=value scene:invalidate() end if index==self.textVID then self.textV=value scene:invalidate() end --end --les textures if index==self.textureID then self.texture=value end if index==self.t222ID then self.t222=value end if index==self.t333ID then self.t333=value end if index==self.t444ID then self.t444=value end if index==self.t555ID then self.t555=value end if index==self.t666ID then self.t666=value end scene:invalidate() end function landscape_gene:getInside(x,y,z) return nil end function landscape_gene:parseFunction() local f f= "function f(x,y)\n".. " local z,d\n".. " d=sqrt(x*x+y*y)\n".. -- " z="..self.textL.."\n" " z="..self.func.."\n" -- ori -- " z="..self.textM.."\n" -- " z="..self.textN.."\n" -- if self.clip then -- f=f.. " if z<"..tostring(self.minZ).." then\n".. -- " return "..tostring(self.minZ).."\n".. -- " end\n".. -- " if z>"..tostring(self.maxZ).." then\n".. -- " return "..tostring(self.maxZ).."\n".. -- " end\n" -- end f=f.. " return z\n".. "end\n".. "return f" return dostring(f) or dostring("function f(x,y) return 0 end return f") end function landscape_gene:wireframe(wire) local aaa,bbb,ccc,ddd,eee,fff,ggg,hhh,iii,jjj,kkk,lll,mmm,nnn,ooo,ppp aaa=self.aaa bbb=self.bbb ccc=self.ccc ddd=self.ddd eee=self.eee fff=self.fff ggg=self.ggg hhh=self.hhh iii=self.iii jjj=self.jjj kkk=self.kkk lll=self.lll mmm=self.mmm nnn=self.nnn ooo=self.ooo ppp=self.ppp local f f=self:parseFunction() -- wire:heightField(self.initialX,self.finalX,self.stepX,self.initialY,self.finalY,self.stepY,f) --pov:write(" function 300*",kkk," , 300*",kkk ," {P((x-0.5)*Xscale+0.5, 0, (y-0.5)*Zscale+0.5) ") -- Xscale = ",lll,"; // increase size of landscape (not scale!) for X ") -- Zscale = ",mmm,"; // increase size of landscape (not scale!) for Z ") --Cela devrait donner --wire:heightField(self.initialX,self.finalX,self.stepX,self.initialY,self.finalY,self.stepY,f) -- 4 lignes wire:line(1.74,0,0.5*1,1.74,0,1.0*1) wire:line(-1.74,0,0.5*1,-1.74,0,1.0*1) wire:line(0,1.74,0.5*1,0,1.74,1.0*1) wire:line(0,-1.74,0.5*1,0,-1.74,1.0*1) --cercle face ,0 -- wire:circleY(0,0,3*1,0.6,0,180) -- wire:circleY(0,0,0,0.6,180,360) --cercle profil vers l'arriere -- wire:circleX(0,0,1.5*1,0.6,0,180) -- wire:circleX(0,0,0,0.6,180,360) --cercle a plat du ht vers bas -- wire:circleZ(0,0,1.5*1,0.6) --le plus ht -- wire:circleZ(0,0,1*1,0.6) -- wire:circleZ(0,0,0.5*1,0.6) -- wire:circleZ(0,0,0,0.6)--le plus bas -- wire:squareX(-0.5,-0.5,0.5,0.5,-0.5) -- wire:squareZ(-0.5,-0.5,0.5,0.5, 0.5) -- wire:squareY(-0.5,-0.5,0.5,0.5,-0.5) end function landscape_gene:toPOV(pov) local mmw,aaa,bbb,ccc,ddd,eee,fff,ggg,hhh,iii,jjj,kkk,lll,mmm,nnn,ooo,ppp,qqq,rrr,sss,ttt,uuu,vvv,www,xxx,yyy,zzz,zazaza,zbzbzb,zczczc,zdzdzd,zezeze,zfzfzf,zgzgzg,zhzhzh,zizizi,zjzjzj,zkzkzk,zlzlzl,zmzmzm,znznzn,zozozo,zpzpzp,nnw,oow,soso,lilistboxx mmw='"' aaa=self.aaa bbb=self.bbb ccc=self.ccc ddd=self.ddd eee=self.eee fff=self.fff ggg=self.ggg hhh=self.hhh iii=self.iii jjj=self.jjj kkk=self.kkk lll=self.lll mmm=self.mmm nnn=self.nnn ooo=self.ooo ppp=self.ppp qqq=self.qqq rrr=self.rrr sss=self.sss ttt=self.ttt uuu=self.uuu vvv=self.vvv www=self.www xxx=self.xxx yyy=self.yyy zzz=self.zzz zazaza=self.zazaza zbzbzb=self.zbzbzb zczczc=self.zczczc zdzdzd=self.zdzdzd zezeze=self.zezeze zfzfzf=self.zfzfzf zgzgzg=self.zgzgzg zhzhzh=self.zhzhzh zizizi=self.zizizi zjzjzj=self.zjzjzj zkzkzk=self.zkzkzk zlzlzl=self.zlzlzl zmzmzm=self.zmzmzm znznzn=self.znznzn zozozo=self.zozozo zpzpzp=self.zpzpzp soso=1 nnw='!' oow='|' local f f=self:parseFunction() -- pov:write("object {") -- pov:heightField(self.initialX,self.finalX,self.stepX,self.initialY,self.finalY,self.stepY,f) -- pov:texture(self.texture) -- pov:transforms(self.xforms) -- pov:write("}") pov:write(" #declare terrainbibi= ") pov:write(" // ") pov:write(" ") pov:write("/*******************************************************************************/ ") pov:write("// Persistence of Vision Ray Tracer Scene Description File ") pov:write("// File name : LandscapeGenerator.pov ") pov:write("// Version : 3.5 ") pov:write("// Description : Makes isosurface landscapes ") pov:write("// uses heightfields to test same landscape (faster!) ") pov:write("// obviously, there are thousands of combinations possible! ") pov:write("// here are just a few to get you started. ") pov:write("// enjoy! ") pov:write("// Date : May 2004 ") pov:write("// Author : Mike Williams ") pov:write("// Compiled : Thomas A. M. de Groot ") pov:write(" ") pov:write("/****************************************************************************/ ") pov:write(" ") pov:write(" ") pov:write("#include \"rand.inc\" ") pov:write("#include \"functions.inc\" ") pov:write(" ") pov:write("#declare Loc = 5; // location of the camera and primary scaling ") if self.bouta==1 then--pour iso pov:write("#declare Iso = true; // true for isosurface; false for heightfield ") end if self.boutb==1 then --pour HF pov:write("#declare Iso = false; // true for isosurface; false for heightfield ") end pov:write("#declare Xscale = ",lll,"; // increase size of landscape (not scale!) for X ") pov:write("#declare Zscale = ",mmm,"; // increase size of landscape (not scale!) for Z ") pov:write("// ---------------------------------------- ") pov:write(" ") pov:write("#declare G = ") pov:write("pigment { ") pov:write(" gradient y ") pov:write(" //slope {<0.0, 0.1, 0.0> , 0.0 , 1.0 ") pov:write(" // altitude <0.0, 0.9, 0.0> , 0.0 , 1.0 ") pov:write(" //} ") pov:write(" colour_map { ") pov:write(" [0.04 rgb <0.1,0.4,0.1>] ") pov:write(" [0.10 rgb <0.5,0.4,0.3>] ") pov:write(" [0.25 rgb 0.5] ") pov:write(" [0.65 rgb 1.0] ") pov:write(" } ") pov:write(" translate -0.05*y ") pov:write("} ") pov:write(" ") pov:write(" #undef P1 ") pov:write(" #undef P2 ") pov:write(" #undef P ") pov:write(" #undef P1954 ") --annulé pov:write(" #undef P11 ") pov:write(" #undef P21 ") pov:write(" #undef P44 ") pov:write(" #undef P33 ") pov:write(" #undef P4444 ") pov:write(" #undef P1001 ") --pour wrinkles pov:write("#declare Wrinkling = ",zazaza,"; // ori 5 higher values give sharper features ") pov:write("#declare Wturb = ",zbzbzb,"; //<0.1, 0.5, 0.3>; // turbulence in wrinkles warp ") pov:write("#declare Wscale = ",zczczc,"; //<0.5, 0.1, 0.1>; // wrinkling scale ") pov:write("#declare Wrotate = ",zdzdzd,"; //<0, 45, 0>; // wrinkling rotation ") pov:write(" ") --pour F_ridged_mf pov:write("#declare H = ",sss,"; //ori 0.1 ") pov:write("#declare Lacunarity = ",ttt,"; //ori 10 ") pov:write("#declare Octaves = ",uuu,"; //ori 3 ") pov:write("#declare Offset = ",vvv,"; //ori 0.6 ") pov:write("#declare Gain = ",www,"; // ori 1.2 ") pov:write("#declare Generator = ",xxx,"; //ori 2 ") --pour heu pov:write("#declare Drotate = <",ppp,", ",qqq,", ",rrr,">; // Denting rotation ") pov:write("#declare Denting =",nnn,";//ori 0.5; // higher values give sharper features ") pov:write("#declare Checkering = 0; // ori 0.5 higher values increases the 'peakiness', a needle-like erosion ") pov:write("#declare Dturb = 0;//ori <0.1, 0.5, 0.3>; // turbulence in dents warp ") pov:write("#declare Dscale =",yyy,";// <0.5, 0.5, 0.5>; // Denting scale ") pov:write("#declare P4444=function {f_ridged_mf(x,y,z, H, Lacunarity, Octaves, Offset, Gain, Generator) } ") pov:write("#declare P3333=function {f_noise3d(x,y*2,z)*",zzz,"} ") -- c est quoi deja ce qui suit ??????????????????????????????? pov:write("#declare P33=function {f_noise3d(x,y*2,z)*",zzz,"} ") pov:write("#declare P44=function {f_hetero_mf(x,y,z, 0.8, 2, 5, 0, 0.9, 2) } ") -- c est quoi deja ce qui suit ??????????????????????????????? pov:write("//Les fonctionsionsions ") --modif en texttedit pour wrinkling pov:write("#declare P1001=function {pattern {wrinkles warp { ") if self.textE ~= "" then pov:write(self.textE) end pov:write(" } ") if self.textF ~= "" then pov:write(self.textF) end if self.textG ~= "" then pov:write(self.textG) end pov:write(" }} ") --modif en texttedit pour denting pov:write("#declare P11=function {pattern {dents warp { ") pov:write(" ") if self.textH ~= "" then pov:write(self.textH) end pov:write("} ") pov:write(" ") if self.textI ~= "" then pov:write(self.textI) end --scale Dscale pov:write(" ") if self.textJ ~= "" then pov:write(self.textJ) end --rotate Drotate pov:write("}} ") --modif en texttedit pour checkering pov:write("#declare P21=function {pattern {checker warp { ") --turbulence <2, 0.9, 0.9> octaves 5 omega 0.5 lambda 2 pov:write(" ") if self.textD ~= "" then pov:write(self.textD) end pov:write("} ") --scale 0.1 if self.textC ~= "" then pov:write(self.textC) end -- rotation pov:write(" ") if self.textK ~= "" then pov:write(self.textK) end pov:write("}} ") --celle du dessous semble faire doublon voir + ht c est dent en fait --pov:write("#declare P1954=function { P11(x, 0, z)*Denting } //+ P44(x*0.9, y, z*0.9) //P4(x, 0, z) //- P33(x*0.2, 0, z*0.5) ") --////////////////////////////////////////////////////////////////////////////////////////////////////////////// -- pour le depart on a ICI DEBUTS DES DIFFERENTS TYPES de patterns POUR MY CHOICE --////////////////////////////////////////////////////////////////////////////////////////////////////////////// --essais sur type 1 faire pareil aux autres sans les Edit_text if self.boutc==1 then --pour mes choix pov:write("//Original functions (Mike Williams): Mode My choice // Fonction de départ pour tous les types et transformations ") pov:write("#declare P1=function {pattern { ") if self.textA ~= "" then pov:write(self.textA) end if self.textR ~= "" then pov:write(self.textR) end pov:write(" ") if self.textS ~= "" then pov:write(self.textS) end pov:write("}} ") pov:write("#declare P2=function {pattern { ") if self.textB ~= "" then pov:write(self.textB) end if self.textT ~= "" then pov:write(self.textT) end pov:write(" ") if self.textU ~= "" then pov:write(self.textU) end pov:write("}} ") pov:write(" ") pov:write(" ") pov:write("/////////////////////////////////////////////////////////////////////// ") pov:write("//////////////////LA FUNCTION P du Iso et du HF MY CHOICE///////////////////////// ") pov:write("#declare P=function {P1(x, 0, z)*",ccc," + P2(x, 0, z)*",ddd," ") if self.bleble==1 then pov:write(" +P3333(x, y*2, z) //pour noise ") end if self.blabla==1 then pov:write("* P1001(x, 0, z)*Wrinkling //pour wrinkle ") end if self.blibli==1 then -- pov:write(" +P11(x, 0, z) //Denting ") end if self.blublu==1 then pov:write(" //checkbox 3 ") pov:write(" *P21(x, 0, z)*Checkering //checkering ") end if self.bloblo==1 then --pour ridged mais deja mis par defaut 14 ligne plus ht pov:write(" +P4444(x, z, y)//pour lacunary ???? j'ai du inverser y et z pour que cela corresponde a l'ori??? ") end --//faut il le faire a tous les autres? pov:write(" } ") pov:write(" ") end--fin boutc mes choix pov:write("// LES PREDEFS ") if self.boutd==1 then --pour predef if self.lilistboxx ==1 then pov:write("//Original functions (Mike Williams): Fonction de départ pour tous les types et transformations ") pov:write("// Mode Predef 1 ") pov:write("#declare P1=function {pattern { leopard ") if self.textL ~= "" then --pour turbu pov:write(self.textL) end if self.textM ~= "" then --pour scale pov:write(self.textM) end if self.textN ~= "" then --pour rotate pov:write(self.textN) end pov:write("}} ") pov:write("#declare P2=function {pattern {crackle ") pov:write(" ") if self.textO ~= "" then pov:write(self.textO) end if self.textP ~= "" then pov:write(self.textP) end if self.textQ ~= "" then pov:write(self.textQ) end pov:write("}} ") pov:write("#declare P=function {P1(x, 0, z)*",aaa," + P2(x, 0, z)//+P1954(x, 0, z)*",bbb," ")--en dessous c'est pour ajouter les possibilité de mon choix si besoin if self.bleble==1 then pov:write(" +P3333(x, y*2, z) //pour noise ") end if self.blabla==1 then pov:write("* P1001(x, 0, z)*Wrinkling //pour wrinkle ") end if self.blibli==1 then -- pov:write(" +P11(x, 0, z) //Denting ") end if self.blublu==1 then pov:write(" //checkbox 3 ") pov:write(" *P21(x, 0, z)*Checkering //checkering ") end if self.bloblo==1 then --pour ridged mais deja mis par defaut 14 ligne plus ht pov:write(" +P4444(x, z, y)//pour lacunary ???? j'ai du inverser y et z pour que cela corresponde a l'ori??? ") end --//faut il le faire a tous les autres? pov:write(" } ") pov:write(" ") end if self.lilistboxx ==2 then pov:write("// Interesting pattern combinations (Thomas de Groot): ") pov:write("// Mode Predef 2 ") pov:write("// a broken-up landscape: ") pov:write("#declare P1=function {pattern {cells warp { ") if self.textL ~= "" then --pour turbu pov:write(self.textL) end pov:write("} ") if self.textM ~= "" then --pour scale pov:write(self.textM) end if self.textN ~= "" then --pour rotate pov:write(self.textN) end pov:write("}} ") pov:write("#declare P2=function {pattern {crackle warp { ") if self.textO ~= "" then pov:write(self.textO) end pov:write("} ") if self.textP ~= "" then pov:write(self.textP) end if self.textQ ~= "" then pov:write(self.textQ) end pov:write("}} ") --pov:write("#declare P=function {P1(x, 0, z)*0.3 + P2(x, 0, z)*1 ") pov:write("#declare P=function {P1(x, 0, z)*",aaa," + P2(x, 0, z)//+P1954(x, 0, z)*",bbb," ") --en dessous c'est pour ajouter les possibilité de mon choix si besoin if self.bleble==1 then pov:write(" +P3333(x, y*2, z) //pour noise ") end if self.blabla==1 then pov:write("* P1001(x, 0, z)*Wrinkling //pour wrinkle ") end if self.blibli==1 then -- pov:write(" +P11(x, 0, z) //Denting ") end if self.blublu==1 then pov:write(" //checkbox 3 ") pov:write(" *P21(x, 0, z)*Checkering //checkering ") end if self.bloblo==1 then --pour ridged mais deja mis par defaut 14 ligne plus ht pov:write(" +P4444(x, z, y)//pour lacunary ???? j'ai du inverser y et z pour que cela corresponde a l'ori??? ") end --//faut il le faire a tous les autres? pov:write(" } ") pov:write(" ") end if self.lilistboxx ==3 then pov:write("// a mountain/valley landscape: ") pov:write("// Mode Predef 3 ") pov:write("#declare P1=function {pattern {leopard warp { ") if self.textL ~= "" then --pour turbu pov:write(self.textL) end pov:write("} ") if self.textM ~= "" then --pour scale pov:write(self.textM) end if self.textN ~= "" then --pour rotate pov:write(self.textN) end pov:write("}} ") pov:write("#declare P2=function {pattern {crackle warp { ") if self.textO ~= "" then --pour turbu pov:write(self.textO) end pov:write("} ") if self.textP ~= "" then --pour scale pov:write(self.textP) end if self.textQ ~= "" then --pour rotate pov:write(self.textQ) end pov:write("}} ") --pov:write("#declare P=function {P1(x, 0, z)*0.3 + P2(x, 0, z)*1 ") pov:write("#declare P=function {P1(x, 0, z)*",aaa," + P2(x, 0, z)//+P1954(x, 0, z)*",bbb," ") --en dessous c'est pour ajouter les possibilité de mon choix si besoin if self.bleble==1 then pov:write(" +P3333(x, y*2, z) //pour noise ") end if self.blabla==1 then pov:write("* P1001(x, 0, z)*Wrinkling //pour wrinkle ") end if self.blibli==1 then -- pov:write(" +P11(x, 0, z) //Denting ") end if self.blublu==1 then pov:write(" //checkbox 3 ") pov:write(" *P21(x, 0, z)*Checkering //checkering ") end if self.bloblo==1 then --pour ridged mais deja mis par defaut 14 ligne plus ht pov:write(" +P4444(x, z, y)//pour lacunary ???? j'ai du inverser y et z pour que cela corresponde a l'ori??? ") end --//faut il le faire a tous les autres? pov:write(" } ") pov:write(" ") end if self.lilistboxx ==4 then pov:write("// a hilly landscapes with 'tors': ") pov:write("// Mode Predef 4 ") pov:write("#declare P1=function {pattern {dents warp { ") if self.textL ~= "" then --pour turbu pov:write(self.textL) end pov:write("} ") if self.textM ~= "" then --pour scale pov:write(self.textM) end if self.textN ~= "" then --pour rotate pov:write(self.textN) end pov:write("}} ") pov:write("#declare P2=function {pattern {crackle warp { ") if self.textO ~= "" then --pour turbu pov:write(self.textO) end pov:write("} ") if self.textP ~= "" then --pour scale pov:write(self.textP) end if self.textQ ~= "" then --pour rotate pov:write(self.textQ) end pov:write("}} ") --6pov:write("#declare P=function {P1(x, 0, z)*0.3 + P2(x, 0, z)*1 ") pov:write("#declare P=function {P1(x, 0, z)*",aaa," + P2(x, 0, z)//+P1954(x, 0, z)*",bbb," ") --en dessous c'est pour ajouter les possibilité de mon choix si besoin if self.bleble==1 then pov:write(" +P3333(x, y*2, z) //pour noise ") end if self.blabla==1 then pov:write("* P1001(x, 0, z)*Wrinkling //pour wrinkle ") end if self.blibli==1 then -- pov:write(" +P11(x, 0, z) //Denting ") end if self.blublu==1 then pov:write(" //checkbox 3 ") pov:write(" *P21(x, 0, z)*Checkering //checkering ") end if self.bloblo==1 then --pour ridged mais deja mis par defaut 14 ligne plus ht pov:write(" +P4444(x, z, y)//pour lacunary ???? j'ai du inverser y et z pour que cela corresponde a l'ori??? ") end --//faut il le faire a tous les autres? pov:write(" } ") pov:write(" ") end if self.lilistboxx ==5 then pov:write("// a karstic landscape: ") pov:write("// Mode Predef 5 ") pov:write("#declare P1=function {pattern {agate warp { ") if self.textL ~= "" then --pour turbu pov:write(self.textL) end pov:write("} ") if self.textM ~= "" then --pour scale pov:write(self.textM) end if self.textN ~= "" then --pour rotate pov:write(self.textN) end pov:write(" }} ") pov:write("#declare P2=function {pattern {crackle warp { ") if self.textO ~= "" then pov:write(self.textO) end pov:write("} ") if self.textP ~= "" then pov:write(self.textP) end if self.textQ ~= "" then pov:write(self.textQ) end pov:write("}} ") --pov:write("#declare P=function {P1(x, 0, z)*0.3 + P2(x, 0, z)*1 ") pov:write("#declare P=function {P1(x, 0, z)*",aaa," + P2(x, 0, z)//+P1954(x, 0, z)*",bbb," ") --en dessous c'est pour ajouter les possibilité de mon choix si besoin if self.bleble==1 then pov:write(" +P3333(x, y*2, z) //pour noise ") end if self.blabla==1 then pov:write("* P1001(x, 0, z)*Wrinkling //pour wrinkle ") end if self.blibli==1 then -- pov:write(" +P11(x, 0, z) //Denting ") end if self.blublu==1 then pov:write(" //checkbox 3 ") pov:write(" *P21(x, 0, z)*Checkering //checkering ") end if self.bloblo==1 then --pour ridged mais deja mis par defaut 14 ligne plus ht pov:write(" +P4444(x, z, y)//pour lacunary ???? j'ai du inverser y et z pour que cela corresponde a l'ori??? ") end --//faut il le faire a tous les autres? pov:write(" } ") pov:write(" ") end if self.lilistboxx ==6 then pov:write("// an extreme karstic landscape: ") pov:write("// Mode Predef 6 ") pov:write("#declare P1=function {pattern {granite warp { ") if self.textL ~= "" then --pour turbu pov:write(self.textL) end pov:write("} ") if self.textM ~= "" then --pour scale pov:write(self.textM) end if self.textN ~= "" then --pour rotate pov:write(self.textN) end pov:write(" }} ") pov:write("#declare P2=function {pattern {crackle warp { ") if self.textO ~= "" then --pour turbu pov:write(self.textO) end pov:write("} ") if self.textP ~= "" then --pour scale pov:write(self.textP) end if self.textQ ~= "" then --pour rotate pov:write(self.textQ) end pov:write(" }} ") --pov:write("#declare P=function {P1(x, 0, z)*0.3 + P2(x, 0, z)*1 ") pov:write("#declare P=function {P1(x, 0, z)*",aaa," + P2(x, 0, z)//+P1954(x, 0, z)*",bbb," ") --en dessous c'est pour ajouter les possibilité de mon choix si besoin if self.bleble==1 then pov:write(" +P3333(x, y*2, z) //pour noise ") end if self.blabla==1 then pov:write("* P1001(x, 0, z)*Wrinkling //pour wrinkle ") end if self.blibli==1 then -- pov:write(" +P11(x, 0, z) //Denting ") end if self.blublu==1 then pov:write(" //checkbox 3 ") pov:write(" *P21(x, 0, z)*Checkering //checkering ") end if self.bloblo==1 then --pour ridged mais deja mis par defaut 14 ligne plus ht pov:write(" +P4444(x, z, y)//pour lacunary ???? j'ai du inverser y et z pour que cela corresponde a l'ori??? ") end --//faut il le faire a tous les autres? pov:write(" } ") pov:write(" ") end if self.lilistboxx ==7 then pov:write("// a mountainous landscape: ") pov:write("// Mode Predef 7 ") pov:write("#declare P1=function {pattern {bozo warp { ") if self.textL ~= "" then --pour turbu pov:write(self.textL) end pov:write("} ") if self.textM ~= "" then --pour scale pov:write(self.textM) end if self.textN ~= "" then --pour rotate pov:write(self.textN) end pov:write(" }} ") pov:write("#declare P2=function {pattern {crackle warp { ") if self.textO ~= "" then --pour turbu pov:write(self.textO) end pov:write("} ") if self.textP ~= "" then --pour scale pov:write(self.textP) end if self.textQ ~= "" then --pour rotate pov:write(self.textQ) end pov:write(" }} ") --pov:write("#declare P=function {P1(x, 0, z)*0.3 + P2(x, 0, z)*1 ") pov:write("#declare P=function {P1(x, 0, z)*",aaa," + P2(x, 0, z)//+P1954(x, 0, z)*",bbb," ") --en dessous c'est pour ajouter les possibilité de mon choix si besoin if self.bleble==1 then pov:write(" +P3333(x, y*2, z) //pour noise ") end if self.blabla==1 then pov:write("* P1001(x, 0, z)*Wrinkling //pour wrinkle ") end if self.blibli==1 then -- pov:write(" +P11(x, 0, z) //Denting ") end if self.blublu==1 then pov:write(" //checkbox 3 ") pov:write(" *P21(x, 0, z)*Checkering //checkering ") end if self.bloblo==1 then --pour ridged mais deja mis par defaut 14 ligne plus ht pov:write(" +P4444(x, z, y)//pour lacunary ???? j'ai du inverser y et z pour que cela corresponde a l'ori??? ") end --//faut il le faire a tous les autres? pov:write(" } ") pov:write(" ") end if self.lilistboxx ==8 then pov:write("// hilly with deep valleys: ") pov:write("// Mode Predef 8 ") pov:write("#declare P1=function {pattern {boxed warp { ") if self.textL ~= "" then --pour turbu pov:write(self.textL) end pov:write("} ") if self.textM ~= "" then --pour scale pov:write(self.textM) end if self.textN ~= "" then --pour rotate pov:write(self.textN) end pov:write(" }} ") pov:write("#declare P2=function {pattern {crackle warp { ") if self.textO ~= "" then --pour turbu pov:write(self.textO) end pov:write("} ") if self.textP ~= "" then --pour scale pov:write(self.textP) end if self.textQ ~= "" then --pour rotate pov:write(self.textQ) end pov:write(" }} ") --pov:write("#declare P=function {P1(x, 0, z)*0.3 + P2(x, 0, z)*1 ") pov:write("#declare P=function {P1(x, 0, z)*",aaa," + P2(x, 0, z)//+P1954(x, 0, z)*",bbb," ") --en dessous c'est pour ajouter les possibilité de mon choix si besoin if self.bleble==1 then pov:write(" +P3333(x, y*2, z) //pour noise ") end if self.blabla==1 then pov:write("* P1001(x, 0, z)*Wrinkling //pour wrinkle ") end if self.blibli==1 then -- pov:write(" +P11(x, 0, z) //Denting ") end if self.blublu==1 then pov:write(" //checkbox 3 ") pov:write(" *P21(x, 0, z)*Checkering //checkering ") end if self.bloblo==1 then --pour ridged mais deja mis par defaut 14 ligne plus ht pov:write(" +P4444(x, z, y)//pour lacunary ???? j'ai du inverser y et z pour que cela corresponde a l'ori??? ") end --//faut il le faire a tous les autres? pov:write(" } ") pov:write(" ") end if self.lilistboxx ==9 then pov:write("// a mountainous landscape: ") pov:write("// Mode Predef 9 ") pov:write("#declare P1=function {pattern {bumps warp { ") if self.textL ~= "" then --pour turbu pov:write(self.textL) end pov:write("} ") if self.textM ~= "" then --pour scale pov:write(self.textM) end if self.textN ~= "" then --pour rotate pov:write(self.textN) end pov:write(" }} ") pov:write("#declare P2=function {pattern {crackle warp { ") if self.textO ~= "" then --pour turbu pov:write(self.textO) end pov:write("} ") if self.textP ~= "" then --pour scale pov:write(self.textP) end if self.textQ ~= "" then --pour rotate pov:write(self.textQ) end pov:write(" }} ") --pov:write("#declare P=function {P1(x, 0, z)*0.3 + P2(x, 0, z)*1 ") pov:write("#declare P=function {P1(x, 0, z)*",aaa," + P2(x, 0, z)//+P1954(x, 0, z)*",bbb," ") --en dessous c'est pour ajouter les possibilité de mon choix si besoin if self.bleble==1 then pov:write(" +P3333(x, y*2, z) //pour noise ") end if self.blabla==1 then pov:write("* P1001(x, 0, z)*Wrinkling //pour wrinkle ") end if self.blibli==1 then -- pov:write(" +P11(x, 0, z) //Denting ") end if self.blublu==1 then pov:write(" //checkbox 3 ") pov:write(" *P21(x, 0, z)*Checkering //checkering ") end if self.bloblo==1 then --pour ridged mais deja mis par defaut 14 ligne plus ht pov:write(" +P4444(x, z, y)//pour lacunary ???? j'ai du inverser y et z pour que cela corresponde a l'ori??? ") end --//faut il le faire a tous les autres? pov:write(" } ") pov:write(" ") end if self.lilistboxx ==10 then pov:write("// a broken-up landscape: ") pov:write("// Mode Predef 10 ") pov:write("#declare P1=function {pattern {checker warp { ") if self.textL ~= "" then --pour turbu pov:write(self.textL) end pov:write("} ") if self.textM ~= "" then --pour scale pov:write(self.textM) end if self.textN ~= "" then --pour rotate pov:write(self.textN) end pov:write(" }} ") pov:write("#declare P2=function {pattern {crackle warp { ") if self.textO ~= "" then --pour turbu pov:write(self.textO) end pov:write("} ") if self.textP ~= "" then --pour scale pov:write(self.textP) end if self.textQ ~= "" then --pour rotate pov:write(self.textQ) end pov:write(" }} ") --pov:write("#declare P=function {P1(x, 0, z)*0.3 * P2(x, 0, z)*1 ") pov:write("#declare P=function {P1(x, 0, z)*",aaa," + P2(x, 0, z)//+P1954(x, 0, z)*",bbb," ") --en dessous c'est pour ajouter les possibilité de mon choix si besoin if self.bleble==1 then pov:write(" +P3333(x, y*2, z) //pour noise ") end if self.blabla==1 then pov:write("* P1001(x, 0, z)*Wrinkling //pour wrinkle ") end if self.blibli==1 then -- pov:write(" +P11(x, 0, z) //Denting ") end if self.blublu==1 then pov:write(" //checkbox 3 ") pov:write(" *P21(x, 0, z)*Checkering //checkering ") end if self.bloblo==1 then --pour ridged mais deja mis par defaut 14 ligne plus ht pov:write(" +P4444(x, z, y)//pour lacunary ???? j'ai du inverser y et z pour que cela corresponde a l'ori??? ") end --//faut il le faire a tous les autres? pov:write(" } ") pov:write(" ") end if self.lilistboxx ==11 then pov:write("// a crackled landscape: ") pov:write("// Mode Predef 11 ") pov:write("#declare P1=function {pattern {crackle warp { ") if self.textL ~= "" then --pour turbu pov:write(self.textL) end pov:write("} ") if self.textM ~= "" then --pour scale pov:write(self.textM) end if self.textN ~= "" then --pour rotate pov:write(self.textN) end pov:write(" }} ") pov:write("#declare P2=function {pattern {crackle warp { ") if self.text0 ~= "" then --pour turbu pov:write(self.text0) end pov:write("} ") if self.textP ~= "" then --pour scale pov:write(self.textP) end if self.textQ ~= "" then --pour rotate pov:write(self.textQ) end pov:write(" }} ") --pov:write("#declare P=function {P1(x, 0, z)*0.3 + P2(x, 0, z)*1 ") pov:write("#declare P=function {P1(x, 0, z)*",aaa," + P2(x, 0, z)//+P1954(x, 0, z)*",bbb," ") --en dessous c'est pour ajouter les possibilité de mon choix si besoin if self.bleble==1 then pov:write(" +P3333(x, y*2, z) //pour noise ") end if self.blabla==1 then pov:write("* P1001(x, 0, z)*Wrinkling //pour wrinkle ") end if self.blibli==1 then -- pov:write(" +P11(x, 0, z) //Denting ") end if self.blublu==1 then pov:write(" //checkbox 3 ") pov:write(" *P21(x, 0, z)*Checkering //checkering ") end if self.bloblo==1 then --pour ridged mais deja mis par defaut 14 ligne plus ht pov:write(" +P4444(x, z, y)//pour lacunary ???? j'ai du inverser y et z pour que cela corresponde a l'ori??? ") end --//faut il le faire a tous les autres? pov:write(" } ") pov:write(" ") end if self.lilistboxx ==12 then pov:write("// hilly with deep valleys: ") pov:write("// Mode Predef 12 ") pov:write("#declare P1=function {pattern {cylindrical warp { ") if self.textL ~= "" then --pour turbu pov:write(self.textL) end pov:write("} ") if self.textM ~= "" then --pour scale pov:write(self.textM) end if self.textN ~= "" then --pour rotate pov:write(self.textN) end pov:write(" }} ") pov:write("#declare P2=function {pattern {crackle warp { ") if self.textO ~= "" then --pour turbu pov:write(self.textO) end pov:write("} ") if self.textP ~= "" then --pour scale pov:write(self.textP) end if self.textQ ~= "" then --pour rotate pov:write(self.textQ) end pov:write(" }} ") --pov:write("#declare P=function {P1(x, 0, z)*0.3 + P2(x, 0, z)*1 ") pov:write("#declare P=function {P1(x, 0, z)*",aaa," + P2(x, 0, z)//+P1954(x, 0, z)*",bbb," ") --en dessous c'est pour ajouter les possibilité de mon choix si besoin if self.bleble==1 then pov:write(" +P3333(x, y*2, z) //pour noise ") end if self.blabla==1 then pov:write("* P1001(x, 0, z)*Wrinkling //pour wrinkle ") end if self.blibli==1 then -- pov:write(" +P11(x, 0, z) //Denting ") end if self.blublu==1 then pov:write(" //checkbox 3 ") pov:write(" *P21(x, 0, z)*Checkering //checkering ") end if self.bloblo==1 then --pour ridged mais deja mis par defaut 14 ligne plus ht pov:write(" +P4444(x, z, y)//pour lacunary ???? j'ai du inverser y et z pour que cela corresponde a l'ori??? ") end --//faut il le faire a tous les autres? pov:write(" } ") pov:write(" ") end --ICI FIN DES DIFFERENTS TYPES DE PREDEF end --pour prédef --CHOIX DE HF OU DE ISO if self.bouta==1 then--pour iso ou hf pov:write(" ") pov:write(" ") pov:write(" ") pov:write("isosurface { ") --ici mettre le bouton pour my choice ou pre def pov:write(" function {y - P(x, 1, 1-z)} ") pov:write(" //open ") pov:write(" threshold ",zezeze," ") pov:write(" accuracy ",zfzfzf," ") pov:write(" max_gradient 5 *",kkk," ") pov:write(" contained_by {box {<0.5-Xscale*0.5, -1, 0.5-Zscale*0.5>, <0.5+Xscale*0.5, 12, 0.5+Zscale*0.5>}} ") pov:write(" translate <-0.5, 0, -0.5> ")--ori, 1, 0.5+Zscale pov:write(" scale ") pov:write("rotate <-90,0,0> ") pov:write(" scale <1,1,-1> ") pov:texture(self.texture) --pov:write(" pigment {G} ") pov:write(" //translate -Loc/2*x ") pov:write(" ") pov:write(" ") end if self.boutb==1 then--pour HF ou iso pov:write(" ") pov:write(" ") pov:write(" ") pov:write("height_field{ ") pov:write("// function 300, 300 {P((x-0.5)*Xscale+0.5, 0, (y-0.5)*Zscale+0.5)}//ori ") pov:write(" function 300*",kkk,", 300*",kkk," {P((x-0.5)*Xscale+0.5, 0, (y-0.5)*Zscale+0.5) ") pov:write(" ") pov:write(" } smooth //est ce le bonne endroit ") pov:write(" ") pov:write(" ") pov:write(" ") pov:write(" ") pov:write(" translate <-0.5, 0, -0.5> ") --pov:write(" scale //ori ") pov:write(" scale <5*Xscale, 1, 5*Zscale> ") pov:write("rotate <-90,0,0> ") pov:write(" scale <1,1,-1> ") pov:texture(self.texture) --pov:write(" pigment {G} ") pov:write(" //translate 5/2*x //Loc/2*x ") pov:write(" //} ") pov:write(" ") end --////////////////////////////////////////////////////////////////////////: --debut 6 checkkbbox if self.bleble==1 then pov:write(" //checkbox 3 ") end if self.blrblr==1 then pov:write(" //checkbox 6 ") end --fin checkkbbox --///////////////////////////////////////////////////////// --debut d exemple pour listbox à 3 choix. if self.lilistboxx ==1 then soso=1 do end end if self.lilistboxx ==2 then soso=1 do end end if self.lilistboxx ==3 then soso=1 do end end --fin d exemple pour listbox a 3 choix. --textteedit en attentent pov:write(" ") if self.textV ~= "" then pov:write(self.textV) end pov:write(" ") --debut d exemple pour listbox à 5 choix. if self.liboxx ==1 then pov:write("//listboxB choix 1") end if self.liboxx ==2 then pov:write("//listboxB choix 1") end if self.liboxx ==3 then pov:write("//listboxB choix 1") end if self.liboxx ==4 then pov:write("//listboxB choix 1") end if self.liboxx ==5 then pov:write("//listboxB choix 1") end --fin d exemple pour listbox a 5 choix. --les textures -- --pov:texture(self.t222) --pov:texture(self.t333) --pov:texture(self.t444) --pov:texture(self.t555) --pov:texture(self.t666) pov:write(" // ") --pov:write("box{-.001,.001 pigment {rgbt 1}") -- added so the code can be part of a CSG pov:transforms(self.xforms) pov:write("} //fin union général de l'objet ") pov:write("object { terrainbibi} ") end registerClass(landscape_gene,"landscape_gene")