Results 1 to 10 of 10
Thread: circular movement
- 08-25-2013, 11:08 AM #1
Senior Member
- Join Date
- Jan 2013
- Posts
- 124
- Rep Power
- 0
- 08-25-2013, 12:13 PM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 14,422
- Blog Entries
- 7
- Rep Power
- 29
Re: circular movement
Google for "Bresenham circle"; it is an extremely efficient circle drawing algoritm that takes n steps where n is the number of pixels on the circle.
kind regards,
JosBuild a wall around Donald Trump; I'll pay for it.
- 08-25-2013, 06:31 PM #3
Senior Member
- Join Date
- Jan 2013
- Location
- Northern Virginia, United States
- Posts
- 6,226
- Rep Power
- 15
Re: circular movement
One of the rewards of participating in a forum. I never heard of the "Bresenham circle." Now I have something else to read about.
Regards,
JimThe JavaTM Tutorials | SSCCE | Java Naming Conventions
Poor planning on your part does not constitute an emergency on my part
- 08-25-2013, 08:10 PM #4
Senior Member
- Join Date
- Jan 2013
- Posts
- 124
- Rep Power
- 0
Re: circular movement
Yes, it seems quite interesting. But does it work with 500 point in different radiuses atthe same time ? The end product should be: point spawns somewhere on the screen. point starts moving towards the given mid point. after reaching certain distance from the midpoint, the point smoothly converts its linear movement towards the middle into circular movement around the midpoint.
And this tyoe of movement should work with eatch of the 500 point and all the point orbit around the midpoint with different radiuses.
- 08-25-2013, 08:53 PM #5
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 14,422
- Blog Entries
- 7
- Rep Power
- 29
Re: circular movement
Congratuations, you have just changed the problem requirements; what you describe now isn't a circular movement, it's a spiral; maybe google can be of further help.
kind regards,
JosBuild a wall around Donald Trump; I'll pay for it.
- 08-26-2013, 02:27 PM #6
Senior Member
- Join Date
- Jan 2013
- Posts
- 124
- Rep Power
- 0
Re: circular movement
It is not a spiral, it will never reach the midpoint it just keeps its distance from the midpoint. I can use Bresenham circle in hte secondpart of the movement, but the first part needs to be something else. I would show you the picture of whati mean, but unfortunatle the upload image function in this forum doesent work for me.
- 08-26-2013, 02:53 PM #7
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 14,422
- Blog Entries
- 7
- Rep Power
- 29
- 08-26-2013, 04:13 PM #8
Senior Member
- Join Date
- Jan 2013
- Posts
- 124
- Rep Power
- 0
Re: circular movement
Ok ill try.
Step 1: Particle is generated
Step 2: Particle starts moving straight towards the middle point
Step 3: After reaching Radius + X pixels away from the midpoint particle trajectory starts to curve
Step 4: Curvature ends when particle reaches Radius pixels from midpoint
Step 5: From thispoint onward i can use Bresenham circle
The problematic spot is Step 3 and Step 4. I want the particle to go smoothli into the orbit. Well the number 6 and number 9 somewhat reseble the trajectory im wanting.
- 08-26-2013, 05:04 PM #9
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 14,422
- Blog Entries
- 7
- Rep Power
- 29
Re: circular movement
In other words: let the centre of the circle be at (0,0) and the particle is moving downwards; it is moving in the same direction as the radius 'r' from (0,r) to (0,0); at a location (0, r+x) it has to change its direction (suppose it starts moving to the right and downwards) such that when the distance of the particle to the centre equals r, it has to have a direction perpendicular to the radius r at a point (x,y); so its direction should be -x/y (or x/-y) where x^2+y^2 == r^2; hm, my guess would be a discretization of a differential equation ...
I'll keep it in the back of my head ...
kind regards,
JosBuild a wall around Donald Trump; I'll pay for it.
- 08-28-2013, 06:46 PM #10
Senior Member
- Join Date
- Jan 2013
- Posts
- 124
- Rep Power
- 0
Similar Threads
-
How to control gain between mouse movement and cursor movement ?
By DrPete in forum New To JavaReplies: 2Last Post: 03-10-2012, 04:26 AM -
Circular/Round Button
By Dilwar in forum AWT / SwingReplies: 1Last Post: 10-23-2011, 09:28 AM -
Java 3D circular movement?
By AXELTOPOLINO in forum Advanced JavaReplies: 7Last Post: 08-12-2011, 04:31 PM -
CIrcular Arrays
By Bgreen7887 in forum New To JavaReplies: 1Last Post: 03-25-2011, 07:30 AM -
Need help with circular arrays
By bap2 in forum New To JavaReplies: 6Last Post: 11-04-2010, 08:39 PM
Bookmarks