setting color/material of textured object

I need to paste a texture onto a sphere. I then want to give the sphere some color and have it with some emmisive and opacity components. I guess I need to use the texture functions?

Any hints on how to do it?

Thanks

Well if you apply a texture say from a file, it texture will give it color.
But if you can use just a colored sphere and change the material settings to get what you want.

Here is example of material setting, you will need to have lighting enable also:

glEnable(GL_COLOR_MATERIAL);
glColorMaterial(GL_FRONT_AND_BACK, GL_AMBIENT); // Adjust ambient
glColor4f(0.5, 0.5, 0.5, 1.0); amount of change to ambient.
glColorMaterial(GL_FRONT_AND_BACK, GL_EMISSION);
glColor4f(0.0, 0.0, 0.0, 1.0);
glColorMaterial(GL_FRONT_AND_BACK, GL_SPECULAR);
glColor4f(0.25, 0.25, 0.25, 1.0);
glColorMaterial(GL_FRONT_AND_BACK, GL_DIFFUSE);
glColor4f(1.0, 1.0, 1.0, 1.0);
glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, 80.0);

Hint the fouth value in the glColor, alpha value, lower the number the more transparent the object.

Originally posted by mikemor:
[b]I need to paste a texture onto a sphere. I then want to give the sphere some color and have it with some emmisive and opacity components. I guess I need to use the texture functions?

Any hints on how to do it?

Thanks[/b]

[This message has been edited by nexusone (edited 09-29-2002).]

Thanks! Thats what I needed.

note: if you don’t set all the color materials (for instance, if you only setup ambient, diffuse and emissive) then you’d better call glEnable(GL_COLOR_MATERIAL) after the first call to glColorMaterial.