Closed kylemcdonald closed 13 years ago
I included that function for Chris and the fact that it's required by ofBaseVideo. Why does it make more sense? Does the kinect thread grab images faster then the main Glut thread renders?
maybe i'm just using it wrong. i tried to write:
if(kinect.isFrameNew()) {
kinect.update();
}
and it wasn't working. should i just update() every frame, outside of isFrameNew()?
yes, then ask for isFrameNew, in case you want to do any analysis on the data you avoid to do it twice like that, is the same as the videoGrabber:
kinect.update(); if(kinect.isFrameNew()) { cv... }
aha, i thought it was more like the ofVideoGrabber style where it was:
kinect.grabFrame();
if(kinect.isFrameNew()) {
kinect.update();
}
but since there wasn't a grabFrame as it's threaded, it didn't make any sense. i see now. still slightly inconsistent with ofVideoGrabber, but i understand the use.
but ofVideoGrabber is the same...
oh wow, you're totally right arturo. i've been using it wrong for a long time. it looks like:
void ofVideoGrabber::grabFrame(){
update();
}
i wonder why i thought you had to do it the way i wrote above? maybe that's from an older example?
thanks :)
:)
... yeah I was wondering what you were talking about Kyle ... :D
it currently makes more sense to just call update() every frame than to use isFrameNew(). should we just remove isFrameNew()? it doesn't make sense to add grabFrame because kinect runs differently than the video grabber.