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(
sets the values of the figure
,PropertyName,Value,...,PropertyName,Value)vrfigure
properties specified by one or more
PropertyName,Value
pair arguments.
Input Arguments
figure
— Virtual reality figure
vrfigure
object
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
.
Antialiasing
— Smooth textures using antialiasing
'off'
(default) | 'on'
Smooth textures using antialiasing, specified as
'on'
or 'off'
. Antialiasing
smooths textures by interpolating values between texture points.
CameraBound
— Camera movement with current viewpoint
'on'
(default) | 'off'
Camera movement with the current viewpoint, specified as
'on'
or 'off'
.
CameraDirection
— Camera direction in the current viewpoint local coordinates
vector of three doubles
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.
CameraPosition
— Camera position in the current viewpoint local coordinates
vector of three doubles
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.
CameraUpVector
— Camera up vector
vector of three doubles
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.
CaptureFileFormat
— File format for captured frame file
'tif'
(default) | 'png'
File format for a captured frame file, specified as
'tif'
for Tagged Image Format or
'png'
for Portable Network Graphics
format.
CaptureFileName
— Frame capture file name
'%f_anim_%n.ext'
(default) | string
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.
DeleteFcn
— Callback invoked when closing vrfigure
object
string
Callback invoked when closing the vrfigure
object,
specified as a string.
Fullscreen
— Fullscreen display of figure
'off'
(default) | 'on'
Fullscreen display of figure, specified as 'on'
or
'off'
.
Headlight
— Headlight from camera
'on'
(default) | '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
— Lighting effect
'on'
(default) | 'off'
Lighting effect, specified as 'on'
or
'off'
. If you specify 'off'
,
the camera does not emit light and the scene can appear dark.
MaxTextureSize
— Maximum pixel size of textures
'auto'
(default) | integer in a power of 2
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
— Name of figure
string
Name of figure, specified as a string.
NavMode
— Navigation mode
'examine'
(default) | 'fly'
| 'walk'
| 'none'
Navigation mode, specified as 'examine'
,
'fly'
, 'walk'
, or
'none'
. See Mouse Navigation.
NavPanel
— Navigation panel appearance
'none'
(default) | 'halfbar'
| 'bar'
| 'opaque'
| 'translucent'
Navigation panel appearance, specified as 'none'
,
'halfbar'
, 'bar'
,
'opaque'
, or
'translucent'
.
Navspeed
— Navigation speed
'normal'
(default) | 'slow'
| 'veryslow'
| 'fast'
| 'veryfast'
Navigation speed, specified as 'normal'
,
'slow'
, 'veryslow'
,
'fast'
, or 'veryfast'
.
NavZones
— Navigation zones display
'off'
(default) | 'on'
Navigation zones display, specified as 'on'
or
'off'
.
Position
— Figure location and size
vector with four doubles
Location and size of virtual figure, specified as the vector in the
form [left bottom width height]
. Specify measurements
in pixels.
Element | Description |
---|---|
left | Distance 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. |
bottom | Distance 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. |
width | Distance between the right and left inner edges of the figure. |
height | Distance 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
Record2D
— 2-D offline animation file recording
'off'
(default) | 'on'
2-D offline animation file recording, specified as
'on'
or 'off'
.
Record2DCompressMethod
— Compression method for creating 2-D animation files
'auto'
(default) | ''
| 'lossless'
| 'none'
| string with name of a compression method
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.
Record2DCompressQuality
— Quality of 2-D animation file compression
75
(default) | floating point number from 0 through 100, inclusive
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
Record2DFileName
— Name of 2-D offline animation file
string
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.
Record2DFPS
— Playback rate for 2-D offline animation file
'auto'
(default) | scalar
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
Rendering
— Render vrfigure
object in Simulink 3D Animation Viewer
'on'
(default) | 'off'
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
— Sound effects
'on'
(default) | 'off'
Sound effects, specified as 'on'
or
'off'
.
StatusBar
— Status bar display
'on'
(default) | 'off'
Status bar display, specified as 'on'
or
'off'
.
Stereo3D
— Stereoscopic vision mode
'off'
(default) | 'anaglyph'
| 'active'
| vr.utils.stereo3d
object
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.
Stereo3DCameraOffset
— Distance of left and right camera for stereoscopic vision
vector of three doubles
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.
Stereo3DHIT
— Horizontal image translation (HIT) of two stereoscopic images
double from 0 to 1
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.
Textures
— Texture use
'on'
(default) | 'off'
Texture use, specified as 'on'
or
'off'
.
Toolbar
— Toolbar display
'on'
(default) | 'off'
Toolbar display, specified as 'on'
or
'off'
.
Tooltips
— Tooltips display
'on'
(default) | 'off'
Tooltips display, specified as 'on'
or
'off'
.
Transparency
— Transparency effect
'on'
(default) | 'off'
Transparency effect, specified as 'on'
or
'off'
.
Viewpoint
— Active viewpoint of figure
string
Active viewpoint of a figure, specified as a string. If the active viewpoint has no description, use an empty string.
Wireframe
— Wireframe display
'off'
(default) | 'on'
Wireframe display, specified as 'on'
or
'off'
.
ZoomFactor
— Camera zoom factor
1 (default) | floating-point number
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
Set Property Values of Figure
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 R2006aR2023b: 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.
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)