Main Content


Convert VR coordinates to MATLAB coordinates

Since R2019a



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


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 MATLAB coordinates, 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.

Version History

Introduced in R2019a