Qbasicnews.com

Full Version: How to texturemap a ball?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
I want to simulate a billiard ball rolling and spinning, by texturemapping a circle. How can i do that?

An idea is divide the sphere by a mesh of triangles and map each triangle individually. But it seems too much work for a ball that will never be greater than 50 pixels.

The idea i used in my Earth spinning demo, a cylindrical texture maped into the sphere was good in that case, were the poles were never shown an the mapping formula was constant. In the case of the billiard ball the poles can move around and i should recalculate it continuously, so the amount of work would be bigger than with a mesh.

Any suggestion?

Has this been done in qb?
Well.... Qasir did something called "rollball" with a gouraud lit sphere, but I don't have the source, nor do I know if it can be changed into texture mapping...
I know that demo, it's Rollball.bas, I have the source Qasir once released.
Breaking the sphere in triangles and texturemapping them one by one seems to me too much work for a SMALL sphere. I was wondering if a more straightforward way existed...
What, like polarizing the texture to make it spherized?

(I'm using big words... heh heh)
Well, considering that there aren't that many balls in a pool game i wouldn't say it's too much work. It should run fast enough even on a 486.
Well, as I plan to leave my Pure QB policy and do it in UGL, it will probably be fast. Big Grin
I'd you use your earth demo thingy algo and recalc it realtime using tables. ;*)
wait, what's wrong with a spheremap table? just scroll the texture left, right, up and down to rotate. If i'm not mistaken, that's how it works in interplay's virtual pool series, right?

a texturemapped polygon would be too much, though. it'd look better and work faster with the above solution.
That's what I was telling him ;*)
*nods in approval*
Pages: 1 2 3