forums.naturalpoint.com

Discussion and Support for the OptiTrack, SmartNav and TrackIR brands by NaturalPoint

Pointcloud win32 sample in MFC VC++ 2008 SP1 (SDI Proj)

by Harinath » Sun Sep 12, 2010 7:33 am

I'm trying to implement single marker(3 cameras) tracking in MFC VC++ based project( SDI project with Doc/View support).
I have seen the Win32 point cloud sample which looks simple,seems not fast.

I'm using OnTimer() handle to check the frames and update the position data.( Timer triggered for every 10ms)

Though i try to take the Position from every frame, It looks more delayed.
I appreciate if there is any message pump mechanism to get fast update of position.

Thanks
Harinath
Harinath
 
Posts: 8
Joined: Tue Sep 07, 2010 1:06 am
Location: south korea

by Harinath » Mon Sep 13, 2010 12:47 am

I solved the delay problem by using the noCOM sample of Point cloud in the following way.

1. Initialization code in 0nInitialUpdate(),start timer here.
2. Place the reading data code in OnTimer().
3. Place the stopping code in OnDestroy()
I have a small doubt, Is it necessary to use Sleep(1000) function. which slow down the application.

Harinath.
Harinath
 
Posts: 8
Joined: Tue Sep 07, 2010 1:06 am
Location: south korea

by Birch » Mon Sep 13, 2010 1:38 pm

Without knowing where and how the sleep() is being used its not easy to comment on whether its required. If you are using a timer to service the camera frames its not clear why a sleep would be required. (aside from if you have a tight loop in main() then you'd want to use some mechanism like a sleep/etc to yield CPU time when not processing)
Birch
 
Posts: 1139
Joined: Thu Jan 30, 2003 5:00 am
Location: Corvallis, Oregon


Return to OptiTrack SDK