null | |
---|---|
Type: | §Drawable3D |
facet | |
---|---|
path::§Path n1::§N n2::§N n3::§N tiebreaker:0::§Length double::§Boolean → §Drawable3D | |
§N |
Type of surface normal. Should either be §SurfaceNormalGray or §SurfaceNormalRGB.
|
Dynamic references: | none |
The only required argument is path, which must be a flat polygon. The three arguments of type §N will be described shortly. The parameter tiebreaker has the same meaning as for ..Shapes..Graphics..fill, and double tells whether the surface should be visible when viewed from the back. Surfaces that are not visisble when viewed from the back allow more efficient rendering when they cover a solid body, so that one knows that the inside of the body surface should never be visible. The default value for double depends on the presence of surface normals; if there are none, it defaults to true, otherwise it defaults to false unless the surface normals disagree on which is the visible side.
Up to three surface normals may be provided (provide n1 before n2 and so forth). A surface normal has a location on the surface and specifies both a normal direction to be used in light computations (although the surface is physically flat, it can be treated as if curved in the light model), and a color. See facetnormal for more details on how to construct surface normals. If no facet normal is provided, one is computed by using the physical normal direction of path, with color determined by ..Shapes..Traits..@nonstroking. If just one facet normal is provided, it defines a constant normal direction and color over the whole facet. If more than one is provided, normal direction and color are interpolated over the facet.
Please refer to the documentation on the many dynamic variables accessed by this function, to learn how these affect the light computations.
|
newZSorter | |
---|---|
This is a hot value. | |
Spawns: | §•Drawable3D |
newZBuf | |
---|---|
This is a hot value. | |
Spawns: | §•Drawable3D |
facing | ||||||||
---|---|---|---|---|---|---|---|---|
obj::§Drawable scale:false::§Boolean distort:false::§Boolean → §Drawable3D | ||||||||
Make a special kind of 3d object at z = 0, which will always face the viewer even after 3d transforms. It is useful for labels and other 2d annotations that need to be positioned in terms of objects in a 3d world.
When the object is viewed after being transformed in 3d, it will just be transformed by a 2d transform, so the object never has to go truly 3d. The object will be shifted according to how its origin moved by the 3d transform. The arguments scale and distort determine how the linear part of the 2d transform is obtained from the 3d transform. If scale is set, the object will be scaled according to the z coordinate of its transformed origin. If distort is set, the linear (x,y) part of the 3d transform will be used.
| ||||||||
obj::( ::§Transform3D → §Drawable ) → §Drawable3D | ||||||||
Dynamic references: | <The entire dynamic state> | |||||||
Gives the user full control of how to display the object when being viewed through a 3d transform. The dynamic state is captured, and will be in scope later when the embedded function is invoked.
If you ever considered solving the intricate problem of generating nice arrowheads for paths in 3d by simply treating the path as if it was in 2d, think again, as the example below shows!
|