PDA

View Full Version : pyramid



fox
12-15-2000, 01:52 AM
Hi
I have drawn pyramid below square based top and bottom - how can i shade it so the it colour gradually fades as it increases in size - also how could I make it solid or add a lid?
gluCylinder(pyramid, 0.4, 4.0, 10.0, 4.0, 10.0);

thanx

[This message has been edited by fox (edited 12-15-2000).]

zed
12-16-2000, 08:10 PM
enable blending
float min_size = 1.0;
float max_size = 10.0;

glColor4f( 1,0,0, (float)size / (max_size - min_size);
draw pyramid

not to sure if i understand the other 2 questions
btw a pyramid is just 6 triangles

fox
12-18-2000, 02:09 AM
glColor4f( 1,0,0, (float)size / (max_size - min_size);

what is size? (declaration)