instantreality forum
news: Welcome to the instantreality forums!
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
January 17, 2018, 02:31:25 am


Login with username, password and session length


Pages: [1]
  Print  
Author Topic: IOSensor for PointClouds  (Read 3418 times)
Thomas
Newbie
*
Posts: 21


View Profile
« on: December 12, 2011, 11:00:38 am »

Hello,

we want to program an IOSensor that generates point positions (coordinates) for a large set of points (ca. 10000) at a rate of 50 times per second. Is it possible to have as eventOut a PointSet or IndexedPointSet if we program our own C++-plugin (IOSensor)?

Does something like this works?

Code:
// in header-file:
OutSlot< PointSet > *pointCloudSlot;

// in cpp-file:
pointCloudSlot = new OutSlot<PointSet>("generate a pointCloud", PointSet());
assert(pointCloudSlot != 0);
pointCloudSlot->addListener(*this);
addOutSlot("coordinates", pointCloudSlot);

Thanks in advance,
Thomas
Logged
ChristophSchulze
Newbie
*
Posts: 2


View Profile
« Reply #1 on: December 16, 2011, 12:41:55 pm »

PointSet or IndexedPointSet work with a coordinate node (datatype MFVec3f) to store a set of Vec3f. Therefore your sensor works totally fine with:

    MFVec3fPtr PointCloud = ....;
    PointCloudSlot = new OutSlot<MFVec3fPtr>("generate a pointCloud", PointCloud);
    assert(PointCloudSlot != 0);
    PointCloudSlot->addListener(*this);
    addOutSlot("pointcloud", PointCloudSlot);

Because this only sent a pointer to a set of positions, the performance is great and allows both, high update rates and large sets of points.

Cheers,
Chris
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.15 | SMF © 2011, Simple Machines