ebook img

Simulink 3D Animation User's Guide - MathWorks PDF

534 Pages·2016·5.82 MB·English
by  
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Simulink 3D Animation User's Guide - MathWorks

® Simulink 3D Animation™ User's Guide R2017a How to Contact MathWorks Latest news: www.mathworks.com Sales and services: www.mathworks.com/sales_and_services User community: www.mathworks.com/matlabcentral Technical support: www.mathworks.com/support/contact_us Phone: 508-647-7000 The MathWorks, Inc. 3 Apple Hill Drive Natick, MA 01760-2098 ® Simulink 3D Animation™ User's Guide © COPYRIGHT 2001–2017 by HUMUSOFT s.r.o. and The MathWorks, Inc. The software described in this document is furnished under a license agreement. The software may be used or copied only under the terms of the license agreement. No part of this manual may be photocopied or reproduced in any form without prior written consent from The MathWorks, Inc. FEDERAL ACQUISITION: This provision applies to all acquisitions of the Program and Documentation by, for, or through the federal government of the United States. By accepting delivery of the Program or Documentation, the government hereby agrees that this software or documentation qualifies as commercial computer software or commercial computer software documentation as such terms are used or defined in FAR 12.212, DFARS Part 227.72, and DFARS 252.227-7014. Accordingly, the terms and conditions of this Agreement and only those rights specified in this Agreement, shall pertain to and govern the use, modification, reproduction, release, performance, display, and disclosure of the Program and Documentation by the federal government (or other entity acquiring for or through the federal government) and shall supersede any conflicting contractual terms or conditions. If this License fails to meet the government's needs or is inconsistent in any respect with federal procurement law, the government agrees to return the Program and Documentation, unused, to The MathWorks, Inc. Trademarks MATLAB and Simulink are registered trademarks of The MathWorks, Inc. See www.mathworks.com/trademarks for a list of additional trademarks. Other product or brand names may be trademarks or registered trademarks of their respective holders. Patents MathWorks products are protected by one or more U.S. patents. Please see www.mathworks.com/patents for more information. Revision History August 2001 First printing New for Version 2.0 (Release 12.1) July 2002 Second printing Revised for Version 3.0 (Release 13) October 2002 Online only Revised for Version 3.1 (Release 13) June 2004 Third printing Revised for Version 4.0 (Release 14) October 2004 Fourth printing Revised for Version 4.0.1 (Release 14SP1) March 2005 Online only Revised for Version 4.1 (Release 14SP2) April 2005 Online only Revised for Version 4.2 (Release 14SP2+) September 2005 Online only Minor revision for Version 4.2.1 (Release 14SP3) March 2006 Online only Revised for Version 4.3 (Release 2006a) September 2006 Online only Revised for Version 4.4 (Release 2006b) March 2007 Online only Revised for Version 4.5 (Release 2007a) September 2007 Online only Revised for Version 4.6 (Release 2007b) March 2008 Online only Revised for Version 4.7 (Release 2008a) October 2008 Online only Revised for Version 4.8 (Release 2008b) March 2009 Online only Revised for Version 5.0 (Release 2009a) March 2010 Online only Revised for Version 5.1.1 (Release 2010a) September 2010 Online only Revised for Version 5.2 (Release 2010b) April 2011 Online only Revised for Version 5.3 (Release 2011a) September 2011 Online only Revised for Version 6.0 (Release 2011b) March 2012 Online only Revised for Version 6.1 (Release 2012a) September 2012 Online only Revised for Version 6.2 (Release 2012b) March 2013 Online only Revised for Version 6.3 (Release 2013a) September 2013 Online only Revised for Version 7.0 (Release 2013b) March 2014 Online only Revised for Version 7.1 (Release 2014a) October 2014 Online only Revised for Version 7.2 (Release 2014b) March 2015 Online only Revised for Version 7.3 (Release 2015a) September 2015 Online only Revised for Version 7.4 (Release 2015b) March 2016 Online only Revised for Version 7.5 (Release 2016a) September 2016 Online only Revised for Version 7.6 (Release 2016b) March 2017 Online only Revised for Version 7.7 (Release 2017a) Contents Getting Started 1 Simulink 3D Animation Product Description . . . . . . . . . . . . 1-2 Key Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-2 Expected Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-3 Build Virtual Worlds to Visualize Dynamic Simulations . . . 1-4 Virtual Reality World Models of Dynamic Systems . . . . . . . . 1-4 Set up Your Working Environment . . . . . . . . . . . . . . . . . . . . 1-4 Build a Virtual Reality World . . . . . . . . . . . . . . . . . . . . . . . . 1-6 Link to a Virtual Reality World . . . . . . . . . . . . . . . . . . . . . . 1-7 View Dynamic System Simulations . . . . . . . . . . . . . . . . . . . . 1-8 Share Dynamic System Simulation Visualizations . . . . . . . . 1-8 MATLAB Compiler Support . . . . . . . . . . . . . . . . . . . . . . . . . . 1-10 X3D Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-11 X3D . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-11 Relationship of X3D and VRML . . . . . . . . . . . . . . . . . . . . . 1-11 X3D Support in Simulink 3D Animation . . . . . . . . . . . . . . . 1-12 Convert a VRML File to X3D Format . . . . . . . . . . . . . . . . . 1-12 Virtual Reality Modeling Language (VRML) . . . . . . . . . . . . 1-14 Relationship of VRML and X3D . . . . . . . . . . . . . . . . . . . . . 1-14 VRML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-14 VRML Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-14 VRML Compatibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-16 VRML Coordinate System . . . . . . . . . . . . . . . . . . . . . . . . . . 1-17 VRML File Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-18 Virtual Reality World and Dynamic System Examples . . . . 1-22 Simulink Interface Examples . . . . . . . . . . . . . . . . . . . . . . . 1-22 MATLAB Interface Examples . . . . . . . . . . . . . . . . . . . . . . . 1-34 v Installation 2 Set the Default Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2 Use Preferences to Set the Default Editor . . . . . . . . . . . . . . . 2-2 Use MATLAB Commands to Set the Default Editor . . . . . . . 2-3 Set the Default Viewer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-5 Set Simulink 3D Animation Preferences . . . . . . . . . . . . . . . . 2-9 Simulink 3D Animation Preferences Dialog Box . . . . . . . . . 2-11 3D World Editor Preferences Dialog Box . . . . . . . . . . . . . . . 2-12 Canvas Preferences Dialog Box . . . . . . . . . . . . . . . . . . . . . . 2-14 Figure Appearance Preferences Dialog Box . . . . . . . . . . . . . 2-14 Figure Rendering Preferences Dialog Box . . . . . . . . . . . . . . 2-15 Figure 2-D Recording Preferences Dialog Box . . . . . . . . . . . 2-17 Figure Frame Capture Preferences . . . . . . . . . . . . . . . . . . . 2-18 World Preferences Dialog Box . . . . . . . . . . . . . . . . . . . . . . . 2-18 Install V-Realm Editor on Host Computer . . . . . . . . . . . . . . 2-20 V-Realm Editor Installation on Windows Platforms . . . . . . . 2-20 V-Realm Builder Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-22 Uninstall V-Realm Builder . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-23 Test the Viewer Installation . . . . . . . . . . . . . . . . . . . . . . . . . . 2-24 Section Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-24 Simulink Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-24 MATLAB Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-29 Simulink Interface 3 Virtual World Connection to a Model . . . . . . . . . . . . . . . . . . . 3-2 Add a Simulink 3D Animation Block . . . . . . . . . . . . . . . . . . 3-2 Change the Virtual World Associated with a Simulink Block . 3-8 Open a Viewer Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-11 vi Contents Display Virtual World and Start Simulation . . . . . . . . . . . . 3-12 View Virtual World on Host Computer . . . . . . . . . . . . . . . . . 3-15 View Virtual World Remotely . . . . . . . . . . . . . . . . . . . . . . . . 3-19 Add Sensors to Virtual Worlds . . . . . . . . . . . . . . . . . . . . . . . . 3-25 Modify Remote Virtual World Via Sensor Events . . . . . . . . 3-26 Read Sensor Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-27 Reading Sensor Values Example . . . . . . . . . . . . . . . . . . . . . 3-27 VR Source Block Input to Simulink Models . . . . . . . . . . . . . 3-29 Interact with Generated Code . . . . . . . . . . . . . . . . . . . . . . . . 3-30 MATLAB Interface 4 Create vrworld Object for a Virtual World . . . . . . . . . . . . . . 4-2 Open a Virtual World with MATLAB . . . . . . . . . . . . . . . . . . . 4-4 Interact with a Virtual World with MATLAB . . . . . . . . . . . . . 4-6 Close and Delete a vrworld Object . . . . . . . . . . . . . . . . . . . . 4-10 Animation Recording . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-11 Recording Formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-11 Manual and Scheduled Animation Recording . . . . . . . . . . . 4-12 Define File Name Tokens . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-13 Default File Name Format . . . . . . . . . . . . . . . . . . . . . . . . . 4-13 Uses for File Name Tokens . . . . . . . . . . . . . . . . . . . . . . . . . 4-13 File Name Tokens . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-15 Manual 3-D Recording with MATLAB . . . . . . . . . . . . . . . . . . 4-17 vii Manual 2-D AVI Recording with MATLAB . . . . . . . . . . . . . . 4-20 Scheduled 3-D Recording with MATLAB . . . . . . . . . . . . . . . 4-23 Scheduled 2-D AVI Recording with MATLAB . . . . . . . . . . . 4-26 Record Animations for Unconnected Virtual Worlds . . . . . 4-29 Play Animation Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-32 Play Virtual World Animation Files . . . . . . . . . . . . . . . . . . 4-32 Play AVI Animation Files . . . . . . . . . . . . . . . . . . . . . . . . . . 4-33 Build Virtual Reality Worlds 5 Virtual World Editors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-2 Editors for Virtual Worlds . . . . . . . . . . . . . . . . . . . . . . . . . . 5-2 Build and Connect a Virtual World . . . . . . . . . . . . . . . . . . . . . 5-7 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-7 Define the Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-7 Add a Simulink 3D Animation Block . . . . . . . . . . . . . . . . . . 5-9 Open a New Virtual World . . . . . . . . . . . . . . . . . . . . . . . . . 5-10 Add Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-11 Link to a Simulink Model . . . . . . . . . . . . . . . . . . . . . . . . . . 5-20 Virtual World Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-25 Field Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-25 Virtual World Data Class Types . . . . . . . . . . . . . . . . . . . . . 5-27 Simulink 3D Animation Textures . . . . . . . . . . . . . . . . . . . . . 5-30 Add Sound to a Virtual World . . . . . . . . . . . . . . . . . . . . . . . . 5-31 Use CAD Models with the Simulink 3D Animation Product 5-32 Use of CAD Designs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-32 Import CAD Designs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-32 Integrate the Imported Model Virtual World . . . . . . . . . . . . 5-33 viii Contents Import STL and Physical Modeling XML Files . . . . . . . . . . 5-34 Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-34 Import VRML Models from CAD Tools . . . . . . . . . . . . . . . . . 5-36 VRML Format Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-36 Level of Detail Considerations . . . . . . . . . . . . . . . . . . . . . . . 5-37 Units Used in Exported Files . . . . . . . . . . . . . . . . . . . . . . . 5-37 Coordinate System Used . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-38 Assembly Hierarchy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-38 Import VRML Models from CATIA Software . . . . . . . . . . . . 5-45 CATIA Coordinate Systems . . . . . . . . . . . . . . . . . . . . . . . . . 5-45 Settings That Affect the VRML Output . . . . . . . . . . . . . . . . 5-46 Level of Detail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-46 VRML Export Filter Settings . . . . . . . . . . . . . . . . . . . . . . . 5-46 VRML Models Exported from the CATIA Environment . . . . 5-47 Adjusting Resulting VRML Files . . . . . . . . . . . . . . . . . . . . . 5-50 Modify the CAD Model Virtual World . . . . . . . . . . . . . . . . . . 5-52 Wrap Shape Objects with Transforms . . . . . . . . . . . . . . . . . 5-52 Add DEF Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-52 Additional Virtual World Modifications . . . . . . . . . . . . . . . . 5-53 Import Visual Representations of Robot Models . . . . . . . . . 5-55 Import a DAE File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-55 Import a URDF File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-57 Import an SDF File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-58 Define Viewpoint to Make Imported Model Visible . . . . . . . 5-61 Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-61 Link to Simulink and Simscape Multibody Models . . . . . . . 5-62 Link the Virtual World to a Simulink Model . . . . . . . . . . . . 5-62 Initial Conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-64 VR Placeholder and VR Signal Expander Blocks . . . . . . . . . 5-65 Link to Simscape Multibody Models . . . . . . . . . . . . . . . . . . 5-65 Link to a MATLAB Model . . . . . . . . . . . . . . . . . . . . . . . . . . 5-67 ix Using the 3D World Editor 6 3D World Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-2 Supported Platforms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-2 Use with Other Editors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-2 VRML and X3D Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-2 Nodes, Library Objects, and Templates . . . . . . . . . . . . . . . . . 6-3 Open the 3D World Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-5 3D World Editor Is the Default Editor . . . . . . . . . . . . . . . . . 6-5 Open an Empty Virtual World . . . . . . . . . . . . . . . . . . . . . . . 6-5 Open a Saved Virtual World . . . . . . . . . . . . . . . . . . . . . . . . . 6-6 Preferences for 3D World Editor Startup . . . . . . . . . . . . . . . 6-6 3D World Editor Panes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-8 Tree Structure Pane Icons . . . . . . . . . . . . . . . . . . . . . . . . . . 6-9 Create a Virtual World . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-10 Basic Editing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-12 Add Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-12 Copy and Paste a Node . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-13 Edit Object Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-14 Document a Virtual World Using Comments . . . . . . . . . . . . 6-16 Display Event Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-16 Expand and Collapse Nodes . . . . . . . . . . . . . . . . . . . . . . . . 6-17 Highlight Nodes and Virtual World Objects . . . . . . . . . . . . 6-17 Wrap Nodes as Children of Another Node . . . . . . . . . . . . . . 6-19 Remove Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-20 Save and Export Virtual World 3D Files . . . . . . . . . . . . . . . 6-21 Edit VRML and X3D Scripts . . . . . . . . . . . . . . . . . . . . . . . . 6-21 Reduce Number of Polygons for Shapes . . . . . . . . . . . . . . . . 6-24 Virtual World Navigation in 3D World Editor . . . . . . . . . . . 6-25 Specify Virtual World Rendering . . . . . . . . . . . . . . . . . . . . . 6-25 Basic Navigation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-25 Coordinate Axes Triad . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-25 View Panes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-26 Pivot Point . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-28 x Contents

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.