Hello,
I recently made a sketch using the Open Kinect for Processing Library and a Kinect v1 Model 1414. Long story short, the 1414 broke, so I just got a V2 and have been going through the examples included with the library to try and figure out how to edit my sketch to work with the V2. However, a couple of the included examples (ColorPointCloud2 and DepthPointCloud2) cause some errors upon opening them from the examples sketchbook.
Lines 90, 95, 98, and 101 of ColorPointCloud2 all have some form of this code:
pgl.vertexAttribPointer(vertLoc, 3, PGL.FLOAT, false, 0, depthPositions);
which causes the error message:
The function “vertexAttribPointer()” expects parameters like: “vertexAttribPointer(int, int, int, boolean, int, int)”
I was able to figure out that the variables
depthPositions (FloatBuffer from line 66)
depthData (IntBuffer from line 78)
irData (IntBuffer from line 76)
registeredData (IntBuffer from line 77)
are the culprits of the error messages. I replaced them with an integer and the error message went away.
From my rudimentary understanding of buffers, they are memory areas that store data which can be read more efficiently, so it makes sense to me that a FloatBuffer (full of floats) would cause an error for a function expecting an integer, but it doesn’t make sense to me that an IntBuffer (full of integers) would cause that error.
I’m hoping someone can shed some light as to why the example code has these errors, possible solutions, and perhaps point me to somewhere I can read up on FloatBuffers and IntBuffers…
I am using Processing 3.5.3 and downloaded Open Kinect for Processing using the Contributions Manager. My machine specs are as follows:
MacBook Pro (Early 2015)
2.7 GHz Intel Core i5
16 GB 1867 MHz DDR3
Intel Iris Graphics 6100 1536 MB
I have included screenshots of the errors I’m getting and how I was able to get them to go away.
Thanks,
Julian