Set the Default Viewer

If you have an HTML5–enabled web browser, it is possible to view virtual worlds with either the Simulink® 3D Animation™ Viewer or your web browser. You determine the viewer used to display your scene using the vrsetpref and vrgetpref commands. (Alternatively, if you want to use the MATLAB® File menu Preferences dialog box, see Set Simulink 3D Animation Preferences.)

The following procedure describes how to set the viewer to the Simulink 3D Animation Viewer or the Web browser. It assumes that you are working with a PC platform.

  1. Determine your default viewer by typing


    The MATLAB Command Window displays

    ans = 
                                DataTypeBool: 'logical'
                               DataTypeInt32: 'double'
                               DataTypeFloat: 'double'
                       DefaultCanvasNavPanel: 'opaque'
                          DefaultCanvasUnits: 'normalized'
                       DefaultEditorPosition: [822 123 661 703]
                          DefaultEditorTriad: 'bottomleft'
                   DefaultFigureAntialiasing: 'on'
              DefaultFigureCaptureFileFormat: 'tif'
                DefaultFigureCaptureFileName: '%f_anim_%n.tif'
                      DefaultFigureDeleteFcn: ''
                       DefaultFigureLighting: 'on'
                 DefaultFigureMaxTextureSize: 'auto'
                       DefaultFigureNavPanel: 'halfbar'
                       DefaultFigureNavZones: 'off'
                       DefaultFigurePosition: [5 92 576 380]
         DefaultFigureRecord2DCompressMethod: 'auto'
        DefaultFigureRecord2DCompressQuality: 75
               DefaultFigureRecord2DFileName: '%f_anim_%n.avi'
                    DefaultFigureRecord2DFPS: 15
                      DefaultFigureStatusBar: 'on'
                       DefaultFigureTextures: 'on'
                        DefaultFigureToolBar: 'on'
                       DefaultFigureTooltips: 'on'
                   DefaultFigureTransparency: 'on'
                          DefaultFigureTriad: 'none'
                      DefaultFigureWireframe: 'off'
                               DefaultViewer: 'internal'
                DefaultWorldRecord3DFileName: '%f_anim_%n.wrl'
                      DefaultWorldRecordMode: 'manual'
                  DefaultWorldRecordInterval: [0 0]
                      DefaultWorldRemoteView: 'off'
                      DefaultWorldTimeSource: 'external'
                                      Editor: '*BUILTIN'
                        EditorPreserveLayout: 'off'
                          EditorSavePosition: 'on'
                                    HttpPort: 8123
                             TransportBuffer: 5
                            TransportTimeout: 20
                                      VrPort: 8124

The DefaultViewer property is set to 'internal'. The Simulink 3D Animation Viewer is the default viewer for viewing virtual worlds. Any virtual worlds that you open are displayed in the viewer.

  1. For example, at the MATLAB command prompt, type


    The Planets example is loaded and the virtual world is displayed in the Simulink 3D Animation Viewer.

  2. To view the virtual world through the Web browser from the MATLAB command prompt, you can use view and vrview commands.

  3. Reset the Simulink 3D Animation Viewer as your default viewer by typing:

Was this topic helpful?