Main Content

Choose a Virtual World Editor

The primary way to create a virtual world is with a 3-D editing tool. These tools allow you to create complex virtual worlds without a deep understanding of the VRML or X3D language. These 3-D editing tools offer the power and versatility for creating many types of practical and technical models. For example, you can import 3-D objects from some CAD packages to make the authoring process easier and more efficient.

There is more than one way to create a virtual world defined with VRML or X3D code. You can use a virtual world editor to create a virtual world without knowing anything about the VRML or X3D language. Or you can use a text editor to write code directly.

The Simulink® 3D Animation™ product includes the 3D World Editor for editing virtual worlds. You can use the 3D World Editor on all supported platforms for Simulink 3D Animation. The 3D World Editor is the default editor. For a comparison of editors, see Editors for Virtual Worlds.

Editors for Virtual Worlds

As you create a virtual world, you can use different editors for different phases of the process. Choose the editor that best meets your needs.

Some people prefer to create simple virtual worlds using MATLAB® Editor or other text editor.

For details about specifying an editor, see Set the Default Editor.

For a description of the benefits and limitations of different types of editors, see the next section.

Text Editors

A virtual world 3D file uses a standard text format that you can read with any text editor. Reading the code in a text editor is useful for debugging and for directly changing the code, and for automated processing of the code. If you use the correct syntax, you can use the MATLAB Editor or any common text editor to create virtual worlds.

Consider using a text editor to work on a virtual world when you want to:

  • Create a simple virtual world.

  • Debug syntax and formatting errors in a virtual world 3D file. Corrupted files do not open in most 3-D tools.

  • Learn about VRML and X3D syntax by using VRML and X3D syntax highlighting in the MATLAB Editor. For details, see VRML and X3D Syntax Highlighting.

  • Perform global search editing operations across one or more virtual world 3D files.

  • Combine several virtual world models. Combining models can involve temporary model inconsistencies, which most 3-D tools cannot handle.

VRML and X3D Syntax Highlighting

You can display VRML, X3DV, and X3D syntax highlighting in the MATLAB Editor.

To set MATLAB Editor properties for VRML and syntax highlighting (for example, the color for highlighting comments or not using the smart indentation feature):

  1. In MATLAB, select Preferences > Editor/Debugger > Language.

  2. In the Editor/Debugger Language Preferences dialog box, set the Language field to VRML/X3DV.

  3. Change the highlighting properties that you want.

For X3D syntax highlighting, set Language to XML/HTML.

General 3-D Editors

General 3-D editors, such as 3D Studio, SolidWorks®, or Autodesk® Maya, do not use VRML or X3D as their native format. They export their formats to VRML or X3D. These tools have many features and are relatively easy to use.

General 3-D editing tools target specific types of work. For example, they can target visual art, animation, games, or technical applications. They offer different working environments depending on the application area for which they are designed. Some of these general 3-D editing tools are powerful, expensive, and complex to learn, but others are relatively inexpensive and can satisfy your specific needs.

The graphical user interfaces for many of the commercial general 3-D editors use features typical of the native VRML or X3D editing tools. For example, in addition to displaying 3-D scenes in various ways, they offer hierarchical tree styles, providing an overview of the model structure and a shortcut to nodes.

Native VRML and X3D Editors

Native VRML and X3D editors use those languages as their native format. Native VRML editors support features that are unique to the VRML and X3D format, such as interpolators and sensors.

The Simulink 3D Animation software includes 3D World Editor, which works on all platforms supported for Simulink 3D Animation

3D World Editor

The 3D World Editor is installed as part of the Simulink 3D Animation installation. It is the default virtual world editor.

The 3D World Editor is a native VRML and X3D authoring tool that provides an interface to the syntax of those languages. The editor supports VRML97 types and language elements. For details on limitations, see VRML Support and X3D Support.

The 3D World Editor interface provides three panes.

3D world editor with tree structure, virtual world display, and object property edit panes.

  • Tree structure pane — View the hierarchy for the virtual world that you are editing. The 3D World Editor lists the nodes and their properties according to their respective node types. You can change the nesting levels of certain nodes to modify the virtual world. In the tree viewer, give the nodes unique names.

  • Virtual world display pane — Observe the virtual world as you create it. The 3D World Editor renders inlined objects (grouped objects). It uses the same renderer as the Simulink 3D Animation viewer. Using the same renderer for the editor and the viewer provides consistent navigation and display throughout the development process.

  • Object property edit pane — Change values for node items.

For details, see Build and Connect a Virtual World and 3D World Editor.

Set the Default Editor

Tip

The Simulink 3D Animation product includes the 3D World Editor for editing virtual worlds. You can use the 3D World Editor on all supported platforms for Simulink 3D Animation. The 3D World Editor is the default editor. For a comparison of editors, see Choose a Virtual World Editor.

You can change your environment to use another editor. You can use the MATLAB Preferences menu or the MATLAB command line.

Use Preferences to Set the Default Editor

To determine which virtual world editor is set up as the editor in your environment:

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

  2. In the Simulink 3D Animation Preferences dialog box, examine the 3D World Editor preference.

    MATLAB preferences dialog box.

You can use the 3D Word Editor preference to select another editor: the MATLAB editor, or a third-party virtual world editor or text editor. To use a third-party editor, select the Custom option. In the text box that appears, enter the path to the editor.

Use MATLAB Commands to Set the Default Editor

  1. To determine which editor is installed, at the MATLAB command prompt, type:

    vrgetpref('Editor')  
  2. The default is the 3D World Editor (*BUILTIN). To change the editor, use the vrsetpref command, specifying the editor that you want. For example, to change to the MATLAB editor, type:

    vrsetpref('Editor','*MATLAB') 

    Note

    The vredit command opens the 3D World Editor, regardless of the default editor preference setting.

See Also

Apps

Functions

Related Topics