-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathtext.html
More file actions
108 lines (107 loc) · 8.58 KB
/
Copy pathtext.html
File metadata and controls
108 lines (107 loc) · 8.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<!-- InstanceBegin template="/Templates/template.dwt" codeOutsideHTMLIsLocked="false" --><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>text</title>
<!-- InstanceEndEditable -->
<!-- InstanceBeginEditable name="head" -->
<link href="VisualRef.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.style1 {font-size: x-large}
.style2 {font-size: xx-large}
-->
</style>
<!-- InstanceEndEditable -->
<link href="VisualRef.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table width="230" height="30" border="0">
<tr>
<td width="66"><a name="top" id="top"></a><a href="index.html"><strong>Home</strong></a></td>
<td width="154"><span class="Normal"><a href="primitives.html"><strong>Pictures</strong></a> of 3D objects</span></td>
</tr>
</table>
<table width="438" height="30" border="0">
<tr>
<td width="151"><select id="menu1" onchange="jumpMenu(this)">
</select></td>
<td width="163"><select id="menu2" onchange="jumpMenu(this)">
</select></td>
<td width="110"><select id="menu3" onchange="jumpMenu(this)">
</select></td>
</tr>
</table>
<table width="454" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutDefaultTable-->
<tr>
<td width="454" rowspan="2" valign="top"><!-- InstanceBeginEditable name="content" -->
<div>
<table width="100%" border="1">
<tr>
<td width="89%"><div align="center"><span class="style1 style2"><font color="#0000A0">text</font></span></div></td>
</tr>
</table>
</div>
<div>
<p class="Normal"><img src="images/newtext3d.png" alt="3D text" width="503" height="232" /></p>
<p class="Normal">See the <a href="text_output.html"><strong>Text Output</strong></a> discussion for additional ways to output text in the GlowScript environment. </p>
<p class="Normal">With the text object you can display 3D text. The
green 3D text shown above was created with the following statement: </p>
<p class="program"> text(text='My text is\ngreen',<br />
align='center', depth=-0.3, <br />
color=color.green)</p>
<p class="Normal">Labels were added to the display above to illustrate
some of the main attributes of the text object. Whether you extrude into or out of the screen, the text is created so that it is readable left to right from the normal viewing position, in the +z direction.</p>
<p class="Normal">3D text is made out of <a href="triangle.html"><strong>quads</strong></a> and <a href="triangle.html"><strong>triangles</strong></a> which are then made into a <a href="compound.html"><strong>compound</strong></a> object for speed of display. You can make additional copies of a text object by <a href="clone.html">cloning</a> it. You can move the text by specifying a new <span class="attribute">pos</span>, and you can change its <span class="attribute">size</span>, <span class="attribute">axis</span>, <span class="attribute">up</span>, <span class="attribute">color</span>, <span class="attribute">opacity</span>, <span class="attribute">shininess</span>, and <span class="attribute">emissive</span>, as with other objects, but note that color and size are "multiplicative"; see <a href="compound.html"><strong>compound</strong></a>.</p>
<p class="Normal">Here
is a list of text attributes, in addition to the usual attributes of canvas, color, shininess, and opacity (but not texture or bumpmap, currently):</p>
<p class="attributes"> <span class="attribute">pos</span> The
location of the baseline of the text, to the left, to the right,
or at the center of the text, as per align.<span class="attribute"></span><span class="attribute"></span></p>
<p class="attributes"> <span class="attribute">align </span>Specify 'left'
(default), 'right', or 'center'.</p>
<p class="attributes"> <span class="attribute">text</span> The text to
be displayed, such as "My text is\ngreen" in the example above ('\n' is a new line character).
Unicode strings are supported. After creating the object, the text is read-only -- it cannot be changed. The reason for this is that it takes a significant portion of a second to create a 3D text object. If you need to change the text, make the current object invisible (visible=False) and create a new object.</p>
<p class="attributes"> <span class="attribute">font</span> Name of
the desired font, either "sans" (sans serif, the default) or "serif". This is read-only.</p>
<p class="attributes"><span class="attribute">billboard</span> In computer graphics "billboard" behavior means that the object always faces you, no matter how you reorient the camera. Specifying billboard = True when creating the text turns this on, and then is read-only. Because lighting changes as you rotate the camera, you may wish to specify emissive = True, so that the text is always bright.</p>
<p class="attributes"> <span class="attribute">height</span> Height
of an uppercase letter (see above); default is 1. Specifying the
height and depth sets the scale for the entire text display. Changing
the height also changes descent and vertical_spacing, but not depth.After creating the 3D text, you can change the height. For example, if you say T.height = 0.5*T.height, the letters become shorter but the length stays the same.</p>
<p class="attributes"><span class="attribute">length</span> length
of the displayed text. After creating the 3D text, you can change this. For example, if you say T.length = 0.5*T.length, the letters become narrower but the height stays the same.</p>
<p class="attributes"><span class="attribute">depth</span> Depth
of the text; the default is 0.2 times the height. A positive number means extrude toward you, out of the screen; negative
means extruded away from you, into the screen. After creating the 3D text, you can change this. For example, if you say T.depth = 2*T.length, the letters become twice as thick. If the depth is zero, the thickness is made to be 0.01 times the height, and the text looks like a thin sheet.</p>
<p class="attributes"><span class="attribute">descender</span> Height
of the descender on lower-case letters such as y (whether or not
there is such a letter in the text). This is typically about 0.3
times the height. This is read-only but is affected by changes in height.</p>
<p class="attributes"> <span class="attribute">upper_left, upper_right,
lower_right, lower_left </span>The bounding box of the displayed
text; all of these are read-only. For example, if you create <span class="program"><strong>title = text(text="My Text")</strong></span>,
you can place a sphere at the upper left corner with the statement <strong>sphere(pos=title.upper_left</strong>).</p>
<p class="attributes"> <span class="attribute">start, end </span> The left-most and right-most
locations on the baseline. These are read-only. If align is 'left', pos is the same as start. If align is 'right', pos is the same as end.</p>
<p class="attributes"><span class="attribute">vertical_spacing</span> Vertical
distance from one baseline to the next in a multiline text. This is read-only. </p>
<p class="attributes"><span class="attribute">size</span> You change the size, which does not affect the axis. The size is multiplicative, as the text object is actually a compound object; see the <a href="compound.html">documentation</a> on compound objects.</p>
<p class="attributes"><span class="attribute">axis</span> The axis
points along the baseline; changing the axis changes the orientation
of text. The default is (1,0,0), with text going toward the right. Changing the axis only affects the direction of the line of text, not the length or size. <span class="attribute">up</span> Controls
the up attribute of the frame; changing up makes the text tip away
from the vertical</p>
<p class="attributes"> <span class="attribute">up</span> Controls
the up attribute of the text; changing up makes the text tip away
from the vertical.</p>
<div>
<p class="Normal"></p>
<!-- InstanceEndEditable --></td>
</tr>
</table>
<p><a href="#top"><strong>Top of page</strong></a></p>
</body>
<script type="text/javascript" language="javascript" src="navigation.js"></script>
<!-- InstanceEnd --></html>