Documentation Center

  • Trial Software
  • Product Updates

vrfigure/capture

Create RGB image from virtual reality figure

Syntax

image_capture = capture(vrfigure_object)

Description

image_capture = capture(vrfigure_object) captures a virtual reality figure into a TrueColor RGB image. This image can be displayed by the image command and subsequently printed.

Examples

Create a vrworld object. At the MATLAB® command prompt, type

myworld = vrworld('vrmount.wrl')

The vrworld object myworld is associated with the virtual world vrmount.wrl.

Next, open the virtual world using the vrworld object. You must open the virtual world before you can view it. At the MATLAB command prompt, type

open(myworld)

You can now view the virtual world in the Simulink® 3D Animation™ Viewer by typing

f = vrfigure(myworld)

Your viewer opens and displays the virtual scene. Next, create an RGB image by typing

image_capture = capture(f);

Lastly, view the image

image(image_capture)

The scene from the viewer window is displayed in a MATLAB figure window.

See Also

Was this topic helpful?