| Virtual Reality Toolbox™ | ![]() |
set(vrfigure_object, 'property_name', property_value)
vrfigure_object | Name of a vrfigure object. |
property_name | Name of the property you want to set. |
property_value | New value of the property. |
The set(vrfigure_object) method allows you to set the property value of a vrfigure object. This method is useful when you want to change the value of a property.
The following are properties of vrfigure objects.
| Property | Value | Description |
|---|---|---|
Antialiasing | 'off' | 'on' Default: 'off' | Determines whether antialiasing is used when rendering scene. Antialiasing smooths textures by interpolating values between texture points. Read/write. |
CameraBound | 'off' | 'on' Default: 'on' | Controls whether or not the camera moves with the current viewpoint. Read/write. |
CameraDirection | Vector of three doubles | Specifies the camera direction relative to the direction of the current viewpoint. Read/write. |
CameraDirectionAbs | Vector of three doubles | Specifies the camera direction in world coordinates. Read only. |
CameraPosition | Vector of three doubles | Specifies the camera position relative to the position of the current viewpoint. Read/write. |
CameraPositionAbs | Vector of three doubles | Specifies the camera position in world coordinates. Read only. |
CameraUpVector | Vector of three doubles | Specifies the camera up vector relative to the up vector of the current viewpoint. Read/write. |
CameraUpVectorAbs | Vector of three doubles | Specifies the camera up vector in world coordinates. Read only. |
CaptureFileFormat | 'tif' | 'png' Default: 'tif' | Specifies file format for a captured frame file. Read/write. |
CaptureFileName | String. Default: '%f_anim_%n.ext' | Specifies the frame capture filename. The string can contain tokens that are replaced by the corresponding information when the frame capture takes place. For further details, see Frame Capture and Animation Recording File Tokens. Read/write. |
DeleteFcn | String | Specifies the callback invoked when closing the vrfigure object. Read/write. |
Headlight | 'off' | 'on' Default: 'on' | Turns the headlight on or off. Read/write. |
Lighting | 'off' | 'on' Default: 'on' | Specifies whether the lighting is taken into account when rendering. If it is off, all the objects are drawn as if uniformly lit. Read/write. |
MaxTextureSize | 'auto' | 32 <= x <= video card limit, where x is a power of 2 (video card limit is typically 1024 or 2048) | Sets the maximum pixel size of a texture used in rendering vrfigure objects. The smaller the size, the faster the texture can render. Increasing this value improves image quality but decreases performance. A value of 'auto' sets the maximum possible pixel size. If the value you enter is unsuitable, a warning might trigger. The Virtual Reality Toolbox software then automatically adjusts the property to the next smaller suitable value. |
Name | String | Specifies the name of this vrfigure object. Read/write. |
NavMode | 'fly' | 'examine' | 'walk' Default: 'examine' | Specifies navigation mode. Read/write. |
NavPanel | 'opaque' | 'translucent' | 'none' | 'halfbar' | 'bar' Default: 'halfbar' | Controls the appearance of the navigation panel in the Virtual Reality Toolbox viewer. Read/write. |
NavSpeed | 'very slow' | 'slow' | 'normal' | 'fast' | 'very fast' Default: 'normal' | Specifies navigation speed. Read/write. |
NavZones | 'off' | 'on' Default: 'off' | Toggles navigation zones on/off. Read/write. |
Position | Vector of four doubles | Specifies the screen coordinates of this vrfigure object. Read/write. |
Record2D | 'off' | 'on' Default: 'off' | Enables 2-D offline animation file recording. Read/write. |
Record2DCompress | '' | 'auto' | 'lossless' | 'codec_code' Default: 'auto' | Specifies the compression method for creating 2-D animation files. The codec code must be registered in the system. See the MATLAB function documentation for avifile. Read/write. |
Record2DCompress | 0-100 Default: '75' | Specifies the quality of 2-D animation file compression. Read/write. |
Record2DFileName | String. Default: '%f_anim_%n.ext' | Specifies the 2-D offline animation filename. The string can contain tokens that are replaced by the corresponding information when the animation recording takes place. For further details, see Animation Recording File Tokens. Read/write. |
StatusBar | 'off' | 'on' Default: 'on' | Toggles the status bar at the bottom of the Virtual Reality Toolbox viewer. Read/write. |
Textures | 'off' | 'on' Default: 'on' | Turns texture rendering on or off. Read/write. |
Toolbar | 'off' | 'on' Default: 'on' | Toggles toolbar on the Virtual Reality Toolbox viewer. Read/write. |
Transparency | 'off' | 'on' Default: 'on' | Specifies whether or not transparency information is taken into account when rendering. Read/write. |
Viewpoint | String. If active viewpoint does not have a name, value is empty. | Specifies the vrfigure object's active viewpoint. Read/write. |
Wireframe | 'off' | 'on' Default: 'off' | Specifies whether objects are drawn as solids or wireframes. Read/write. |
World | vrworld object | Specifies the world this vrfigure object is displaying. Read only. |
ZoomFactor | Double | Specifies the camera zoom factor. Read/write. |
Create a vrworld object.
myworld = vrworld('vrmount.wrl');
The vrworld object myworld is associated with the virtual world vrmount.wrl. Open the world:
open(myworld)
Create a vrfigure object:
f = vrfigure(myworld);
The VR Car in the Mountains virtual world opens in the Virtual Reality Toolbox viewer. You can now set the object properties of the vrfigure object f:
set(f,'Name','Car on a Mountain Road')
You can see that the name of the virtual world has changed in the viewer.
![]() | vrfigure/isvalid | vrgcbf | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |