I am translating some VEX code to OpenCL. The code gets the screen 2d position from a 3d point, given a camera (basically I am trying to reproduce the toNDC function in OpenCL). After getting the needed values, I have this operation working fine in VEX:
pos *= invert(cam) * persp;
Where pos is a vector 4 and cam and persp are matrix4.
Unfortunately this gives me an error in OpenCL, I believe I have to operate in a different fashion but I cannot find how. It appears I cannot use “invert” and I have to somehow use the same scale. Any help is very much appreciated.
These are the errors I get:
OpenCL Exception: <kernel>:33:14: warning: implicit declaration of function 'invert' is invalid in C99 pos *= invert(cam) * persp; <kernel>:34:11: error: can't convert between vector values of different size ('__attribute__((address_space(16776963))) float4' and 'float __attribute__((ext_vector_type(16)))') pos *= invert(cam) * persp;
Thanks!