Create RGB image from virtual reality figure


image_capture = capture(vrfigure_object)


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.


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


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


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

See Also

Was this topic helpful?