1. Black Friday Sale - 50% off

    B4A Standard for $29 instead of $59!
    Buy Now
    Dismiss Notice

How to make a ball move round a circle?

Discussion in 'Questions (Windows Mobile)' started by Stellaferox, Jan 6, 2009.

  1. Stellaferox

    Stellaferox Active Member Licensed User

    Hi all,

    I am trying to make a ball move around a printed full circle (say a planetary orbit). How can this be achieved in the simplest way?
    I am looking for the graphical implementation. The math I know.
    thnx in advance
    Marc
     
  2. klaus

    klaus Expert Licensed User

    Some questions to better understand what you want to do.
    - is the 'printed full circle' drawn on the form ?
    - or is it an image on the background ?
    - is the ball a simple circle or a bitmap ?
    - do you want the ball turn around it's own center ?

    A simple way would be to draw the ball on the forelayer of the form, either directly or with the ImageLibEx library.
    If you need to turn a bitmap you must use the ImageLibEx library.

    But the Sprite library would probably be the right library for your project.
    Unfortunately I have never used it.

    There exists an example for the Sprite library:
    Basic4ppc - Windows Mobile programming and Pocket PC Development

    Best regards.
     
    Last edited: Jan 6, 2009
  3. Stellaferox

    Stellaferox Active Member Licensed User

    Hi Klaus,

    Thanx for your answer.
    The "ball" is in fact a planet. I am building a graphical representation of the solar system.
    The circle of course is the orbit, which in fact is an ellipsoid, which makes it harder with the math.
    I want to move the planet around the orbit. I think your suggestion is the right one. I will try this.
    At first I will try to make a circle moving. When it works I usually "pimp" the program.
    thnx again
    Marc
     
  4. klaus

    klaus Expert Licensed User

    Hi Stellaferox,

    Here is an example of what could be done, with a circle.
    Of course with an elipsoid the maths will be a little bit more tricky.

    Best regards.
     

    Attached Files:

  5. Stellaferox

    Stellaferox Active Member Licensed User

    Thnx Klaus,

    Will try this one out. Have already looked at some other examples.
    Marc
     
  6. bdiscount

    bdiscount Active Member Licensed User

    Just off the top of head you can use array pts for the elipsoid (Form1.polgon etc)and then move planet from pt to pt using the rotation in dzt's lib. just a thought
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice