Hi! You can’t get the size because the vertices are already scaled before being sent to the shader. But you can set the size in a uniform, for example shader.set("sphereSize", 100); in case you need that value. Or you could calculate the distance from each vertex to the center of the sphere in the shader, not sure if that’s of any use.
But what do you want to actually achieve?
Also, it might be easier to send always a sphere of size 1, and then scale it in the shader by multiplying the vertices by a uniform (sphereSize ?). You can set that size before drawing each sphere…
Finally, if you use PShape the performance will be better, because you would avoid sending all the vertices of the sphere on each animation frame, and the shape would be maintained in the GPU.
sph = createShape(SPHERE, 1);
shader.set("sphereSize", 100); // needs to be implemented in the shader
I can send it in a uniform, is true, but if ive an arrays of spheres? the uniforms works for all the shapes, and now we need to set a custom attribute (the post before :grinning:), let say that ive the scale factor in vertex shader. in what value i need multyply to scale a shape?