generating texture coordinates...

Hi, I’m looking for highly detailed docs/tutorials/book references to learn how to generate texture coordinates (spherical/cubic/planar…) in a home made 3D editor.
thanks for any pointer you can provide.

>
Hi! I’m trying to do the same currently. First I tried copy pasting q3Radiant code. It generates the texture coordiantes for the brush planes but it all seems to be messed up. No wonder, as Quake uses a different coordinate system while I’m using the default OGL coordinate system.

I tried looking for material on this subject but could’nt find any. I’ll be glad to receive any help or give any help on this.

Kind of related to this problem. I am trying to generate texture coordinates for generic meshes. By this, I mean, I only posess the vertices and connectivity information/faces.

There was a paper on the use of kohonen neural networks to generate meshes from points. It also included how to generate texture coordinates.

Anybody have a suggestion. Thanks.

Texture Coordinate Generation depends on your Vertex-Coordinates.
The general approach is to project a normal from your vertex to your Plane/Cylinder/Sphere and then use the point in your texturemap-coords (plane, cylinder and sphere have only 2 parameters to construct them).

for example if you want to generate a planar texture coordinate for a Vertex, just use the X/Y coords of your vertex. (you can scale them and add an offset, but this the basic transformation):

U=sx * V.x + tx;
V=sy * V.y + ty;

You can also use X/Z, Y/Z for generating, then you just use another plane.

Hope that helps a little bit…
Peter

Originally posted by maximian:
[b]There was a paper on the use of kohonen neural networks to generate meshes from points. It also included how to generate texture coordinates.

Anybody have a suggestion. Thanks.[/b]

My suggestion is to leave neural networks out of the way. They’re way over-complicated for the purpose and I don’t think they can give very useful results at all.

Now, the CSG subsystem I am developing is all but completed however, some of its basic concepts should apply pretty well to other kinds of applications.
There are basically two kinds of meshes:
GSC meshes. Those can be build from GSC ops. At the lowest level, every GSC entity has specific code to generate texCoords. So planes generate their texcoords according to their settings while cubes and spheres use other methods.
Complex meshes. Those are so complicated building them from GSC ops is way unpratical. Artist is responsible to generate correct texcoords for this kind of meshes.

Maybe you should be more clear about the kind of meshes you’re trying to use.
If you are going to generate texcoords for arbitrary meshes, the only thing I can tell you is good luck. This is work for artists, you could manage to make it some times but there will be times in which it will look simply ugly.