View Full Version : Contour Shading
Is there a way of specifying the colour transition from one vertex of a quad to the other. Say with the following code
The default colour transition will be blue to red in a default number of colour bands. I want to be able to specify firstly the number of colour bands and also the colour of the intermediate ones.
08-12-2003, 12:44 AM
- try indexed mode.
- use a texture which represent the color transition.
- add vertice to you quad with the corresponding color.
How do you apply 1D Texture to a QUAD which is a 2D entity
08-12-2003, 02:50 AM
if you want the color transition only on the quad's edge, you'll have to use a 2D texture.
Each of the vertices might have different colours assigned to it so a 2D texture image will not be suitable.
08-12-2003, 03:18 AM
I don't see what do you mean. a little image should help.
08-12-2003, 03:26 AM
Put the bands in a 1D texture. Then use glTexCoord1f instead of glColour to specify the "band index" 0.0 for one end of the bands and 1.0 for the other. This should work. Try it before you say it won't work on a quad since it's 2d at least. Then again, you might want something else than what I think you want. If so, you need to explain more.
Say the quad is as follows
Where the corner points have different colour code to be assigned. In the above diagram, the contour lines would go diagonally across.
Powered by vBulletin® Version 4.2.3 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.