Main Content

capture

Class: vrfigure

(To be removed) Capture virtual reality figure image

vrfigure.capture will be removed in a future release. For more information, see Version History.

Syntax

image_capture = capture(figure)

Description

image_capture = capture(figure) captures a virtual reality figure into a TrueColor RGB image. You can display this image using the image command. You can then print the figure.

Input Arguments

expand all

Virtual reality figure, specified as a vrfigure object.

Output Arguments

expand all

Virtual reality figure image, captured as an array. The array is an m-by-n-by-3 data array that defines red, green, and blue color components for each individual pixel.

Examples

expand all

Create and open a vrworld object and associate it with the virtual world vrmount.x3d.

myworld = vrworld('vrmount');
open(myworld);

View the virtual world in the Simulink® 3D Animation™ Viewer.

f = vrfigure(myworld);

Figure VR Car in the Mountains contains objects of type hgjavacomponent, uimenu, uipanel, uitoolbar.

Create an RGB image of the figure.

image_capture = capture(f);

Display the RGB figure image in a MATLAB® figure window.

image(image_capture);

Figure contains an axes object. The axes object contains an object of type image.

Version History

Introduced before R2006a

collapse all

R2023b: To be removed

The capture will be removed in a future release. Instead, use sim3d classes and Simulation 3D blocks to interface MATLAB® and Simulink® with the Unreal Engine® 3D simulation environment. To get started, see Create 3D Simulations in Unreal Engine Environment.