Petrel TIPSTRICKS from SCM make it snow

11 215 0
Petrel TIPSTRICKS from SCM make it snow

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

Petrel is a mark of Schlumberger 4801 Woodway Drive, Suite 150W • Houston, TX 77056 • www.scminc.com • info@scminc.com Copyright © 2000-2009 SCM, Inc. – All Rights Reserved 1 Knowledge Worth Sharing Petrel TIPS&TRICKS from SCM, Inc.  MakeItSnowWorkflow Manhasdreamedofcontrollingtheweathersincebeforefireandbeforethewheel.Now,withPetrel, mancanachievethisgoal.UsingaPetrelWorkflowwehavemadeitsnowinawindowseenin3Dspace. Granted,thisisasmallstepformankind,butasaPetreluserthiscouldbeagiantleapforwardinyour workflowknowledge.ThisPetrelTIPS&TRICKSwalksyouthroughtheloopsandmethodsneededto simulatefallingsnow.ImaginetellingyourfamilyandfriendsduringtheHolidaypartiesthatyouwere abletomakeitsnow.Youwillbethetalkof theparty! Figure:Logicalflowintheevolutionofhumantechnology.  ThisSnowfallworkflowusesasingleloopandanestedpairofloopstomakeitsnow.Therearenospecial tricks(otherthanrandomnumbergeneration)beingusedandnoexoticprocessesbeingexecuted.For thatreasonthisworkflowmakesanexcellentTIPS&TRICKSexample.Thefollowingdiscussionwillwalk youthroughthelogicanddesignoftheworkflow. Design Thegeneraldesignofanyworkflowshouldbeplannedbeforestartingtobuildit.Theauthorsnormallydo thisusinganoutlineand/oraseriesofsketches(thesearepresentedinfiguresinthesectionbelow). Oncetheplanisfinishedworkflowconstructionbegins.ThissameapproachwasusedfortheSnowfall workflow. Fire Wheel Petrel Make Snow Petrel is a mark of Schlumberger 4801 Woodway Drive, Suite 150W • Houston, TX 77056 • www.scminc.com • info@scminc.com Copyright © 2000-2009 SCM, Inc. – All Rights Reserved 2 SkeletonWorkflow Firstaskeletonworkflowtellingwhatishappeningateachstepiscreated.Thisworkflowcontains messagesandcommentsandanylogicrequiredtomaketheworkflowexecute.Whenexecuted,the SkeletonworkflowwillwriteanoutlineoftheprocessingstepstothePetrelmessagelog. OncetheSkeletonworkflowisworkingcorrectlythentheexecutablecommandsareslowlyaddedusing properQCalongtheway.Thisslowenhancementcontinuesuntiltheworkflowiscompleteandthe resultscorrect. Figure:Skeletonworkflowcontainingonlylogicandmessagestoindicatewhetherthedesignworks correctly.  Petrel is a mark of Schlumberger 4801 Woodway Drive, Suite 150W • Houston, TX 77056 • www.scminc.com • info@scminc.com Copyright © 2000-2009 SCM, Inc. – All Rights Reserved 3   Petrel is a mark of Schlumberger 4801 Woodway Drive, Suite 150W • Houston, TX 77056 • www.scminc.com • info@scminc.com Copyright © 2000-2009 SCM, Inc. – All Rights Reserved 4 Figure:MessageloggeneratedbytheSkeletonworkflow.  LogicandProcessingSteps TheinputandstepsrequiredtomakeitsnowinPetrelareoutlinedinthefiguresbelow.Followingeach figure(s)isthecompletedportionoftheworkflowthatperformsthatfunction. UserInputtoWorkflow Inputthattheuserprovidestheworkflowincludes:  Polygonrepresentingthesnowflake  X‐Ylimitsofthesnowfallarea  Numberofflakes  Numberoftimestoshifttheflakesdownward  Distancetoshifttheflakedownward(thelargerthisdistancethefastertheflakemoves)  Figure:TheUserusesMake/editPolygonstocreateasnowflake(left)anddefinestheX‐Ylimitsofthe Snowarea(right).Bothareenteredintotheworkflow.Notetheoriginalsnowflake(bluestar)isnotinthe Petrel is a mark of Schlumberger 4801 Woodway Drive, Suite 150W • Houston, TX 77056 • www.scminc.com • info@scminc.com Copyright © 2000-2009 SCM, Inc. – All Rights Reserved 5 area;itslocationcanbeanywhere.Thesnowflakeandsnowareashouldbesizedsothattheflakeandits detailareeasilyseenwhendisplayedinthesnowarea.   Figure:TheUserspecifies,asinputtotheworkflow,thenumberofsnowflakestobemade,distanceeach flakeshouldfall(shiftincrement),andnumberoftimeseachflakeshouldfall(beshifteddownward). Notethedashedlinerepresentsthesnowareawithaflakestartinginarandompositionandbeing shifteddownandoutoftheareabyequalshiftincrements.  Number of flakes Fall distance ( shift increment ) Snow Area Xmin = 0 Xmax = 3700 Ymin = 1000 Ymax = 6000 Number of falls ( shifts ) Petrel is a mark of Schlumberger 4801 Woodway Drive, Suite 150W • Houston, TX 77056 • www.scminc.com • info@scminc.com Copyright © 2000-2009 SCM, Inc. – All Rights Reserved 6 Figure:PortionoftheWorkflowusedtoinputfilesfoldersandparameters.  Petrel is a mark of Schlumberger 4801 Woodway Drive, Suite 150W • Houston, TX 77056 • www.scminc.com • info@scminc.com Copyright © 2000-2009 SCM, Inc. – All Rights Reserved 7 CreateSeedSnowflake TomakeiteasyfortheprogramtocreatemanysnowflakesitneedstohaveoneflakeinaknownX‐Y position.Theoriginalinputflakeiscopiedandthecopyisnamedandmovedtothelowerleftcornerof thesnowarea.Thiscopiedflakebecomestheseedforcreatingallsnowflakesusedbytheworkflow. Figure:TheWorkflowmakesacopyofthesnowflake,determinesitsmin‐Xandmin‐Yposition,calculates theshiftsneededtogetittoXminandYminoftheSnowarea,andtranslatesthecopiedflaketolower leftcornerofSnowarea.  Figure:PortionoftheWorkflowusedtocreateandpositiontheseedsnowflake.  Dy Dx Petrel is a mark of Schlumberger 4801 Woodway Drive, Suite 150W • Houston, TX 77056 • www.scminc.com • info@scminc.com Copyright © 2000-2009 SCM, Inc. – All Rights Reserved 8 CreateSnowflakes Thesnowflakesarecreatedbycopyingtheseedflakeandthenrandomlypositioningthecopiesinthe snowarea.Eachcopyisthenresized,madetoappearrotatedandgivenacolor. Figure:TheWorkflowrandomlypicksavaluebetween0andX‐rangeofthesnowareaandanother between0andY‐rangeoftheareaandshiftsacopyoftheseedsnowflakebythosevalues,itrandomly resizestheshiftedflake(usingamultiplierbetween1and3),itrandomlyrotatestheflake(scalesXby randomnumberbetween.4and1.0andsimilarlyY),anditrandomlycolorstheflake(assignsarandomZ between0and300totheflake,withthecolortablesettingthecolor).  Figure:PortionoftheWorkflowusedtocreatethesnowflakesandplacethemrandomlyinthesnow area.  Dy Dx Randomly position co py in snow area Randomly resize snow flake Randomly rotate snow flake Randomly shift Z of snow flake ( color ) Petrel is a mark of Schlumberger 4801 Woodway Drive, Suite 150W • Houston, TX 77056 • www.scminc.com • info@scminc.com Copyright © 2000-2009 SCM, Inc. – All Rights Reserved 9 DeleteSeedFlake Oncethesnowflakesarebuilttheseedsnowflakeisnolongerneeded. Figure:PortionoftheWorkflowusedtodeletetheseedsnowflake.  MakeSnowFall Thesnowflakesthathavebeenplacedinthesnowareaaremadetofallbyshiftingeachflakedown(in theYdirection)bytheshiftincrement.Thisisdoneasmanytimesaswasspecifiedintheinput parameters. Figure:Thesnowflakesareallshiftedoneincrementdownandthentheshiftprocessisrepeated.This givestheillusionofthesnowfalling.Cartoonexampleofoneflakebeingshifted(left)andseveralbeing shifted(right).  One snowflake shifted many times All snowflakes shifted many times Petrel is a mark of Schlumberger 4801 Woodway Drive, Suite 150W • Houston, TX 77056 • www.scminc.com • info@scminc.com Copyright © 2000-2009 SCM, Inc. – All Rights Reserved 10 Figure:PortionoftheWorkflowusedshiftthesnowflakesdownward(makeitsnow).   FinalDisplay Toadd“realism”tothedisplayawindowwascreatedusingpolygons.Aseriesoflineswerecreatedthat lookedlikethe sill and outlineofthe pains in a window. Thesewindowpolygons were located over an areajustbelowthesnowarea(south).Thisallowedthesnowtobecreatedbytheworkflowandthento passbehind(outside)thewindowastheflakesmoveddownward. [...]...Figure: Window with snow falling “outside”.         Petrel is a mark of Schlumberger 4801 Woodway Drive, Suite 150W • Houston, TX 77056 • www.scminc.com • info@scminc.com Copyright © 2000-2009 SCM, Inc – All Rights Reserved 11 . Drive, Suite 150W • Houston, TX 77056 • www.scminc.com • info@scminc.com Copyright © 2000-2009 SCM, Inc. – All Rights Reserved 5 area;itslocationcanbeanywhere.The snow flakeand snow areashouldbesizedsothattheflakeandits detailareeasilyseenwhendisplayedinthe snow area. . Woodway Drive, Suite 150W • Houston, TX 77056 • www.scminc.com • info@scminc.com Copyright © 2000-2009 SCM, Inc. – All Rights Reserved 7 CreateSeedSnowflake To make it easyfortheprogramtocreatemanysnowflakes it needstohaveoneflakeinaknownX‐Y position.Theoriginalinputflakeiscopiedandthecopyisnamedandmovedtothelowerleftcornerof the snow area.Thiscopiedflakebecomestheseedforcreatingallsnowflakesusedbytheworkflow. Figure:TheWorkflowmakesacopyofthe snow flake,determinesitsmin‐Xandmin‐Yposition,calculates theshiftsneededtoget it toXminandYminofthe Snow area,andtranslatesthecopiedflaketolower leftcornerof Snow area.  Figure:PortionoftheWorkflowusedtocreateandpositiontheseedsnowflake.  Dy. Inc.  Make It Snow Workflow Manhasdreamedofcontrollingtheweathersincebeforefireandbeforethewheel.Now,withPetrel, mancanachievethisgoal.UsingaPetrelWorkflowwehavemade it snow inawindowseenin3Dspace. Granted,thisisasmallstepformankind,butasaPetreluserthiscouldbeagiantleapforwardinyour workflowknowledge.ThisPetrelTIPS&TRICKSwalksyouthroughtheloopsandmethodsneededto simulatefalling snow. ImaginetellingyourfamilyandfriendsduringtheHolidaypartiesthatyouwere ableto make it snow. Youwillbethetalkof theparty! Figure:Logicalflowintheevolutionofhumantechnology.  ThisSnowfallworkflowusesasingleloopandanestedpairofloopsto make it snow. Therearenospecial tricks(otherthanrandomnumbergeneration)beingusedandnoexoticprocessesbeingexecuted.For thatreasonthisworkflowmakesanexcellentTIPS&TRICKSexample.Thefollowingdiscussionwillwalk youthroughthelogicanddesignoftheworkflow. Design Thegeneraldesignofanyworkflowshouldbeplannedbeforestartingtobuild it. Theauthorsnormallydo thisusinganoutlineand/oraseriesofsketches(thesearepresentedinfiguresinthesectionbelow). Oncetheplanisfinishedworkflowconstructionbegins.ThissameapproachwasusedfortheSnowfall workflow. Fire Wheel Petrel Make Snow Petrel is a mark of Schlumberger 4801 Woodway Drive, Suite 150W • Houston, TX 77056 • www.scminc.com • info@scminc.com Copyright

Ngày đăng: 23/10/2014, 11:22

Tài liệu cùng người dùng

Tài liệu liên quan