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.


Orientation of a 3D text

Value Summary

OptionalList of six real-valued expressions

Graphics Primitives

ObjectsTextOrientation Default Values
plot::Text3d[1, 0, 0, 0, 0, 1]


TextOrientation defines the orientation of a text object of type plot::Text3d. Its orientation in 3 space is given by 2 directions. There is the "writing direction" from the first character of the text to the last. The direction from the bottom of the characters to their top shall be referred to as the "up direction".

Together with the anchor point of the text (the attribute Position of a plot::Text3d object), these two directions define a 2 dimensional plane in 3D. You may regard this plane as the sheet onto which the text is written.

The value of TextOrientation has to be a list of 6 numerical values or expressions of the animation parameter. The first 3 components of this list define the "writing direction", the last 3 components the "up direction".

The length of these two vectors is irrelevant, only their directions matter. The lengths should not be zero, though.

Further, the "up direction" should be orthogonal to the "writing direction". If this is not the case, the "up direction" is automatically replaced by the vector orthogonal to the "writing direction" that lies in the plane given by the original directions.

"Writing direction" and "up direction" should not be parallel.

    Note:   TextOrientation only has an effect in conjunction with the attribute Billboarding = FALSE.

TextOrientation can be animated.

The effect of TextOrientation is independent of the HorizontalAlignment and VerticalAlignment of the text relative to its anchor point (Position).

While TextOrientation is used for orienting 3D texts, TextRotation is used for rotating a 2D text of type plot::Text2d.


Example 1

The "writing direction" of the text object text1 is rotated around an axis parallel to the z-axis. The "up direction" of its characters is the z direction.

The "writing direction" of the text object text2 is parallel to the x axis. The animated "up direction" is rotated around an axis pointing into the x direction:

p1 := plot::Point3d([1, 2, 3], PointSize = 3*unit::mm):
text1 := plot::Text3d("Hello world!", [1, 2, 3], 
             TextOrientation = [cos(a), sin(a), 0, 0, 0, 1],
             a = 0..2*PI, TextFont = [24],
             Billboarding = FALSE):
p2 := plot::Point3d([3, 6, 9], PointSize = 3*unit::mm):
text2 := plot::Text3d("MuPAD", [3, 6, 9], 
             TextOrientation = [1, 0, 0, 0, sin(a), cos(a)],
             a = 0..2*PI, TextFont = [24],
             Billboarding = FALSE):
plot(p1, text1, p2, text2)

When Billboarding is set to TRUE, TextOrientation does not have any effect:

text1::Billboarding := TRUE:
text2::Billboarding := TRUE:
plot(p1, text1, p2, text2)

delete p1, text1, p2, text2:

See Also

MuPAD Functions

Was this topic helpful?