Documentation

This is machine translation

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

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

plot::Translate3d

Translation of 3D objects

MuPAD® notebooks are not recommended. Use MATLAB® live scripts instead.

MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.

Syntax

plot::Translate3d([dx, dy, dz], obj1, <obj2, …>, <a = amin .. amax>, options)

Description

plot::Translate3d([dx, dy, dz], object) shifts a 3D object.

plot::Translate3d can translate several graphical objects simultaneously. Plotting the translate object renders all graphical objects inside.

Transformation objects can be used inside translation objects. If they are animated, the animations run simultaneously.

Animated translate objects are rather "cheap" concerning computing and storing costs. For more complex graphical objects, it is more efficient to use an animated translate object than to redefine the object for each frame.

The function op allows to extract the graphical objects inside a translate object.

Attributes

AttributePurposeDefault Value
AffectViewingBoxinfluence of objects on the ViewingBox of a sceneTRUE
Framesthe number of frames in an animation50
Namethe name of a plot object (for browser and legend) 
ParameterEndend value of the animation parameter 
ParameterNamename of the animation parameter 
ParameterBegininitial value of the animation parameter 
ParameterRangerange of the animation parameter 
Shiftshift vector[0, 0, 0]
ShiftXshift vector0
ShiftYshift vector0
ShiftZshift vector0
TimeEndend time of the animation10.0
TimeBeginstart time of the animation0.0
TimeRangethe real time span of an animation0.0 .. 10.0

Examples

Example 1

Use an animated translation object to shift a vector to the tip of another vector:

A1 := plot::Arrow3d([0, 0, 0], [1, 1, 0], Color = RGB::Red):
A2 := plot::Arrow3d([0, 0, 0], [1, 1, 1], Color = RGB::Green):
plot(A1, plot::Translate3d([a, a, 0], A2, a = 0..1,
                           TimeRange = 0..4),
     plot::Arrow3d([0, 0, 0], [2, 2, 1], Color = RGB::Blue,
                   VisibleFromTo = 4..6),
     Header = "how to add 2 vectors in 3D",
     CameraDirection = [3, -2, 1]):

delete A1, A2:

Parameters

dx, dy, dz

The components of the shift vector: numerical real values or arithmetical expressions of the animation parameter a.

dx, dy, dz are equivalent to the attribute Shift.

obj1, obj2, …

Arbitrary plot objects of the appropriate dimension

a

Animation parameter, specified as a = amin..amax, where amin is the initial parameter value, and amax is the final parameter value.

Was this topic helpful?