Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I am trying to generate an ellipse outside two points (two-dimensional vectors).

Is there a formular for that, or a cool way of doing that in C# XNA?

What I am trying to do is have a particle circle around one player and another.

share|improve this question

1 Answer 1

up vote 2 down vote accepted

One approach would be to consider the coordinates of the two entities (the player and the opponent) to be somewhere on the major axis of the ellipse, preferably placed such that their visual extents do not intersect with the intended ellipse. From that you should be able to compute the extents of the major axis. The minor axis is then derivable from the major axis by multiplying the extent of the major axis by some aspect ratio.

Once you have the equation for a parametric ellipse, you can sample along it to compute coordinates suitable for particle placement - if you combine this with some perturbation of the equation you can probably get some nice artistic control over the effect.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.