Bint
2014-03-13 17:20:49 UTC
Hello,
I'm trying to generate points for an ellipse in OpenGL. The simple
ellipse has been easy, as I just scale the points for a circle in the Y
direction to squash or stretch. I don't know if this is an actual ellipse,
but for my purposes it's ok.
The problem is that I want to generate the points for a border around that
ellipse, and the border needs to be a constant width all the way around. I
can't just generate the points for a slightly larger ellipse the way I am
doing now, because the border width will scale along with the wider axis.
Is there any easy way to generate the points for the border? I am thinking
maybe I need to slightly alter the scaling according to my border width, but
I am not sure what the calculation should be.
OR, maybe I need to find a "real" ellipse equation and generate the points
that way? So far though all I have found online seems to be equations that
generate the points for a circle and scale the X and Y differently. Maybe
that is a real ellipse, I don't know.
Thanks!
B
I'm trying to generate points for an ellipse in OpenGL. The simple
ellipse has been easy, as I just scale the points for a circle in the Y
direction to squash or stretch. I don't know if this is an actual ellipse,
but for my purposes it's ok.
The problem is that I want to generate the points for a border around that
ellipse, and the border needs to be a constant width all the way around. I
can't just generate the points for a slightly larger ellipse the way I am
doing now, because the border width will scale along with the wider axis.
Is there any easy way to generate the points for the border? I am thinking
maybe I need to slightly alter the scaling according to my border width, but
I am not sure what the calculation should be.
OR, maybe I need to find a "real" ellipse equation and generate the points
that way? So far though all I have found online seems to be equations that
generate the points for a circle and scale the X and Y differently. Maybe
that is a real ellipse, I don't know.
Thanks!
B