• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Fluid Motion Moving Circles Smooth -solved-

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Mark Quin
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
She's brilliant. She can see what can be and is not limited to what is. And she knows this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic