I want to display a large number of points, which are updated. The idea is to remove the oldest points each time the buffer is updated.
i have tried the following to display the points:
Code: Select all
video::SMaterial Material;
Material.Lighting = false;
Material.Wireframe = false;
Material.PointCloud = true;
scene::SMesh *smesh = new scene::SMesh();
const int numberOfPoints = 100;
for(int id = 0; id < 2000; id++)
{
scene::SMeshBuffer *buffer = new scene::SMeshBuffer();
video::S3DVertex Vertices[numberOfPoints ];
for(int pointCounter = 0; pointCounter < numberOfPoints; ++pointCounter)
{
Vertices[pointCounter ] = video::S3DVertex(pointCounter, 0, id,
0, 0, -1,
video::SColor(255,0,0,0),
0, 1);
buffer->Vertices.push_back(Vertices[pointCounter]);
buffer->Material = Material;
buffer->Indices.push_back(id * pointCounter + pointCounter -1);
}
smesh->addMeshBuffer(buffer);
}
smesh->setHardwareMappingHint(scene::EHM_STREAM, scene::EBT_VERTEX_AND_INDEX);
smgr->addMeshSceneNode(smesh);
smesh->drop();
Now i have a few questions about this:
- Is this approach any good or is there easier or better ways?
- How would i delete the old points as i add new ones
- This approach displays the points on the screen as a single pixel is there a way to increase the amount of pixels?
Thanks in advance