This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

vrcoordvr2m

Convert VR coordinates to MATLAB coordinates

Syntax

m = vrcoordvr2m(vr)

Description

example

m = vrcoordvr2m(vr) converts a point with coordinates in the Virtual World coordinate system to the MATLAB® coordinate system.

Examples

collapse all

This example creates a simple plane take-off trajectory in the virtual reality coordinate system. and plots it in MATLAB using plot3

The plane starts in the +x direction and goes up (positive values of y coordinate) in the z=0 plane. We then convert the trajectory to MATLABcoordinates, so that it can be displayed in a 3D figure using the MATLAB plot3 command.

Define a simple take-off trajectory

vrpath = [0 0 0; 1 0 0; 2 0.2 0; 3 0.5 0; 4 1 0];

Convert the path from virtual reality coordinates to MATLAB coordinates

mpath = vrcoordvr2m(vrpath);

Display the path in a 3D plot using the plot3 command

plot3 (mpath(:,1), mpath(:,2), mpath(:,3))

Input Arguments

collapse all

Coordinates of a point in VRML notation, specified as a 3-element row vector.

Data Types: double

Output Arguments

collapse all

Coordinates of a point in MATLAB notation, returned as a 3 element row vector.

Introduced in R2019a