Elliptic ring generation problem

35 pts.
Tags:
Visual Basic
Visual Basic 6
Hi,

I'm working on a multiple rings galaxy generation script. Everything works fine but one thing: two of the rings partially repeat themselves with an offset from the planned position. I guess it's only a logic mistake but I just can't find out!

You can look at these images for a better understanding:

http://www.amelora.com/galpict1.jpg
http://www.amelora.com/galpict2.jpg (even more obvious!)

On these images I called only the functions generateEllipse (galpict1) and betweenEllipses (galpict2)

My code is in VB6 but should be easy to translate if needed.

You can get the source at:

http://sevynos.byethost12.com/GalaxyGen.frm

If you want to get the result from the images you have to choose "Final" mode. Be warned that this is a long process. On my Quad Core CPU it take 90sec. If you want to make it faster, lower the stars number in "btGenGal_Click". Note that right now, the only one which execute is "betweenEllipses". If you want to try the other functions, just uncomment.

If you want to save the resulting image, make sure you have a folder named "C:Temp" or change the path in "Command5_Click". Be warned that the resulting file will be a 250MB bitmap (.bmp).

Any help would be appreciated.

Thanks

P.S.: Unfortunately the itknowledgeexchange's text editor wasn't working when I wrote this question so I couldn't put direct links in the text and was forced to put manual line breaks. So I'm sorry if it appear weird on your screen!


Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question: 3  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • TomLiotta
    Your image links only brought up pages with ads. The VB source link was okay. Can you try different links for the two images? You can edit the question to edit the links. -- Tom
    125,585 pointsBadges:
    report
  • sevynos
    Images now hosted on another server.
    35 pointsBadges:
    report
  • TomLiotta
    Yes, I saw the new images. It looks like the outer ellipse(s) are partially reflected off of origins at the lower right corners. But they're only partial reflections; they don't seem to continue all the way to the edges. An effective debug method might require cutting way back on the number of points. -- Tom
    125,585 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following