Affine linear transformation 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.
plot::Transform3d(<b_{3d}
>, A_{3d}
, obj_{1}
, <obj_{2},...
>, <a = a_{min} .. a_{max}
>, options
)
plot::Transform3d(b, A, objects)
with a vector b and
a matrix A applies the affine linear transformation $$x\to Ax+b$$ to
3D objects.
The transformation matrix A
may be specified
by a list of lists, with the sublists representing the rows:
[[A_{1, 1}, A_{1, 2},
…], [A_{2, 1}, A_{2, 2},
…], …]
A plain list [A_{1, 1}, A_{1,
2}, …, A_{3, 2}, A_{3,
3}]
represents the matrix row by row.
Transform objects can transform several graphical objects simultaneously. Plotting the transform object renders all graphical objects inside.
Transformed objects have a tendency to overestimate their ViewingBox
.
In such cases, specify a suitable ViewingBox
explicitly.
Transformation objects can be used inside transformation objects. If they are animated, the animations run simultaneously.
Animated transform objects are rather "cheap" concerning computing and storing costs. For more complex graphical objects, it is more efficient to use an animated transform object than to redefine the object for each frame.
The function op
allows
to extract the graphical objects inside a transformation object.
Attribute  Purpose  Default Value 

AffectViewingBox  influence of objects on the ViewingBox of
a scene  TRUE 
Frames  the number of frames in an animation  50 
Matrix3d  transformation matrices  [1 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 1 ] 
Name  the name of a plot object (for browser and legend)  
ParameterEnd  end value of the animation parameter  
ParameterName  name of the animation parameter  
ParameterBegin  initial value of the animation parameter  
ParameterRange  range of the animation parameter  
Shift  shift vector  [0 , 0 , 0 ] 
ShiftX  shift vector  0 
ShiftY  shift vector  0 
ShiftZ  shift vector  0 
TimeEnd  end time of the animation  10.0 
TimeBegin  start time of the animation  0.0 
TimeRange  the real time span of an animation  0.0 .. 10.0 
For some applications, it is very popular to plot a function
in 3D together with a projection of its contour lines onto the lower
or upper bounding plane. MuPAD^{®} has no direct option for this,
but with plot::Transform3d
, it is possible to achieve
the same effect. Suppose that you have the function under consideration
in a plot::Function3d
object:
f := plot::Function3d(sin(x*y)+cos(x^2y), x=3..3, y=3..3, Submesh=[1,1]):
To plot contour lines at all, use the attribute ZContours
.
To avoid changing f
, create a modified copy using plot::modify
:
plot(plot::modify(f, ZContours = [Automatic, 10]))
To only get contour lines, change a few more parameters: switch
off the surface and the parameter lines. Then, add height coloring
to the lines and use plot::Transform3d
to project them
onto the plane z =  2.5.
Finally, plot these lines together with the original function:
plot(f, plot::Transform3d([0, 0, 2.5], // shift vector [1, 0, 0, // transformation matrix 0, 1, 0, 0, 0, 0], plot::modify(f, Filled = FALSE, XLinesVisible = FALSE, YLinesVisible = FALSE, ZContours = [Automatic, 10], LineColorFunction = // height coloring ((x, y, z) > [(z+2)/4, 0, (2z)/4]))))

The 3D shift vector: a list with 3 entries. Also vectors generated
by


The 3D transformation matrix: a 3×3 matrix,
a 3×3 array, a list
of 3 lists, or a plain list with 9 entries. The entries must be numerical
values or arithmetical
expressions of the animation paramater


Plot objects 

Animation parameter, specified as 