Package: graphene
Macro graphene:with-point3d
Lambda Listgraphene:with-point3d ((var &rest args) &body body) SyntaxArgumentsDetails The graphene:with-point3d macro allocates a new graphene:point3d-t instance, initializes the point with the given
values and executes the body that uses the point.
After execution of the body the allocated memory for the point is released. When no argument is given the components of the point are initialized to zero. The initialization with three single floats uses the graphene:point3d-init function. The initialization from another point is done with the graphene:point3d-init-from-point function. That is the default when no type specifier for the value is given. If the value has the type specifier graphene:vec3-t the point is initialized with the graphene:point3d-init-from-vec3 function. NoteExamples(graphene:with-point3d (p) (list (graphene:point3d-x p) (graphene:point3d-y p) (graphene:point3d-z p))) => (0.0 0.0 0.0) (graphene:with-point3d (p 1.5 1.7 1.9) (list (graphene:point3d-x p) (graphene:point3d-y p) (graphene:point3d-z p))) => (1.5 1.7 1.9)Use a vector for initialization of the point. (graphene:with-vec3 (v 3.5 4.5 5.5) (graphene:with-point3d (p (v graphene:vec3-t)) (list (graphene:point3d-x p) (graphene:point3d-y p) (graphene:point3d-z p)))) => (3.5 4.5 5.5)This examples uses the graphene:with-point3ds macro to initialize two points. The second point is intialized with the values from the first point. (graphene:with-point3ds ((p1 0.3 0.5 0.7) (p2 p1)) (list (graphene:point3d-x p2) (graphene:point3d-y p2) (graphene:point3d-z p2))) => (0.3 0.5 0.7) | See also |
2024-1-20