Is there any way to vary the point size when drawing lots of points? I know there's the glPointSize(float), but is there a way to do it in a 'batch' or array?
I would like the points to have different sizes based on an attribute of the data. Such as each point having x, y, z, and a size attribute. I'm using frame buffers right now in java.
Could I possibly use vertex shaders for this?
I believe it's with glPointSize(GLfloat size)
Source:
http://www.talisman.org/opengl-1.1/Reference/glPointSize.html
This was what I ever did,
//reset
glLoadIdentity();
//set size to 1 for a group of points
glPointSize(1);
//group #1 starts here
glBegin(GL_POINTS);
//color of group #1 is white
glColor3f(1,1,1);
for(int a=0; a<x; a++)
for(int b=0; b<y; b++)
glVertex3f(a/953.,-b/413.,0.); //location of points
glEnd();
//set size to 5 for another group of points
glPointSize(5);
//group #2 starts here
glBegin(GL_POINTS);
//color of group #2 is red
glColor3f(1,0,0);
for(unsigned long int a=0; a<jd; a++)
{
glVertex3f(data[a].i,data[a].j,0);
}
glEnd();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With