![]() ![]() # Duplicating the frames allows you to slow the pace of the movie to something reasonable. # 'fdup' controls the number of times each frame is duplicated. # "mpg" is lower quality, but should play on any platform. # "mp4" is usually the best choice and plays on all most all platforms (Linux ,OSX, Windows). # Other supported options include ".mpg", ".mov". In this case we will create a "mp4" file. # The encoder selects a set of decent encoding settings based on the extension of the # the output movie file (second argument). png" % ts SetSaveWindowAttributes ( swatts ) # render the image to a PNG file SaveWindow () # use visit_utils.encoding to encode these images into a "mp4" movie # The encoder looks for a printf style pattern in the input path to identify the frames of the movie. fileName = "streamline_crop_example_ %04d. 5 # update streamline attributes and draw the plot SetOperatorOptions ( iatts ) DrawPlots () #before we render the result, explicitly set the filename for this render swatts. ![]() cropBegin = 0 for ts in range ( 0, 50 ): # set the integral curve attributes to change the where we crop the streamlines iatts. height = 1024 # Crop streamlines to render them at increasing time values over 50 steps # iatts. width = 1024 # set the height of the output image # swatts. PNG # set the width of the output image # swatts. family = 0 # select PNG as the output file format # swatts. For this example we will explicitly manage the output name. legendInfoFlag = 0 SetAnnotationAttributes ( aatts ) # Set basic save options swatts = SaveWindowAttributes () # The 'family' option controls if visit automatically adds a frame number to # the rendered files. RotateAxis ( 1, - 23 ) SetView3D ( v ) # Disable annotations aatts = AnnotationAttributes () aatts. # import visit_utils, we will use it to help encode our movie from visit_utils import * # Set a better view ResetView () v = GetView3D () v. endPointRadiusBBox = 0.01 SetPlotOptions ( patts ) DrawPlots () issueCriticalPointsWarnings = 0 SetOperatorOptions ( iatts ) # set style of streamlines patts = PseudocolorAttributes () patts. z = - 10 SetOperatorOptions ( tatts ) DrawPlots () # Find the maximum value of the field 'temp' Query ( "Max" ) val = GetQueryOutputValue () print ( "Max value of 'temp' = ", val ) # Create a streamline plot that follows # the gradient of 'temp' DefineVectorExpression ( "g", "gradient(temp)" ) AddPlot ( "Pseudocolor", "operators/IntegralCurve/g" ) iatts = IntegralCurveAttributes () iatts. AddOperator ( "ThreeSlice" ) tatts = ThreeSliceAttributes () tatts. # Clear any previous plots DeleteAllPlots () # Create a plot of the scalar field 'temp' AddPlot ( "Pseudocolor", "temp" ) # Slice the volume to show only three # external faces. Extracting a per-material aggregate value at each timestep Rendering each time step of a dataset to a movie Creating a movie of animated streamline paths It is called "rotate" and it rotates the entity that it is attached to by 10° every second. If you're rewriting parts of the engine you probably don't need this introduction to scripting. Generally you won't have to worry about the engine code, it's a single JavaScript file included into your application. The Engine, which is provided by Pla圜anvas, implements general purpose functionality such as graphics rendering, input handling, audio, and the interface to the Pla圜anvas tools and Scripts which are often specific to your application or re-usable chunks that provide useful behaviors. You can think of your application as divided into two separate code bases. They are written in regular JavaScript the same programming language that is used to program web pages. Scripts are how you make your Pla圜anvas application interactive. ![]()
0 Comments
Leave a Reply. |