[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Represents an array of vector4fs and point4fs.
This is an efficient way to keep an array of vectors or points,
for the elements are packed in a simple float array.
They are especially useful to work with GL's vertex array feature.
gl-vertex-pointer
can take <point4f-array>
,
and gl-normal-pointer
can take <vector4f-array>
.
It is also possible to "view" a plain f32vector as <vector4f-array>
or <point4f-array>
without copying its content, by
f32vector->vector4f-array/shared
and
f32vector->point4f-array/shared
. Combined to
read-block!
, you can do efficient binary I/O of
vertex arrays, for example.
Inherits <sequence>
and <collection>
.
When viewed as a sequence or a collection, they behaves like
sequence or collection of vector4f
and point4f
objects,
respectively.
Creates a vector4f-array or point4f-array with len elements. Each element is initialized by a vector4f init-vector or a point4f init-point if provided.
Returns true iff obj is a vector4f-array or a point4f-array, respectively.
Returns length (number of vectors/points) in array array.
#,(vector4f-array len elt …)
#,(point4f-array len elt …)
Vector4f-array and point4f-array have external representation using this SRFI-10 syntax. Len is a length of array, and each elt is a list of four floats representing each element of the array.
(f32vector->vector4f-array #f32(1 2 3 4 6 7 4 3)) ⇒ #,(vector4f-array 2 (1 2 3 4) (6 7 4 3) ) |
From given list of vector4fs or point4fs, creates and returns a vector4f-array or point4f-array, respectively.
Converts f32vector v to a vector4f-array or a point4f-array. The length of v must be multiple of four. The content of v is copied.
(f32vector->vector4f-array v) ≡ (coerce-to <vector4f-array> v) |
Like above, but the content of v is shared by the result array, instead of being copied. So the modification of result array will be visible from original f32vector v and vice versa. It will allow efficient handling of large vertex arrays.
Converts a vector4f-array or a point4f-array array to a f32vector.
(vector4f-array->f32vector array) ≡ (coerce-to <f32vector> array) |
Sets a vector4f vector or a point4f point to i-th element of vector4f-array or point4f-array array, respectively.
(vector4f-array-set! array i vector) ≡ (set! (ref array i) vector) |
Returns a vector4f or a point4f which is the i-th element of array array, respectively. If k is out of range, an error is signalled, unless fallback is provided, in such a case fallback is returned.
(vector4f-array-ref array i) ≡ (ref array i) (ref #,(vector4f-array 2 (1 2 3 4) (6 7 4 3)) 1) ⇒ #,(vector4f 6 7 4 3) |
Like above, but the returned vector4f or point4f shares the storage with the original array. Thus the modification of the result vector or point will be visible from array, and vice versa.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] |
This document was generated by Shiro Kawai on June, 7 2008 using texi2html 1.78.