[vtkusers] vtkAVIWriter rendering and speed problems

Bill Lorensen bill.lorensen at gmail.com
Wed Feb 27 15:37:17 EST 2008


WEL,

Try filter.Modified(). I don't think the vtkWindowToImageFilter knows
that its input has changed, hence it never updates it modified time.

WEL

On Wed, Feb 27, 2008 at 3:31 PM, William E Lucarell
<welucarell at equityeng.com> wrote:
>
>
>
>
> Yay, found the other answer but I figured I'd post it if anyone needed the
> information.
>
>
>
> For rendering, the Update() method on the vtkWindowToImageFilter doesn't
> work.  Instead, filter.Update() should be filter.Modified().  Then the AVI
> will render each frame.
>
>
>
> Bill
>
>
>
>
>
>
>
> From: William E Lucarell [mailto:welucarell at equityeng.com]
>  Sent: Wednesday, February 27, 2008 2:42 PM
>  To: 'William E Lucarell'; vtkusers at vtk.org
>  Subject: RE: [vtkusers] vtkAVIWriter rendering and speed problems
>
>
>
>
>
> I found out how to slow the framers per second on my own.  Just call
> writer.Write() in an n-count for loop.
>
>
>
> Example:  for (int k = 0; k < 15; k++) writer.Write();
>
>
>
> The movie, unlike the render window, still doesn't update the image based on
> the change in scalars, though.
>
>
>
>
>
> From: vtkusers-bounces+welucarell=equityeng.com at vtk.org
> [mailto:vtkusers-bounces+welucarell=equityeng.com at vtk.org] On Behalf Of
> William E Lucarell
>  Sent: Wednesday, February 27, 2008 1:40 PM
>  To: vtkusers at vtk.org
>  Subject: [vtkusers] vtkAVIWriter rendering and speed problems
>
>
>
> I am using vtkAVIWriter to generate an AVI movie in Java.  However, there
> are two problems:
>
>
>
> 1)      I can't adjust the speed in frames per second so that every 200-500
> milliseconds, the frame will change.
>
> 2)      Even though I change the scalars and update the window to image
> filter, the image will not change colors based on the scalar changes.
>
>
>
> Below is a code snippet:
>
>
>
>     public void createAVI () {
>
>
>
>         // Prepare the filter and AVI writer
>
>         filter = new vtkWindowToImageFilter();
>
>         filter.SetInput(renWin.GetRenderWindow());
>
>         writerAVI = new vtkAVIWriter();
>
>         writerAVI.SetInput(filter.GetOutput());
>
>         writerAVI.SetFileName("c://movie.avi");
>
>         writerAVI.Start();
>
>
>
>         // Write each frame of the movie
>
>         for (int i = 0; i < 10; i++) {
>
>             TestMesh.GetPointData().SetScalars(scalars[i]);
>
>             renWin.GetRenderWindow().Render();
>
>             filter.Update();
>
>             writerAVI.Write();
>
>         }
>
>
>
>         // Close the AVI writer
>
>         writerAVI.End();
>
> //        TestMesh.GetPointData().SetScalars(scalars[0]);
>
>         renWin.Render();
>
>
>
>     }
>
>
>
> What am I missing? Thanks for your help in advance.
>
>
>
> Bill Lucarell
>
>
>
>
> _______________________________________________
>  This is the private VTK discussion list.
>  Please keep messages on-topic. Check the FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>  Follow this link to subscribe/unsubscribe:
>  http://www.vtk.org/mailman/listinfo/vtkusers
>
>



More information about the vtkusers mailing list