This functionality does not run in MATLAB.
plot::Scene3d(object3d1, object3d2, …, <a = amin .. amax>, options)
plot::Scene3d is a container to display one or more coordinate systems containing graphical objects. Scene objects must be created when several graphical scenes are to be displayed simultaneously in a plot.
Usually, you do not need to create a scene object explicitly, because a plot command such as plot(object1, object2, …) creates a default scene object implicitly to display the graphical objects in.
The need for creating scene objects explicitly arises only when several scenes are to be displayed simultaneously in one plot.
The MuPAD® graphics makes a clear division between 2D and 3D. Scene objects of type plot::Scene2d do not accept 3D objects and plot::Scene3d objects do not accept 2D objects. When several scenes are displayed simultaneously in a single plot, all scenes must be of the same dimension.
Strictly speaking, a 3D scene object is a container for coordinate systems of type plot::CoordinateSystem3d. However, you do not have to bother about this technicality because a suitable default coordinate system is created internally, when graphical primitives are passed to plot::Scene3d.
Scene objects are always visible in the interactive object browser of the MuPAD graphics tool (see section Viewer, Browser, and Inspector: Interactive Manipulation of this document). Each scene contains one or more coordinate systems as its children. When the scene object is selected, it provides access to a variety of attributes that are associated with scenes. The scene attributes allow to
set layout parameters such as height and width (if the canvas attribute Layout is set to Absolute or Relative),
set a direction for the automatic camera in 3D (CameraDirection),
set various style parameters such as BackgroundColor etc.
A complete listing of the attributes associated with a scene is given below. Follow the links to the help pages of the attributes to find more detailed information.
Apart from these attributes of the scene object, also attributes for the coordinate system and the graphical objects inside the scene can be specified when generating a scene object. These attribute values are inherited to the coordinate system and the graphical objects as new default values.
A plot may contain more than one graphical scene. In such a case, separate scene objects must be created explicitly by the user and passed to a plot command (or inserted into an object of type plot::Canvas). For details on the layout of scenes inside the drawing area ("canvas"), see the help page of the canvas attribute Layout.
Cf. Example 1.
|BackgroundColor2||second background color for color blends||RGB::Grey75|
|BackgroundStyle||color blends in the background||Flat|
|BackgroundTransparent||plot a scene on a transparent background||FALSE|
|BorderColor||color of frame/border around canvas and scenes||RGB::Grey50|
|BorderWidth||width of frame/border around canvas and scenes||0|
|Bottom||distance of bottom of scene to bottom of canvas||0|
|BottomMargin||bottom margin width||1|
|CameraDirection||the direction of the automatic camera|
|CameraDirectionX||the direction of the automatic camera, x-component|
|CameraDirectionY||the direction of the automatic camera, y-component|
|CameraDirectionZ||the direction of the automatic camera, z-component|
|FooterFont||font of footers (scene and canvas)||[" sans-serif ", 12]|
|FooterAlignment||alignment of footer of canvas and scenes||Center|
|HeaderFont||font of headers (scene and canvas)||[" sans-serif ", 12]|
|HeaderAlignment||alignment of header of canvas and scenes||Center|
|Height||heights of canvas/scenes||80|
|Left||distance of left of scene to left of canvas||0|
|LeftMargin||left margin width||1|
|LegendFont||font of legend entries||[" sans-serif ", 8]|
|LegendVisible||switch legend on/off||FALSE|
|LegendPlacement||legend above or below||Bottom|
|LegendAlignment||legend at left, center, or right||Center|
|Lighting||light schemes for 3D graphics||Automatic|
|Margin||margins around canvas and scenes||1|
|Name||the name of a plot object (for browser and legend)|
|RightMargin||right margin width||1|
|TopMargin||top margin width||1|
|Width||widths of canvas/scenes||120|
|YXRatio||scaling ratio between y and x axes||1|
|ZXRatio||scaling ratio between z and x axes||2/3|
Scene objects have to be created explicitly only when several scenes are to be displayed simultaneously in one plot. The following call uses the automatic layout of several scenes in a canvas:
S1 := plot::Scene2d(plot::Function2d(sin(x), x = 0..2*PI), Header = "the sine function"): S2 := plot::Scene2d(plot::Function2d(cos(x), x = 0..2*PI), Header = "the cosine function"): S3 := plot::Scene2d(plot::Function2d(tan(x), x = 0..PI), Header = "the tan function"): S4 := plot::Scene2d(plot::Function2d(cot(x), x = 0..PI), Header = "the cot function"): plot(S1, S2, S3, S4, BorderWidth = 0.5*unit::mm)
We use the canvas attribute Layout = Relative to position 3 of these scenes in the canvas. The size of the scenes is set with the attributes Width and Height, specifying multiples of the canvas' width and height. The bottom left corner of each scene is positioned with the scene attributes Bottom and Left:
S1::Width := 0.475: S1::Height := 0.42: S2::Width := 0.475: S2::Height := 0.42: S3::Width := 0.475: S3::Height := 0.42: S1::Bottom := 0.46: S1::Left := 0.02: S2::Bottom := 0.02: S2::Left := 0.02: S3::Bottom := 0.26: S3::Left := 0.51: S3::HeaderFont := ["Times New Roman", Italic, 12]: plot(S1, S2, S3, Layout = Relative, BorderWidth = 0.5*unit::mm, plot::Scene2d::BorderWidth = 0.2*unit::mm, Header = "trigonometric functions", HeaderFont = ["Times New Roman", Bold, 18]):
delete S1, S2, S3, S4:
Conic sections are the curves that you get when intersecting a cone and a plane. The first scene displays a plane and a rotating cone, the second the corresponding conic section:
c := plot::Cone(1, [-sin(a), 0, -cos(a)], [sin(a), 0, cos(a)], a = 0..2*PI): s := plot::Surface([x, y, 0], x = -1..1, y = -1..1): S1 := plot::Scene3d(c, s): S2 := plot::Scene3d(c, ViewingBoxZRange = -0.01 .. 0.01): plot(S1, S2, Layout = Horizontal)
delete c, s, S1, S2:
object3d1, object3d2, …
3D coordinate systems or graphical 3D objects