Help CenterHelp Center
Convert virtual world IndexedFaceSet nodes to MATLAB patches
IndexedFaceSet
vrifs2patch(ifs)
example
vrifs2patch(ifs) converts the ifs array of existing IndexedFaceSet nodes to MATLAB® patch objects.
ifs
Note
This function converts only geometry and color data of the source IndexedFaceSet node.
collapse all
This example uses:
This command converts three IndexedFaceSet nodes to MATLAB® patch objects.
Open virtual world containing an IndexedFaceSet node.
w1 = vrworld('*sl3dlib/objects/Components/Shapes/Torus_High.wrl'); open(w1);
View the virtual world as a virtual figure.
vrfig1 = vrfigure(w1, ... 'Name', 'Virtual world containing source IndexedFaceSet node', ... 'CameraBound', 'off', ... 'CameraPosition',[0 40 0], ... 'CameraDirection',[0 -1 0], ... 'CameraUpVector',[0 0 -1]);
vrdrawnow;
Convert the IndexedFaceSet a MATLAB patch and show it.
figure('Name', 'Resulting patch'); tp = vrifs2patch(w1.torushi.children.geometry);
Change the patch color, show the axes grid, rotate the camera, and enable mouse rotation.
tp.FaceColor = 'red'; axs = gca; axs.XGrid = 'on'; axs.YGrid = 'on'; axs.ZGrid = 'on'; camorbit(45, -20); rotate3d on
IndexedFaceSet nodes, specified as an array.
Introduced in R2015a
vrpatch2ifs | patch
vrpatch2ifs
patch
You have a modified version of this example. Do you want to open this example with your edits?
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office