The Artima Developer Community
Sponsored Link

Java Answers Forum
arcs and animation

1 reply on 1 page. Most recent reply: Jun 22, 2002 11:59 AM by Matt Gerrans

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
Chant

Posts: 5
Nickname: meridian
Registered: Jun, 2002

arcs and animation Posted: Jun 21, 2002 10:56 PM
Reply to this message Reply
Advertisement
sry for all the questions. one more though. is it possible to draw an arc on an applet, and then have an object follow that arc by its x, y coordinates? basically, i'd like to drop a ball down the web page, and have it fall in a realistic curve, and thought that having it follow an arc would be the best solution, if possible.


Matt Gerrans

Posts: 1153
Nickname: matt
Registered: Feb, 2002

Re: arcs and animation Posted: Jun 22, 2002 11:59 AM
Reply to this message Reply
Of course that is possible, but I think it would be just as easy and even more realistic to give the ball some initial x and y velocity and calculate the effect of gravity on it as it falls.
Assuming no air, in the vertical,
v = v0 + at
(where a is 32 feet (or 9.8 meters) per second squared) and in the horizonal the speed remains constant. So at each interval, you calculate the new position (based on the current position and velocities) and update the velocity.

Flat View: This topic has 1 reply on 1 page
Topic: adding action listioner to user defined component Previous Topic   Next Topic Topic: Redirecting to a JSP page in a new window from servlet doPost method

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use