File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Fluid Motion Moving Circles Smooth -solved- Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Fluid Motion Moving Circles Smooth -solved-" Watch "Fluid Motion Moving Circles Smooth -solved-" New topic
Author

Fluid Motion Moving Circles Smooth -solved-

Mark Quin
Greenhorn

Joined: Oct 21, 2007
Posts: 15
I have a circle that follows another circle controlled by the user. But, the following circle works but can only move in angles. Is there any examples out there or some tips you can give me to have circles move fluidly.

x,y is the user controlled circle.
xpos,ypos is the following circle.


Here is my class:


[ October 25, 2007: Message edited by: Mark Quin ]
[ October 25, 2007: Message edited by: Mark Quin ]
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
So you want that circle to move at a fixed speed in the direction of the other circle?

I imagine there is a simple solution using Pythagoras' theorem.


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Mark Quin
Greenhorn

Joined: Oct 21, 2007
Posts: 15
So, a^2+b^2=c^2 some how can make fluid movement? Unlike of the current 45 deg angles that the ball loves to move in. Interesting, I wonder if I can find anything about how to implement it.

Are there any simple examples or links to them?

[ October 25, 2007: Message edited by: Mark Quin ]

solved, Just had to change some thing and make them doubles. =)
[ October 25, 2007: Message edited by: Mark Quin ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Fluid Motion Moving Circles Smooth -solved-
 
Similar Threads
How do I save a variable value -Unsolved-
change pixel value to cell coordinate
VectorCanvas
XML Parsing Issue
Circle collision Detection: Solved =)