Main Content

set

Class: vrfigure

(To be removed) Set property values of vrfigure object

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

Syntax

set(figure,PropertyName,Value,...,PropertyName,Value)

Description

set(figure,PropertyName,Value,...,PropertyName,Value) sets the values of the vrfigure properties specified by one or more PropertyName,Value pair arguments.

Input Arguments

expand all

Virtual reality figure, specified as a vrfigure object.

Name-Value Arguments

Example: set(myFigure,'Antialiasing','on','CameraPosition',[0 100 100])

Specify comma-separated pairs of PropertyName,Value arguments. PropertyName is the argument name and Value is the corresponding value. PropertyName must appear inside single quotes (' '). You can specify several name and value pair arguments in any order as PropertyName1,Value1,...,PropertyNameN,ValueN.

Smooth textures using antialiasing, specified as 'on' or 'off'. Antialiasing smooths textures by interpolating values between texture points.

Camera movement with the current viewpoint, specified as 'on' or 'off'.

Camera direction in the current viewpoint local coordinates, specified as a vector of three doubles. The doubles represent the x, y, and z vectors in the current viewpoint local coordinates.

Camera position in the current viewpoint local coordinates, specified as a vector of three doubles. The doubles represent the x, y, and z vectors in the current viewpoint local coordinates.

Camera up vector, specified as a vector of three doubles. The doubles represent the x, y, and z vectors in the current viewpoint local coordinates.

File format for a captured frame file, specified as 'tif' for Tagged Image Format or 'png' for Portable Network Graphics format.

Frame capture file name, specified as a string. The string can contain tokens that the frame capture replaces with the corresponding information. See Define File Name Tokens.

Callback invoked when closing the vrfigure object, specified as a string.

Fullscreen display of figure, specified as 'on' or 'off'.

Headlight from camera, specified as 'on' or 'off'. If you specify 'off', the camera does not emit light and the scene can appear dark.

Lighting effect, specified as 'on' or 'off'. If you specify 'off', the camera does not emit light and the scene can appear dark.

Maximum pixel size of textures, specified as 'auto' or integer in a power of 2. The value of 'auto' sets the maximum texture pixel size. Otherwise, specify an integer in a power of two that is equal to or less than the video card limit (typically 1024 or 2048).

The smaller the size, the faster the texture renders. Increasing the size improves image quality but decreases performance.

Note

Specifying a value that is unsuitable causes a warning. The Simulink® 3D Animation™ software then adjusts the property to the next smaller suitable value.

Data Types: int32

Name of figure, specified as a string.

Navigation mode, specified as 'examine', 'fly', 'walk', or 'none'. See Mouse Navigation.

Navigation panel appearance, specified as 'none', 'halfbar', 'bar', 'opaque', or 'translucent'.

Navigation speed, specified as 'normal', 'slow', 'veryslow', 'fast', or 'veryfast'.

Navigation zones display, specified as 'on' or 'off'.

Location and size of virtual figure, specified as the vector in the form [left bottom width height]. Specify measurements in pixels.

ElementDescription
leftDistance from the left edge of the primary display to the inner left edge of the figure window. You can specify a negative value on systems that have more than one monitor.
bottomDistance from the bottom edge of the primary display to the inner bottom edge of the figure window. You can specify a negative value on systems that have more than one monitor.
widthDistance between the right and left inner edges of the figure.
heightDistance between the top and bottom inner edges of the figure.

All measurements are in units specified in pixels.

Example: [230 250 570 510]

Data Types: double

2-D offline animation file recording, specified as 'on' or 'off'.

Compression method for creating 2-D animation files, specified as '', 'lossless', 'none', or a string specifying the name of a compression method. See profile in the MATLAB® VideoWriter documentation.

Quality of 2-D animation file compression, specified as a floating-point number from 0 through 100, inclusive. See the MATLAB VideoWriter documentation.

Data Types: int32

Name of 2-D offline animation file, specified as a string. The string can contain tokens that animation recording replaces with the corresponding information. See File Name Tokens.

Playback rate for 2-D offline animation file, specified as 'auto' or as a scalar. The 'auto' setting aligns simulation time with actual time and uses an appropriate frame rate.

Data Types: int32

Render vrfigure object in the Simulink 3D Animation Viewer, by specifying 'on' or 'off'. Turning off rendering improves performance. For example, if your code does batch operations on a virtual figure, you can turn off rendering during that processing and then turn it back on after the processing.

Sound effects, specified as 'on' or 'off'.

Status bar display, specified as 'on' or 'off'.

Stereoscopic vision mode, specified as 'off', 'anaglyph', 'active' or a vr.utils.stereo3d object.

Specifying a vr.utils.stereo3d object sets the Stereo3D, Stereo3DCamaraOffset, and Stereo3DHIT properties. Specifying a vr.utils.stereo3d object also sets color filters for the left and right cameras.

Distance of left and right camera from parallax for stereoscopic vision, specified as a vector of three doubles representing virtual world units or as a vr.utils.stereo3d object.

Specifying a vr.utils.stereo3d object sets the Stereo3D, Stereo3DCamaraOffset, and Stereo3DHIT properties. Specifying a vr.utils.stereo3d object also sets color filters for the left and right cameras.

Horizontal image translation (HIT) of two stereoscopic images, specified as a double from 0 through 1, inclusive. The larger the value, the further back the background appears. By default, the background image is at zero and the foreground image appears to pop out from the monitor toward the person viewing the virtual world.

Specifying a vr.utils.stereo3d object sets the Stereo3D, Stereo3DCamaraOffset, and Stereo3DHIT properties. Specifying a vr.utils.stereo3d object also sets color filters for the left and right cameras.

Texture use, specified as 'on' or 'off'.

Toolbar display, specified as 'on' or 'off'.

Tooltips display, specified as 'on' or 'off'.

Transparency effect, specified as 'on' or 'off'.

Active viewpoint of a figure, specified as a string. If the active viewpoint has no description, use an empty string.

Wireframe display, specified as 'on' or 'off'.

Camera zoom factor, specified as a floating-point number. A zoom factor of 2 makes the scene look twice as large. A zoom factor of 0.1 makes it look 10 times smaller, and so forth.

Examples

expand all

Set the camera direction, navigation mode, and stereoscopic vision properties of a virtual figure.

Create a vrfigure object.

myworld = vrworld('vrmount.x3d');
open(myworld);
virtual_fig = vrfigure(myworld);

Create a vr.utils.stereo3d object to use to specify stereoscopic vision properties.

myStereo3D = vr.utils.stereo3d.ANAGLYPH_RED_CYAN;

Set the properties for a figure.

set(virtual_fig,'CameraDirection',[0 1 0],'NavMode','fly',...
    'Stereo3D',myStereo3D);

View the figure properties.

get(virtual_fig)
 
	Antialiasing = 'on'
	CameraBound = 'on'
	CameraDirection = [0 1 0]
	CameraDirectionAbs = [0 0.980067 -0.198669]
	CameraPosition = [0 0 0]
	CameraPositionAbs = [20 8 50]
	CameraUpVector = [0 1 0]
	CameraUpVectorAbs = [0 0.980067 -0.198669]
	CaptureFileFormat = 'tif'
	CaptureFileName = '%f_anim_%n.tif'
	DeleteFcn = ''
	ExaminePivotPoint = [0 0 0]
	Fullscreen = 'off'
	Headlight = 'on'
	Lighting = 'on'
	MaxTextureSize = 'auto'
	Name = 'VR Car in the Mountains'
	NavMode = 'fly'
	NavPanel = 'halfbar'
	NavSpeed = 'normal'
	NavZones = 'off'
	Position = [5 92 576 350]
	Record2D = 'off'
	Record2DCompressMethod = 'auto'
	Record2DCompressQuality = 75
	Record2DFPS = 'auto'
	Record2DFileName = '%f_anim_%n.avi'
	Rendering = 'on'
	Sound = 'on'
	StatusBar = 'on'
	Stereo3D = 'anaglyph'
	Stereo3DCameraOffset = 0.05
	Stereo3DHIT = 0
	Textures = 'on'
	ToolBar = 'on'
	Tooltips = 'on'
	Transparency = 'on'
	Triad = 'none'
	Viewpoint = 'View 1 - Observer'
	Wireframe = 'off'
	World = vrworld object: 1-by-1
	ZoomFactor = 1
 

Version History

Introduced before R2006a

collapse all

R2023b: To be removed

The set 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.