Go to Home Go to About
Go to Products Go to Contact
Go to News
Go to Services

Overloaded Set and Get

Both the SET and GET commands are overloaded for VRo objects.

Objects exposed using the MATLAB Plug-in

For objects exposed using the MATLAB Plug-in, SET and GET are used in the same fashion as working with Handle Graphics. By passing a VRo object (loaded using vroload) to the set command, its type, name, and exposed properties are displayed:

>> set(VRobj)

Type: MatlabSphere

Name: RedBall

Properties: Translation (Vect3D)

In the above example, a Sphere object named RedBall has its Translation property exposed.

To control the object, do the following:

>> set(VRobj, 'Translation', [0, 5.6, 2.3])

To retrieve values from the VR object, do the following:

>> VRTrans = get(VRobj, 'Translation')


Objects controlled through a WorldUp subroutine

For objects controlled through a WorldUp subroutine, SET is used in the same fashion as working with Handle Graphics. By passing a VRo object (loaded using vroload) to the set command, its type, name, and inputs are displayed:

>> set(VRobj)

Type: Script

Name: moveblock

Inputs: Block X

Block Y

Block Z

In the above example, a Script named moveblock accepts three inputs.

To pass values to this script to control the object, do the following:

>>set(VRobj, 'Inputs', [0, 5.6, 2.3])

GET does not work with script objects.

MATLAB, Simulink, and Handle Graphics are trademarks of The MathWorks, Inc.