Doubts about GlTexGenfv

I have been doing a bit of research on how generate textures coordinates automatically (at first I didnt know it could be done with openGL). I have found this function “glTexGenfv” which is supposed to generate texture coordinates of a model but I got a few questions about it. First, does it work with any model? I have seen that it is used for basic objets such as spheres or cubes but I wonder about complex ones. Second, once this function is used, how does it know which geometry uses (the model basically)? My guess is that it probably uses the geometry stored in the GPU but I am not sure.

Thanks in advance for any reply.

glTexGen() either applies a linear transformation to the vertex positions or performs environment mapping (computing a reflection vector and finding its intersection with an environment map). It won’t “unwrap” a mesh, similar to how texture coordinates are generated in a modelling package such as Blender.

Oh then I misunderstand how that works, well for future references if somebody wants to generate UV coordinates automatically just go here: