Hey oF people,
I’m currently working on an app where I draw a ton of points distributed in 3D across a big spherical shell. I am using an ofVboMesh to draw the points and give them different sizes by using the setAttributeData method in the Vbo.
I’m having trouble with my points at the moment. For some reason some of them appear to have a black outline around them and some do not. This means that half of them look very bright while the others look much darker. It seems to depend upon the angle at which I’m viewing the points. I think it’s likely to do with the direction that the points are facing. Does anyone know a way to force all the points to face the camera? (ie billboarding?). I’ve attached some images which hopefully illustrate the issue.
the relevant code is here:
ofShader starPoints; ofVboMesh celestialSphere; ofEasyCam cam; float rotation; vector<float> pointSize;
starPoints.load("shaders/starSize"); starPoints.begin(); celestialSphere.getVbo().setAttributeData(starPoints.getAttributeLocation("point_size"), &pointSize, 1, pointSize.size(), GL_DYNAMIC_DRAW, sizeof(float)); starPoints.end(); glEnable(GL_VERTEX_PROGRAM_POINT_SIZE);
cam.begin(); ofRotate(rotation, 0.5, 1, 0); celestialSphere.draw(); starPoints.end(); cam.end();