Creating Contours in two directions

Greetings to all.

I would like to be able to create contour lines in two directions using the automatic texture coordinate generation. I have no problem getting the contour lines in one direction using a 1D texture map, but can’t seem to get this going in two directions.

Using the sample code in the OpenGL Programming Guide as an example, I simply want another set of contour lines to propagate at 90 degrees to the other contour lines.

I have tried creating a 2D texture and then specifying the T coordinate to be created in addition to the S coordinate. But my results haven’t been very good.

Is this the correct approach? If so, I would really appreciate some pointers in getting this to work correctly. If this isn’t the correct way to go about this, please let me know how this should be done.

Here is the code I am referencing which can be found at example 9-6

Thanks in advance for your time and help!