(const-face-attribs fattribs)
Similar to face-attribs fn, but for attributes which are constant for all vertices of a single face. Takes a seq of attrib values and returns generator fn.
Similar to face-attribs fn, but for attributes which are constant for all vertices of a single face. Takes a seq of attrib values and returns generator fn.
(face-attribs fattribs)
Vertex attribute generator using given seq of attribs. The seq should contain at least the same number of elements as there are faces to be generated. Each item itself is a vector of attrib values (in vertex order) to be assigned to each vertex. Returns generator fn.
Vertex attribute generator using given seq of attribs. The seq should contain at least the same number of elements as there are faces to be generated. Each item itself is a vector of attrib values (in vertex order) to be assigned to each vertex. Returns generator fn.
(generate-face-attribs verts face-id attribs opts)
Takes a vector of face vertices, face id, a map of vertex attribute generator fns and an options arg passed to the attribute generator fns. Returns 2-elem vector of [verts vert-attribs]. The generator fns themselves take these 4 args and should return the attribute for a single vertex: face-id, vertex-id, vertex, opts (a map).
Takes a vector of face vertices, face id, a map of vertex attribute generator fns and an options arg passed to the attribute generator fns. Returns 2-elem vector of [verts vert-attribs]. The generator fns themselves take these 4 args and should return the attribute for a single vertex: face-id, vertex-id, vertex, opts (a map).
(supplied-attrib attrib)
(supplied-attrib attrib tx)
Higher order helper, returns attribute generator fn for types which
emit pre-computed values as part of their as-mesh
impl. Takes
attrib key and for each vertex looks up value in opts map (which is
supplied by supporting types, e.g. sphere). If called via 2 args,
the looked up values will also be passed to transformation fn (2nd
arg).
Higher order helper, returns attribute generator fn for types which emit pre-computed values as part of their `as-mesh` impl. Takes attrib key and for each vertex looks up value in opts map (which is supplied by supporting types, e.g. sphere). If called via 2 args, the looked up values will also be passed to transformation fn (2nd arg).
(uv-flat-disc _ vid _ {:keys [theta r] :as opts})
Generates UV coordinates for a circle/trianglefan, using data provided in options map (:theta & :r keys). The first vertex of each triangle is assumed to be in the center of the circle, the other 2 vertices are located at the circles perimeter.
Generates UV coordinates for a circle/trianglefan, using data provided in options map (:theta & :r keys). The first vertex of each triangle is assumed to be in the center of the circle, the other 2 vertices are located at the circles perimeter.
(uv-polygon-disc res)
HOF UV generator for polygons/polyhedras. Takes polygon resolution and computes N UV coords, returns generator fn
HOF UV generator for polygons/polyhedras. Takes polygon resolution and computes N UV coords, returns generator fn
(uv-rect-for-size w)
(uv-rect-for-size w h)
(uv-rect-for-size w h x y uw vh)
(uv-tube _ vid _ {:keys [u v du dv]})
Generates tubular UV coordinates, using data provided in options map (:u :v :du :dv keys)
Generates tubular UV coordinates, using data provided in options map (:u :v :du :dv keys)
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close