Hi all!
I’m a beginner in Processing and my boss asked me to interface Kinect for XBOX ONE (or Kinect V2) to PC for record pointclouds’ videos (nothing easier…) and to record some coloured frames of a moving arm of a person.
I’ve found KinectPV2 libraries on GitHub and in one of examples I’ve found a Sketch (RecordPointCloud) to record frame and get it as OBJ files.
It’s not like a video, but works very well and with a Blender’s addon I can create a OBJ Sequence that is like a video.
For the second part, I tried to import these OBJ frames in Processing with an example in Basic/Shape folder (LoadDisplayOBJ) to avoid a second program and use only Processing.
But when I start the Sketch…there is nothing in the window.
In blender I can see the pointclouds, but if I import a frame in Processing or in another 3D program (like 3D Build) they don’t show me nothing.
Why?
There’s a better way to import OBJ in Processing? Or a better way to get an OBJ file from a frame compared to the RecordPointCloud skecth?
Hi elyon,
Is your object only dots?
I think you need to have surface to be able to see something.
(It is like the render mode in blender: you can’t see the points, you can see them only in edit mode)
Hi jb4x!
Yeah, my object is only points, as you can see from the picture above.
You’ve probably right, but it’s so strange that a file create by Processing its not readable by Processing itself, isn’t it?
To complement @tony 's answer, you can use getVertexCount() to get the number of vertex in your object. It makes it super easy to loop through all of the vertices of your object
Mh, so I have to use loadShape() to load the OBJ file, then use getVertexCount() to get vertex number, put them in a Vector and create a sphere on each vertex?
it doesn’t work. I think that the problem is the way that RecordPointCloud in KinectPV2 example make the OBJ file, because this is the result when i execute loadShape("frame00.obj")
There are some things going on here with PShader and OpenGL / PGL that I don’t fully understand. We might ask some of our form shader / OpenGL experts.
Could you provide a sample of an actual OBJ you are producing? Ideally just a simple test example with dozens or hundreds of points – not thousands.
If you are using this code,
it looks like you should be saving an obj file that is just a list of verts, 1 per line, and nothing else.
v 0.123 0.234 0.345 1.0
If that is the case then even if you can’t get your current loader to work (which is odd) you could write your own loader in a few lines with loadStrings and split.
tony I checked Kinect Tutorial page but I don’t think it talks about record point cloud. Do I skipped any step?
@neilcsmith the code is the one that jeremydouglass posted
@jeremydouglass HI! Yeah, I confirm that is the code I used. Here is the link where you can find the file but, as you said, is just a list of verts, 1 per line, and nothing else.
Mhh, do you think that I can create an OBJ loader my self?