How do I add input to VR sink?

11 views (last 30 days)
chen xizi
chen xizi on 1 Sep 2017
Edited: J Chen on 23 Dec 2020
I tried to do a simple motion simulation using the simulink and the 3D animation today, everything was fine until I found the small triangular shape on the VR sink block isn't there.
So I found that when I am trying to add the translation of my VR sphere I created earlier, I followed the instructions in the tutorials and I reached this stage:
all nodes in the box on the right is crossed out and I was unable to select any of them. I am using Matlab R2014a, not sure what caused the problem.

Answers (4)

Jan
Jan on 23 Nov 2017
Hi Chen,
Simulink 3D Animation requires that all nodes in the virtual world we want to interact with have to be named using the DEF clause. In your example, instead of
Transform {
you will have to add the DEF name:
DEF Robot_Arm1 Transform {
Here it is described how to do it manually and using 3D World Editor Edit Name function:
https://www.mathworks.com/help/sl3d/modify-the-cad-model-virtual-world.html
https://www.mathworks.com/help/sl3d/example-of-building-a-virtual-world-and-connecting-it-to-a-simulink-model.html#bsnxx0j-1
Hope this helps,
Jan

Aishwarya Rao
Aishwarya Rao on 19 Feb 2020
Hi
Greetings for the day!!
I have encountered the similar problem. I installed the simulink VR in R2019b version. Whenever I open the VR sink and opt for New file, I am unable to see any Geometry options. The window looks like this. Kindly suggest solution.

Jan
Jan on 19 Feb 2020
Hi Aishwarya,
When you create an object in the virtual world, you have to follow the X3D / VRML object hierarchy, described here:
https://www.web3d.org/documents/specifications/14772/V2.0/part1/concepts.html#4.6.3
You cannot just insert a Geometry node in the root of the scene. You need to create first the "Shape" node and place the geometry (geometric primitive, IndexedFacesSet etc.) in the geometry field of that Shape. I know it sounds complicated, but this approach allows for creating also complex scenes within unified, standardized framework.
When you try to insert a geometric primitive geometry into a part of the scene tree where it doesn't belong, this option is grayed out in the 3D World Editor. Please create first the Shape, then you can insert geometry in its Geometry field, as on the first screenshot below.
In order to make creating scenes more user-friendly, we have library of objects, where all necessary object properties are predefined and you can just place them where you need and customize it (give the DEF name, change color, size, etc.).
Instead of using:
Nodes - Add - Geometry - Box
you can insert a box in the scene this way:
Nodes - Insert From - Component Library - Select "Shapes" - "Box.wrl"
(See the second screenshot.)
For a quick start when creating a completely new virtual world, I recommend you to use our virtual world templates:
File - New from Template - <Select the template file>
There are various Grids, Roads, an Aerodrome, etc.
I hope this helps!
All the best,
Jan
Method 1: Inserting a Box geometry in the "geometry" field of a Shape node:
Method 2 (recommended): Using 3D object Library. The Insert operation creates a Transform node with all necessary properties defined. You can change default values according to your needs.

J Chen
J Chen on 23 Dec 2020
Edited: J Chen on 23 Dec 2020
Use Nodes - Insert From - Component Library to add objects (simple shapes such as box, circle are in the Shapes folder) in the 3D editor. Make sure you name the Transform (right click and choose Edit Name). If you follow these steps, the transform parameters will be available to be selected in the VR Sink block.

Categories

Find more on Simulation in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!