Projection
Project 3D object onto plane.
- storylines.proj.project(objects, by_distance=True, return_cosines=False, return_order=False, R=[0.0, -1.0, 0.0], *args, **kwargs)[source]
Project list of 3D objects onto 2D screen.
Line width, mark sizes, and length in angle brackets are scaled according to the distance from the observer.
- Parameters:
- objectslist of tuple
List of objects. Each object is represented by a tuple, which consists of a list of three-tuples
(x, y, z)
and a style dictionary.- by_distancebool, default True
Sort the objects by distance so that close object overlay remote objects?
- return_cosinesbool, default False
Calculate cosines of angles between objects and viewing direction?
- return_orderbool, default False
Also return sorting order as list of indices?
- Rlist of float, optional
Observer position.
- *args, **kwargs
Arguments passed to projection.
- Returns:
- list of tuple
Objects in same format, but sorted with transformed coordinates and adjusted styles.
- list of float, optional
Cosines of angles between objects and viewing direction.
- list of int, optional
Sorting order.
- storylines.proj.projection(r=[0.0, 0.0, 0.0], R=[0.0, -1.0, 0.0], T=[0.0, 0.0, 0.0], U=[0.0, 0.0, 1.0])[source]
Project 3D point onto 2D screen.
- Parameters:
- Tlist of float
Object position.
- Rlist of float
Observer position.
- Tlist of float
Viewing direction (from observer).
- Ulist of float
Vertical direction.
- Returns:
- list of float
x and y position as well as proximity factor z.