Main Content

Set Simulink 3D Animation Preferences

The Simulink® 3D Animation™ software opens with default preference settings. You can change these settings so that the next time you open a Simulink 3D Animation interface, such as the 3D World Editor, the associated preferences take effect. Use one of these approaches:

  • From the MATLAB® Toolstrip, in the Home tab, in the Environment section, select Preferences > Simulink 3D Animation.

    Simulink 3D Animation preferences view dialog.

  • At the MATLAB command line, use these functions:

Tip

The preferences dialog box shows a subset of the preferences that you can set using MATLAB functions.

Simulink 3D Animation Preferences Dialog Box

The top dialog box is for general Simulink 3D Animation preferences.

PreferenceValueDescription

Default Viewer

internal | web

Default: 'internal'

Specifies which viewer is used to view a virtual world. The default Simulink 3D Animation Viewer is used when the preference is set to internal. The web browser is used when this preference is set to web.

Default Editor

Built-in 3D World Editor | MATLAB Editor | Custom

Specifies which virtual world editor to use. Path to the virtual world editor. If this path is empty, the MATLAB editor is used.

If you set the Editor as Builtin, then MATLAB uses the built-in graphical Virtual Reality 3D file editor.

The path setting is active only if you select the Custom option.

Bool

logical | char

Default: logical

Specifies the handling of the virtual world Bool data type for vrnode/setfield and vrnode/getfield. If set to logical, the virtual world Bool data type is returned as a logical value. If set to char, the Bool data type is returned 'on' or 'off'.

Int32

int32 | double

Default: double

Specifies handling of the virtual world Int32 data type for vrnode/setfield and vrnode/getfield. If set to int32, the virtual world Int32 data type is returned as 'int32'. If set to double, the Int32 data type is returned as 'double'.

Float

'single' | 'double'

Default: 'double'

Specifies the handling of the virtual world float data type for vrnode/setfield and vrnode/getfield. If set to single, the virtual world Float and Color data types are returned as 'single'. If set to double, the Float and Color data types are returned as 'double'.

HTTP Port

Numeric

Default: 8123

IP port number used to access the Simulink 3D Animation server over the web via HTTP. If you change this preference, restart the MATLAB software before the change takes effect.

VR Port

Numeric

Default: 8124

IP port used for communication between the Simulink 3D Animation server and its clients. If you change this preference, restart the MATLAB software before the change takes effect.

Transport Buffer

Numeric

Default: 5

Length of the transport buffer (network packet overlay) for communication between the Simulink 3D Animation server and its clients.

Transport Timeout

Numeric

Default: 20

Amount of time, in seconds, that the Simulink 3D Animation server waits for a reply from the client. If there is no response from the client, the Simulink 3D Animation server disconnects from the client.

3D World Editor Preferences Dialog Box

The Simulink 3D Animation preferences include the following preferences for the 3D World Editor.

PropertyValueDescription

Position

Specify the pixel location for the lower-left corner, the width, and the height (for example, [96 120 862 960]

Default: Depends on current screen resolution

Specifies the default location for the 3D World Editor. If you select Save position on exit, the default position changes to the position of the 3D World Editor used when you last exited it.

Triad

none| top left | top right | bottom left | bottom right | center

Default: 'bottom left'

Specifies where in the virtual world display pane to locate a triad of coordinate axes.

View pane mouse behavior

navigate | select

Default: navigate

Specifies whether the mouse in the view pane is in navigation mode or selection mode (for highlighting corresponding nodes in the tree view pane).

Save position on exit

off | on

Default: on

Causes the 3D World Editor to open in the same location where the editor was when you last exited it.

Preserve Layout per Virtual Reality 3D File

off | on

Default: on

Specifies whether the 3D World Editor starts up either with the default virtual world display layout or with the layout as it was when you exited it previously. The saved layout includes settings for the view, viewpoints, navigation, and rendering. Simulink 3D Animation saves the layout in a separate virtual world 3D file for up to eight files.

Highlight selected objects

off | on

Default: on

Specifies whether to highlight virtual world objects selected in the view pane.

Canvas Preferences Dialog Box

The Simulink 3D Animation preferences include a Navigation panel preference. The canvas preferences apply to the 3D World Editor, Simulink 3D Animation Viewer, and Simulink 3D Animation Web Viewer.

PropertyValueDescription

Navigation panel

none | minimized | translucent | opaque

Default: none

Controls the appearance of the navigation panel in the canvas.

Figure Appearance Preferences Dialog Box

The figure appearance preferences apply to the 3D World Editor and Simulink 3D Animation Viewer. Some of these preferences also apply to Simulink 3D Animation Web Viewer.

PropertyValueDescription

Toolbar

on | off

Default: on

Specifies whether the toolbar is displayed.

Tooltips

off | on

Default: on

Specifies whether tooltips are displayed.

Status bar

off | on

Default: on

Specifies whether status bar is displayed.

Also applies to the Simulink 3D Animation Web Viewer.

Navigation zones

off | on

Default: on

Specifies whether navigation zones are displayed.

Also applies to the Simulink 3D Animation Web Viewer.

Navigation panel

none | minimized | translucent | opaque

Default: none

Controls the appearance of the navigation panel in the canvas.

Triad

none | top left | top right | bottom left | bottom right | center

Default: bottom left

Specifies where in the virtual world display pane to locate a triad of coordinate axes.

Position

Matrix with upper-right and lower-left corner position.

Default: [5 92 576 380]

Specifies the default location of the figure window.

Figure Rendering Preferences Dialog Box

The figure rendering preferences specify how virtual worlds are displayed.

PropertyValueDescription

Antialiasing

on | off

Default: on

Determines whether antialiasing is used when rendering scene. Antialiasing smooths textures by interpolating values between texture points.

Lighting

off | on

Default: on

Specifies whether the lighting is considered when rendering. If it is off, all the objects are drawn as if uniformly lit.

Sound

off | on

Default: on

If a virtual world contains a Sound node and your computer supports sound, then you can listen to the sound in a virtual world.

Stereo 3D

off | anaglyphactive

Default: off

Specifies whether to use stereoscopic 3-D vision.

For anaglyph viewing, use red/cyan 3-D glasses. Viewing a virtual world in this mode causes the colors to appear as almost grayscale. This approach does not require any special computer hardware or software.

For active stereo viewing, use active shutter 3-D glasses. This approach preserves color effects and produces more powerful 3-D effects. Active stereo requires a specially configured computer and monitor setup.

Stereo 3D Camera Offset

Numeric

Default: 0.1

Specifies the distance between the two points of view (cameras) that produce the 3-D effect. The higher the offset, the further apart the cameras are, and thus the deeper the 3-D effect.

Stereo 3D Horizontal Image Translation

Numeric value from 0 through 1, inclusive. The larger the value, the further back the background appears to be.

Default: 0

The horizontal relationship of the two stereo images. 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.

Transparency

off | on

Default: on

Specifies whether transparency information is considered when rendering.

Wireframe

off | on

Default: off

Specifies whether objects are drawn as solids or wireframes.

Textures

off | 'on'

Default: on

Turns texture rendering on or off.

Maximum texture size

auto | 32 <= x <= video card limit, where x is a power of 2 (video card limit is typically 1024 or 2048)

Sets the maximum pixel size of a texture used in rendering vrfigure objects. The smaller the size, the faster the texture can render. Increasing this value improves image quality but decreases performance. A value of 'auto' sets the maximum pixel size. If the value you enter is unsuitable, a warning can trigger. The software then automatically adjusts the property to the next smaller suitable value.

Figure 2-D Recording Preferences Dialog Box

PropertyValueDescription
2-D animated file name

Character vector

Default: '%f_anim_%n.avi'

Specifies the 2-D offline animation file name. The name can contain tokens that are replaced by the corresponding information when the animation recording takes place. For further details, see File Name Tokens.

Recording compression method

'' | auto | lossless | codec_code

Default: auto

Specifies the compression method for creating 2-D animation files. The codec code must be registered in the system. See the MATLAB documentation for VideoWriter.

Recording compression quality

Integer 0–100.

Default: 75

Specifies the default quality of 2-D animation file compression for new vrfigure objects.

Frames per second

Numeric

Default: 15

Specifies the default frames per second playback speed.

Figure Frame Capture Preferences

PropertyValueDescription
CaptureFileFormat

tif | png

Default: tif

Specifies file format for a captured frame file.

CaptureFileName

Character vector

Default: '%f_anim_%n.tif'

Specifies the frame capture file name. The name can contain tokens that are replaced by the corresponding information when the animation recording takes place. For further details, see Define File Name Tokens.

World Preferences Dialog Box

PropertyValueDescription
3-D animated file name

character vector

Default: '%f_anim_%n.%e'

3-D animation file name. The name can contain tokens that are replaced by the corresponding information when the animation recording takes place. For details, see Define File Name Tokens.

Recording mode

manual | scheduled

Default: manual

Animation recording mode.

Recording interval

Vector of two doubles

Default: [0 0]

Start and stop times for scheduled animation recording. Corresponds to the virtual world object Time property.

Time source

external | freerun

Default: external

Source of the time for the virtual world. If set to external, time in the scene is controlled from the MATLAB software (by setting the Time property) or the Simulink software (simulation time). If set to freerun, time in the scene advances independently based on the system timer.

Allowing viewing from the Internet

off | on

Default: off

Remote access flag. If the virtual world is enabled for remote viewing, it is set to on; otherwise, it is set to off.

Create or update world thumbnail file when world is opened

off | on

Default: off

Specify whether create world thumbnails when you open a virtual world.

See Also

Functions

Related Topics