Game Development Community

Rolling ball in T2D

by Steve Miles · in Torque Game Builder · 10/03/2005 (11:29 am) · 4 replies

This question will become mute with the release of the billiards demo (i hope) but I keep thinking about how to handle a rolling ball in T2D and can't grasp how it would be done. I understand how to do the collisions, etc...but if you had a billiard ball, with a white circle and number, how do you get it to look like it's rolling as it moves. Is there a sprite animation trick? I would think not as technically there's 360 degrees to roll in, and if you add in a "spin" on the ball that's even more. I'm not looking for code examples, but just the general theory as to how it would be done.

Thanks in advance.

#1
10/04/2005 (12:31 am)
A) Lots of animated sprites. You'd probably have to work it so that the number allways ended on the top, then you could angle it, and play the animation... That should look OK.

b) Completely write a 3D rendering system in T2D ontop of OpenGL.
#2
10/04/2005 (1:08 am)
Alternatively, do like pretty much every purely-2D pool/billiards game I've seen and not animate the rolling. Most that I see simply turn off the number markings when the balls are hit, and then turn them back on when they come to rest. That would be the easy (sane) way out.
#3
10/04/2005 (9:37 am)
As an addition to Rickys' suggestions...

c) Compile the T2D files into TGE and use a modified 3D object for the balls.

- Melv.
#4
10/04/2005 (12:54 pm)
You could also implement some spherical warping on the fly of the decal using theta-phi transformations (search for spherical mapping, or cartesian theta-phi spherical mapping for techniques and even some source code).