I'm beginning to wonder if this is a windows vista or dotNet issue?
I've quickly written a simpler loop
Code: Select all
/*
* Created by SharpDevelop.
* User: leith
* Date: 11/16/2007
* Time: 3:04 PM
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System;
using OptiTrack;
namespace FIEMC2DNodeCL
{
class Program
{
public static void InitCamera(NPCamera cam){
cam.SetLED(0, true);
cam.SetLED(1, true);
cam.SetLED(2, false);
cam.Open();
cam.Start();
}
public static void Main(string[] args)
{
OptiTrack.NPCameraCollectionClass cameras = new NPCameraCollectionClass();
cameras.Enum();
cameras.Synchronize();
foreach (NPCamera cam in cameras){
InitCamera(cam);
}
bool closeRequested = false;
while (!closeRequested){
int frames = 0;
int points = 0;
foreach (NPCamera cam in cameras){
OptiTrack.NPCameraFrame frame = null;
frame = cam.GetFrame(0);
while (frame != null){
if (frame.IsEmpty){
// TODO: handle empty frame
} else if (frame.IsCorrupt){
// TODO: handle corrupt frame
} else if (frame.IsGreyscale){
// TODO: handle greyscale frame
} else {
// frame is normal
frames++;
points = points + frame.Count;
}
frame.Free();
frame = null;
frame = cam.GetFrame(0);
}
}
// TODO: deal with input
}
}
}
}
I'll see if I can get my XP machine to run some of these examples and perhaps it will shed some light.