How to rotate a 2d ball in 2.5d space

Hi,

I am building a 2d pool game in corona.

I want to rotate my 2d pool balls in 2,5d or 3d space on pool table so that my pool balls look like they are rotating on the pool table rather that sliding on it.

Can anyone help me with how I can do that.

Thanks

Vishal

Well Corona SDK isn’t a 3D engine but you can make a sprite that makes the ball look like it rotating.

–SonicX278

Hi SonicX278,

Thanks for your help. Can you please guide me how to make a sprite of a rotating ball in corona. I am stuck.

_Vishal

Well the only way I really know how is in adobe after effects. If you have it you could and ball rolling animation and then export as GIF and then go online and convert that to a sprite.

–SonicX278

I think using sprites wastes a lot of performance.

I assume in your game you view at the table from straight above.

A solution would be to use a circular mask (radius of the balls) to mask a display group, put an image of the ball (in most cases flat colors with the stripes and numbers of the ball on it) and a transparent oberlay which contains the lights and shadows of the ball in it.

Now you can move an rotate the balls image as needed. This might not be perfect 2.5D but i most cases it’s absolutly enough. (the human eye is ticked very easily :wink: )

Well Corona SDK isn’t a 3D engine but you can make a sprite that makes the ball look like it rotating.

–SonicX278

Hi SonicX278,

Thanks for your help. Can you please guide me how to make a sprite of a rotating ball in corona. I am stuck.

_Vishal

Well the only way I really know how is in adobe after effects. If you have it you could and ball rolling animation and then export as GIF and then go online and convert that to a sprite.

–SonicX278

I think using sprites wastes a lot of performance.

I assume in your game you view at the table from straight above.

A solution would be to use a circular mask (radius of the balls) to mask a display group, put an image of the ball (in most cases flat colors with the stripes and numbers of the ball on it) and a transparent oberlay which contains the lights and shadows of the ball in it.

Now you can move an rotate the balls image as needed. This might not be perfect 2.5D but i most cases it’s absolutly enough. (the human eye is ticked very easily :wink: )