3D Bowling Game Tutorial with PV3D and JiglibFlash

If you are using Papervision and want to expand into applications that involve physics engines, then you might be interesting in this 3D Bowling Game tutorial at thetechlabs.  Since it’s not a full-blown game, the concepts and code are easier to deconstruct.  You may either continue to expand on the game concept or take the ideas in a different direction.

Read the tutorial here.

Tiger or Federer?

Interesting question.  Tennis magazine poses the question of which player’s 14 major championships is a greater achievement; Tiger Woods or Roger Federer?  Readers of this blog know I’m a Federer fan, but I have to confess being a huge Woods fan as well.  In fact, during my golf craze, I was a member at Hank Haney’s golf ranch in McKinney and had the great honor of meeting Tiger.  He’s one of the nicest people you will ever meet.  So, I change my mind on answering this question about every 15 seconds.

In truth, it’s a very difficult question as comparing tennis and golf (at the professional level) is quite hard.  In golf, you truly compete against the course.  It’s rare that two people even play head-to-head in a final round to determine a championship.  The interesting observation about professional golf is the margin of error.  In tennis, you can get away with one or two bad shots and still win a game.  In stroke play in golf, one bad stroke over the course of four days can literally make the difference in a championship.  I think Tiger’s greatest asset is his ability to turn bad shots into par saves that keep the round going without giving up ground.

Tennis, on the other hand, is a direct physical (although not contact) confrontation with the other player.  Golf  affords long careers; tennis in the modern era allows only the smallest window for young players to accomplish the bulk of what they can possibly accomplish in a career.  If Tiger were a tennis player, he would already be on the ‘senior’ tour 🙂

The rate at which Federer has won majors is mind-boggling in the modern game; 14 majors in six years.  Add to that a record 20 consecutive appearances in a grand slam seminfinal.  If it were not for a bout with mono in 2008, it might have been 20 consecutive finals.

So, what’s my final vote?  Ask me in another 15 seconds 🙂

Papervision for Golf

I went through my golf craze in the 90’s and eventually worked my way to a single-digit handicap.  Although I don’t play any more,  I remember a lot of famous courses and holes, including the 15th hole at Bethpage.  At US Open green speeds, this setup is diabolical, but you can’t really get an appreciation for the difficulty of a hole from a few TV shots.  So, I was really interested when I saw this post from Carlos on a 3D recreation of that hole.   Papervision fans should enjoy the 3D and golfers should gain additional appreciation for the difficulty of the hole.

Degrafa Natural Cubic Spline Demo 3

I remember my professor in my first numerical analysis course talking about Lagrange interpolating polynomials and sampling the test function f(x) = 1/(1 + x2).  We already knew about oscillations in higher-order polynomials, so this discussion was about sampling increments.  The natural thought is to sample in equal increments across an interval.  Thus started a discussion about Chebyshev polynomials and Chebyshev nodes.  I actually found a good blog post about this very topic at John Cook’s blog.  John has a great blog on math and computation, btw.

I wanted one more demo showing how to create cubic spline nodes in script and highlight sections of the spline that were not necessarily in-between knots.  The new demo samples the above function at Chebyshev nodes in [-5,5] and fits a natural cubic spline to the nodes.  The area under the curve in [-1,1] is highlighted as shown in the screenshot below (by clicking the ‘Show Highlight’ button.

Natural Cubic Spline Approximation to a Function
Natural Cubic Spline Approximation to a Function

Click on the ‘Show Function’ button to show the original function plotted point-to-point to see a visual comparison of the spline approximation.  If you are interested, change the interpolation points and study the change in quality of fit.

Now that my trip down memory lane is complete, next step is to complete the Degrafa spline architecture (which is only about halfway there) and add a parametric spline.  I did correct a typo in the code, so you will need to update SVN.

View demo.

View source.

SuperShapes in Degrafa

SuperShapes are a mathematical construction popularized by Paul Bourke, allowing a very wide range of cool (2D and 3D) images to be generated by varying parameters in a single formula.  Originally proposed by Johan Gielis [1], the superformula was a means to describe complex shapes often found in nature.  Wikipedia article is here.

You can read up on the mathematical foundation of 2D SuperShapes here.  For those wanting to experiment with 3D SuperShapes, you can start here.  I also highly recommend visiting Bourke’s geometry page here.

While I’ve been doing mundane stuff with splines, the rest of the Degrafa team has been hard at work doing really cool stuff like adding SuperShapes to Degrafa.  You can read all about it here.

[1] Gielis, Johan “A generic geometric transformation that unifies a wide range of natural and abstract shapes”, American Journal of Botany 90, pp. 333–338

Algebrator

I’m always interested in computer tools for teaching math.  I recently heard about Algebrator by SoftMath and have been checking out the online animated demos.  Seems like this is a good tool for students needing help with basic concepts (kind of like a fixed-cost home tutor) or for teachers to create lessons and use as an interactive teaching aid.  I suppose it might also be useful for technical professionals wishing to quickly solve complex algebra problems, but most people I know already use Mathematica, Maple, or something similar.  Given a cost of about sixty bucks, it seems that individual students and teachers are the primary market for Algebrator.

There does not seem to be an online demo, so I can’t check it out in more detail.  If anyone is using this tool, I’d be interested in your feedback.  Check out Algebrator here.

TMF G.O.A.T

Watching Roger Federer at the US Open the past few years was a big part of my wanting to get back into tennis after about 25 years away from the game.  As a Federer fan, I was overjoyed at his winning the French Open today.  Not only does this tie Sampras’ slam record at 14, it gives Federer the elusive career slam (winning all four major championships over the course of a career).  His record now legitimately begs the question of GOAT (Greatest Of All Time).

In a phone interview from LA, Sampras stated, “I’m obviously happy for Roger. Now that he has won in Paris, I think it just more solidifies his place in history as the greatest player that played the game, in my opinion.”

As a Federer fan, it’s an easy sell for me, although I have to say that the GOAT title is probably shared equally with Rod Laver.  Comparing players across eras is difficult.  Laver won the grand slam (all four majors consecutively in a single year) not once, but twice.  This mind-boggling achievement is made even more so by the recognition that he played some of his best tennis before the Open era.  And, some might note that Federer might have an asterisk beside his title in that he did not defeat Nadal.  I would point out that Federer can only play the matches in front of him.  Besides, who is more dangerous?  Nadal or the person who knocked Nadal (and three other higher-seeded players) out of the tournament?  And, Federer did defeat Nadal at Madrid (on clay).

Tennis in the current era is a physical drain unlike any time in the past.  Players are in tremendous condition and the tour is an unrelenting grind.  Youth is served at a faster pace then ever in the past.  Just look at Del Potro.  Federer blew him away at the Australian (including a double-bagel), then DP took him to five a few months later at the French.  The window for winning slams seems to be a bit smaller every year.  This makes Nadal’s run at the French even more impressive and equally underscores Federer’s slam record.

Personally, I would like to see TMF retire with 15+ slams.  Given the pace at which young players are rising toward slam contention, this would be a monumental achievement, solidifying what is already a strong G.O.A.T argument.

May the Fed Express roll on!hr

Tennis Courts at the Hilton DFW Lakes

I’ve blogged a couple times about the USTA $50K women’s pro circuit event to be held at the Hilton DFW Lakes in Grapvine (where I’m fortunate enough to be a member of the sports club).  The courts were recently resurfaced in preparation for this event and I just uploaded a video.  It was a bit overcast on the day I shot the video and I’m not a professional videographer (nor do I want to be).  It should be enough to give you an idea of what the new courts look like.

So, if you’re interested in taking up or improving your game, or you’re interested in watching the pros play in early July, drop in for a visit or call the sports club at 817-410-6828.

Watch the video.

Hilton Site.

Twitter: HiltonDFWLakes or GrapevineTennis.

Degrafa Spline Approximation Over An Interval

Due to severe lack of spare time, Degrafa work is moving very slowly these days.  I just added the cartesian spline approximation over an arbitrary interval.  For the natural cubic spline, defined over an interval [a,b], this method produces a quadratic Bezier approximation in the interval [x1, x2], where the input interval is contained in [a,b].  This allows some interesting applications, including smooth animation of an area under a spline.  This is illustrated in a new demo.  A screenshot is shown below.

Approximating a natural cubic spline over an arbitrary interval
Approximating a natural cubic spline over an arbitrary interval

Next step is to add a parametric spline and work over the architecture so that the computational core of a spline is separated from the Degrafa geometry pipeline.  Over the long term, this should allow anyone to add (interpolative) splines to Degrafa with little, if any, understanding of the internal Degrafa architecture and geometry pipeline.

The demo shows the entire area under the spline statically highlighted using the normal quad. approximation (which is always exact at the knots).  Click the ‘Animate’ button to see the area dynamically highlighted over an arbitrary range.

View demo.

View source.