I'm trying to render a non uniformly scaled sphere(ellipsoid) using point sprite in GLSL 440 or GLSL version higher than 330.
As we know, the point sprite in GLSL, can easily draw a unit sphere, but it's difficult to draw a ellipsoid with special requirements.
My thoughts are as follows:
- Firstly, I have a point(center of the sphere);
- Then, render a unit sphere using the point sprite;
- Suppose that the sphere is transformed by a rotate-scale matrix(non uniformly scaled);
- Then the transformed ellipsoid is rendered on the screen. reference: Line-ellipsoid intersection
In old OpenGL version, the function glutSloidSphere() in GLUT lib can easily realize this, but how can I code in the modern OpenGL 4.x using fragment shader? Thanks a lot!
The final effect I want is similar to the one shown below.