Set the Default Viewer

If you install a VRML plug-in in your Web browser, it is possible to view virtual worlds with either the Simulink® 3D Animation™ Viewer, legacy 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. If you want to use the legacy Simulink 3D Animation Viewer, see Legacy Simulink 3D Animation Viewer.

  1. Determine your default viewer by typing

    vrgetpref 

    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

    vrplanets 

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

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

    vrsetpref('DefaultViewer','factory') 
  3. In the Simulink 3D Animation Viewer for vrplanets, from the Simulation menu, select Block Parameters.

    A Parameters: VR Sink dialog box opens.

    The target of the View button is determined by the DefaultViewer property. If the DefaultViewer property is set to 'internal', clicking the View button opens the virtual world in the Simulink 3D Animation Viewer. If the DefaultViewer property is set to 'web', clicking the View button opens the virtual world in your Web browser.

Was this topic helpful?