Closed HugoPeters1024 closed 5 years ago
Well, to initialize a struct you can omit the (vec3)
and just write
vec3 v = {array[i+0], array[i+1], array[i+2]};
No need for that VEC3
macro.
Thanks! Makes sense. Still wondering what the macro is for then.
The macro is for returning vec-s from functions.
vec3 foobar(…)
{
/* ... */
return VEC3(a,b,c);
}
Hiya, Loving this module so far, but I have an issue constructing a 3 dimension vector. I have a large array of floats that represent 3d vertices. I wish to loop over them on a per vertex basis so i constructed the following piece of code.
But this gives me the following compile error (using g++)
Am I doing something wrong here?