Manually calculating Texture Coords for a Cone

This may sound like an odd question…

If I have a cone, and I know the x,y,z values of some point on the cone, is it possible to cacluate the texture coordinates manually?

Another way of looking at it is,

If I take a cone and slice down one side from the tip to the base, then flatten it out, how can I calculated the cartesian coordinates of each point on the cylinder?


a cone can be described with 2 geometrical parameters. for a cone with base at z=0, pointing into z-direction:

r_0 = radius at z=0
h = z-value at the tip

the coordinates can be calculated with

[x, y, z] = [r(z)*cos(phi), r(z)*sin(phi), z]

with r(z) = r_0*(1-z/h)

so this is a way to describe a cone with two varying parameters, phi (from 0…2*pi) and z (from 0…h). these varying parameters can be used as texcoords.

EDIT: r(z) = r_0*(1-z/h), not r_0*(1-h)