I am trying to do some opengl programming using freeglut. Suppose an object(comet/aeroplane) which moves in 3D space and I want render the path traced by it as a point cloud (which represents white trail left behind by aeroplane).
My problem is, I need to clear the screen using glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT) every time glutDispFunc is called in-order to give movement to the aeroplane(I am using a keyboardfunction to change the position of the plane). However I also need to display a huge number of points which go on accumulating as the plane moves.I have tried with clear screen using
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
which results in severe performance degradation as the number of points increase but can display the moving plane as well as the cloud of points. Anyone knows how to handle such scenarios?