The Artima Developer Community
Sponsored Link

Java Buzz Forum
How to Go from Point A to Point B

0 replies on 1 page.

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 0 replies on 1 page
News Manager

Posts: 47623
Nickname: newsman
Registered: Apr, 2003

News Manager is the force behind the news at Artima.com.
How to Go from Point A to Point B Posted: Jan 5, 2010 9:11 AM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by News Manager.
Original Post: How to Go from Point A to Point B
Feed Title: Java Today
Feed URL: http://weblogs.java.net/blog/editors/index.rdf
Feed Description: Java Today on java.net
Latest Java Buzz Posts
Latest Java Buzz Posts by News Manager
Latest Posts From Java Today

Advertisement

You'd think it would be easy to go from point A to point B. And in a virtual world, it is -- especially if you don't care about having your animations look realistic. In our lead Java Today story, Animations 101 - from point A to point B, Kirill Grouchnikov takes out pencil and notebook to demonstrate the mathematical complexity that lies behind getting from here to there in the real world.

Kirill starts out with the basics:

In a perfect world (imagine a deserted highway), moving from point A to point B is just following the straight line.

So, in an animation, you would simply have the object start moving from point A with a given step size per second, and stop moving when it reaches point B. Kirill analyzes this technique as follows:

While this seems quite straightforward (and i have seen quite a few presentations that use linear animations), this falls apart once you translate the traveled distance to velocity:

This is hardly the way things move in the real world (be they man-made, inanimate or animate).

If Kirill's point isn't clear, consider a car on that deserted highway, at rest at point A. You want to drive it to point B. Does the car instantaneously lurch into motion at 65 miles per hour (~105 km/hr)? It would be very unfortunate for the passengers in the car if that actually happened, since it would mean that acceleration had momentarily approached infinity (only the car seat cushion's compression preventing that) -- quite possibly resulting in the passengers not being alive for the remainder of the journey to point B (consider being thrown at 105 km/hr into a rigidly stationary car seat -- no matter how soft the cushions, you're not coming out of that intact).

Is this what really happens when we travel somewhere? Of course not. In reality, the gas pedal is pressed, and the car's velocity increases (either quickly or slowly, depending on the engine and the driver) to a cruising rate. The trip proceeds at approximately the same crusing rate for most of the trip. Then, as point B is approached, the brake pedal is pressed, and the car slows down until it comes to a stop just as it reaches point B.

So, how can animations present movement in a more realistic manner? By applying mathematical formulas relating to velocity and acceleration that better replicate the actual physical world. Kirill's post covers all of this, and more: he goes into the situation where you don't stop at point B, you just go past it; the sitation where you "sprint to the finish"; the situation where you tire at the end of the trip and start slowing down (likely losing the Olympic gold).

If you've been making animations that apply the straightforward "now it's in motion, now it's not" technique, and you'd like to improve your product, Kirill Grouchnikov's Animations 101 - from point A to point B is an excellent starting point for your studies.


In Java Today, Kirill Grouchnikov presents Animations 101 – from point A to point B:

Movement is all around us in the physical world. We take it for granted since we see it from the moment we’re born. Today, i’m going to talk about a seemingly mundane act of moving from one given point to another given point. I would imagine that if you’re reading this, you most probably enjoyed your math lessons in middle school, so the following drawing should be familiar...

Toni Epple has found himself in Parleys & the NetBeans Platform certified Training:

What a nice surprise! I wanted to see my Devoxx talk on Parleys and entered my name in the search field to find out that the guys at the University of Würzburg have uploaded footage they took during our Training there almost two years ago. Here you can see me talking German...

Markus Karg presents Fun with EnumSet:

Do you know EnumSet? No? Then you should take the time to look at this sample code. EnumSet allows writing of really eloquent Java source code. Run the following code and watch its result printed on the screen. Then check the below source code to find out how it works. The source code particulary makes use of (at least) the following features introduced in Java 5...

In today's Weblogs, Arun Gupta announces a FREE Java EE 6 1-week online Codecamp - Jan 12th, 2010:

Happy New Year! Java EE 6, GlassFish v3, and NetBeans 6.8 were released last month. Are you interested in learning how this awesome combination of technologies and products make your life simpler ? Do you want to brush up your skill set and learn to write Java EE 6 code using NetBeans 6.8 and GlassFish v3 ? Would you like to learn tips & techniques from the experts in GlassFish community ? Do you want to start 2010 with a complete immersion in Java EE 6 & GlassFish v3 ? ...

Josh Marinacci reflects in 2009: a year closes:

You might be wondering where I've been the past few months. JavaFX and Java Store work has definitely heated up, which has taken up the bulk of my time. I've also been working on Project Maitai, a tool for reactive visual artwork, as well as traveling to Sweden to speak at OreDev. Now that the Oracle acquisition has received approval (or at least been approved to receive approval), I'm hoping that things will move ahead quickly and we can all get back to writing great software...

Cay Horstmann responds to a comment from Ed Burns in How to stay away from the JSF API:

A few weeks ago, Ed Burns posted a link to a blog on the JSF expert group mailing list, commenting “A nice one, but it doesn't mention JSF 2”. Ever the curmudgeon, I pointed out that it wasn't so nice that the blog's sample code used the JSF API in beans when it wasn't necessary—as does in fact a lot of sample code, even in the official Sun tutorials. Ed's response: “Cay, a blog comment by such an eminent citizen as yourself would certainly be noticed.” So, here is the curmudgeonly eminence's advice on how to stay away from the JSF API...

In the Forums, kmilo9999 has problems with libraries path: "Dear all: On this days im trying to use some new jars into my webapp with glassfish 2.1 (like hibernate search and others), but sometimes (actually, right now) glassfish just dont get the libraries path and sends the ClassNotFoundException. I put the jars into the project library, adding the jars into the classpath, into the glassfish lib folder and domain folder, but it keeps sending this exception..."

Felipe Gaucho asks [webtier] how to render based on authorization role ?: "how do I control certain visual elements to appear on the screen only if the user logged in has certain privileges ?? a sample project would be nice..."

rapiz asks How to write hebrew in TextField...: "Should i "addInputMode" to textfield? if so, how should i write the hashtable? with what key codes and values? If not what is the procedure \ method to do this? ..."


Our current Spotlight is Geertjan Wielenga's post 2010: The Year of Documented Reference Material for the NetBeans Platform: "Towards the end of 2008, I predicted that 2009 would be The Year of Documented Business Scenarios for the NetBeans Platform. I think, looking back at the past year, that, in particular via How to Create a Swing CRUD Application on NetBeans Platform 6.8, the year turned out as I had hoped. In addition to that, The Definitive Guide to NetBeans Platform was released during the past year as well, together with a massively updated NetBeans Platform screenshots page, which all relate closely to business scenarios for the NetBeans Platform. In the case of the book, the business scenarios were enabled, in the case of the screenshots page, the business scenarios were proved..."


Our current java.net Poll asks What's your outlook for the technology / software engineering economy in 2010?. Voting will run through Thursday or Friday (depending on where you live).


We've just published a new java.net Feature Article, Maven Repository Managers for the Enterprise/a>, by John Smart. We're also featuring Jeff Friesen's Reading Newsfeeds in JavaFX with FeedRead, in which Jeff demonstrates how to apply JavaFX's RSS and Atom newsfeed capabilities to create a snazzy little JavaFX app that can run stand-alone or in a browser.


The latest Java Mobility Podcast is Java Mobile Podcast 92: MIDP 3.0 in Depth: Tutorials and Demonstrations: Excerpts from the JavaOne 2009 MIDP 3.0 In Depth: Tutorials and Demonstrations session with Roger Riggs, Lakshmi Dontamsetti and Stan Kao.


Current and upcoming Java Events:

Registered users can submit event listings for the java.net Events Page using our events submission form. All submissions go through an editorial review before being posted to the site.


Archives and Subscriptions: This blog is delivered weekdays as the Java Today RSS feed. Also, once this page is no longer featured as the front page of java.net it will be archived along with other past issues in the java.net Archive.

-- Kevin Farnham
O'Reilly Media

Read: How to Go from Point A to Point B

Topic: Test-Driven Teaching - 1. Hello World Previous Topic   Next Topic Topic: Speculations for 2010, Part 2: The Multicore Challenge - Is It Still Relevant?

Sponsored Links



Google
  Web Artima.com   

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