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 Windows® platforms, you can also use Ligos® V-Realm Builder software to create and edit code. For information on using V-Realm Builder software with the Simulink 3D Animation product, see Ligos V-Realm Builder.
For details about specifying an editor, see Set the Default Editor.
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):
In MATLAB, select Preferences > Editor/Debugger > Language.
In the Editor/Debugger Language Preferences dialog box, set the Language field to
Change the highlighting properties that you want.
For X3D syntax highlighting, set Language to
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 two native VRML and X3D editors:
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 Supportand X3D Support.
The 3D World Editor interface provides three 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.
Ligos V-Realm Builder
The Ligos V-Realm Builder interface is available only for Windows operating systems.
The V-Realm Builder application is a flexible, graphically oriented tool for 3-D editing. It provides similar functionality as the 3D World Editor.
The V-Realm Builder offers these features that the 3D World Editor does not:
Manipulators — for dragging objects in the 3–D world
Keyframe animation — animation involving interpolated linear movements
Compared to the 3D World Editor, the V-Realm Editor interface:
Supports only VRML, not X3D
Provides dialog boxes for editing properties, which can be less streamlined than the 3D World Editor object properties edit pane
Does not always render virtual worlds the same way as the viewer
Does not support rendering inlined objects
For more information about the V-Realm Editor, see V-Realm Builder Help.
Set the Default Editor
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:
From the MATLAB Toolstrip, in the Home tab, in the Environment section, select Preferences > Simulink 3D Animation.
In the Simulink 3D Animation Preferences dialog box, examine the 3D World Editor preference.
You can use the 3D Word Editor preference to select another
editor: the V-Realm Builder, 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
To determine which editor is installed, at the MATLAB command prompt, type:
The default is the 3D World Editor (
*BUILTIN). To change the editor, use the
vrsetprefcommand, specifying the editor that you want. For example, to change to the V-Realm editor, type:
To open a file in the V-Realm editor, in MATLAB navigate to a virtual world file, right-click, and select Edit.
vreditcommand opens the 3D World Editor, regardless of the default editor preference setting.