Skip to Main Content Skip to Search
Product Documentation

Basic Editing

This section describes how to use the 3D World Editor for common tasks involved in creating a virtual world.

For information about opening a file in the editor, see Getting Started with the 3D World Editor.

For a step-by-step tutorial, see Example of Building a Virtual World and Connecting It to a Simulink Model.

Adding Objects

Add virtual world objects by adding nodes in the tree structure pane.

The hierarchy of nodes controls the scope to which node properties apply.

Approaches for Adding Objects

Use one of these approaches to add a node.

ApproachProcedure
Use the Nodes menu
  1. In the tree structure pane, select the parent node for the object that you want to add.

  2. Select the Nodes > Add menu item.

  3. Select appropriate submenus to add the node that you want.

Use a context menu for a node
  1. In the tree structure pane, right-click the parent node for the object that you want to add.

  2. Select the Add Node menu, and select appropriate submenus to add the node that you want.

Insert an object from a library

For Material, Texture, and children nodes, select the Insert From menu option (from either the Nodes menu or from the context menu for a node).

For information about library objects, see 3D World Editor Library.

Add an inlined VRML fileFor a ROOT or children node, from the Nodes menu or the context menu for the node, select the Inline VRML File menu item.

The node that you add gets added to different locations in the hierarchy, depending on the node that you select to begin the process of adding a node.

Selected NodeLocation of Added Node
ROOTAt the bottom of the hierarchy
Node at the next level down from the ROOT node (for example, a Transform node.Above the selected node
A children nodeUnder the children node (as a child node of the selected node)

Copying and Pasting a Node

You can copy a node below a top-level Transform node and paste that copied node to be a child of another node, including the ROOT node.

You can paste the copied node as an explicit text copy (Paste) either a referenced copy (Paste As Reference).

To copy and paste a node:

  1. In the tree structure pane, select the node that you want to copy.

  2. Copy the node, using one of these techniques:

    • Select the Edit > Copy menu item.

    • Right-click the node and select the Copy menu item.

  3. Under the appropriate node, paste the copied node.

    • Paste the node using one of the following techniques:

      • Select the Edit > Paste or Paste As Reference menu item.

      • Right-click the parent node and select the Paste Node menu item, and then select Paste or Paste As Reference.

Copying and Pasting Between Virtual Worlds

In the same editing session, you can copy nodes from a virtual world in one VRML file to another virtual world in a different VRML file. After you copy the nodes from one virtual world, select File > Open to open the second VRML file where you want to paste the nodes.

Editing Object Properties

To define the characteristics of an object, in the tree structure pane, select the appropriate property . At the bottom of the 3D World Editor, use the object properties edit pane to change property values. Then click Apply.

The tree structure pane shows the current property values, which reflect edits that you make to properties.

Setting Viewpoint Values in the 3D World Editor Based on Camera Position

You can use the current camera position to interactively specify a viewpoint in the 3D World Editor.

  1. Navigate to a desired position in the scene.

  2. In the tree structure pane, right-click a Viewpoint node.

  3. Select Copy values from current camera.

Documenting a Virtual World Using Comments

To document the virtual world, in the object property edit pane, use the Comments tab for nodes and properties. Comments can help others understand the design of a virtual world.

Comments do not appear in the virtual world. They appear in the VRML file, next to the given node or property, on lines that begin with #.

Expanding and Collapsing Nodes

To expand a node in the tree structure pane, click the plus (+) sign to the left of the node. To collapse a node, click the minus (-) sign to the left of the node.

To expand or collapse all nodes in one step, select Tree > Expand All or Tree > Collapse All.

Hiding Default Values

To simplify the tree view, you can hide default VRML values. Select the Tree > Hide Default Values menu item. To display default values, clear the Hide Default Values option.

Removing a Node

To delete a node, select the node and use one of these methods:

From the Edit menu, you can also delete a specific child node or all the children nodes of a selected parent node, without deleting the parent node.

To cut a node and save it to the clipboard, select the node and use one of these techniques:

Saving and Exporting Virtual World Files

You can save your virtual world files as VRML (.wrl) files using the File > Save or File > Save As menu items.

If you use the Save option, the 3D World Editor renames the previous version of the file by appending .bak after the .wrl extension.

If you use the Save As option, the 3D World Editor saves the file using the new name that you specify. The file is saved in a form that is supported by the Simulink 3D Animation viewer and 3D World Editor (for example, the saved file preserves links to the library texture files).

Use the File > Export menu item to export a fully VRML97–compliant file for use:

For exported files, the 3D World Editor copies referenced inlined VRML files and texture files to the <filename>_files folder. It modifies the corresponding URLs for those files, so that they point to the <filename>_files folder.

Navigating a Virtual World

You can use the virtual world display pane to visualize the virtual world as you create it.

To control navigation, right-click anywhere in the pane and select the appropriate navigation options. You can control aspects such as methods (for example, fly or walk) and speed.

To save these navigation settings in a virtual world file, you must define the navigation properties in a NavigationInfo node.

To navigate in the virtual world, left-click in the pane. The cursor changes to a white cross hair. Moving the cursor changes the orientation of the virtual world.

Coordinate Axes Triad

To help you visualize changes in the orientation (coordinate axes) of nodes in a virtual world, the 3D World Editor virtual world display pane includes a triad of red, green, and blue arrows. These arrows are always parallel with global x, y, and z coordinate axes. As you navigate in a virtual world, the triad display changes to reflect changes in orientation.

To hide the triad for a virtual world, or to change the location of the triad in the virtual world display pane, right-click in the pane and select the appropriate option from the View > Triad menu.

To change the default location or visibility of the triad:

  1. From the MATLAB desktop, select File > Preferences.

  2. In the Preferences dialog box left pane, select Simulink 3D Animation > 3D World Editor > Triad.

Specifying Virtual World Rendering

You can control the rendering used in the virtual world display pane of the 3D World Editor. Right-click in the virtual world display pane and set rendering options, such as antialiasing, lighting, and transparency.

Editing VRML Scripts

To add a VRML Script node:

  1. In the Tree structure pane, select the ROOT node.

  2. Select the appropriate kind of script, using the Node > Add > Common > Script menu.

To add Script interface elements:

  1. Right-click a Script node.

  2. Select the appropriate Add Interface Item menu option.

The following is an example of a Script node in the Tree structure pane.

To edit a url node, click the node and edit the URL code in the Object property edit pane.

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS