PDA

View Full Version : how to disable normal calculations for a glucyclinder ?



HamsterofDeath
01-16-2003, 03:18 AM
the topic is the question...i want to give a cylinder my own normals (which are mathematically not correct, but i need do to this)

MickeyMouse
01-16-2003, 03:24 AM
Are you sure you need incorrect normals?
I don't think it's possible with glu library, but you can easily implement your own cylinder.

nexusone
01-16-2003, 09:22 AM
I know that you can enable or disable texture from being built with a glusphere, but not sure about the normals.

I think would have to build your cylinder, if you did not want normals.



Originally posted by HamsterofDeath:
the topic is the question...i want to give a cylinder my own normals (which are mathematically not correct, but i need do to this)

pleopard
01-16-2003, 01:19 PM
It's simple ... you set the normals calculation mode for the quadric, not the cylinder using gluQuadricNormals(quadric,GLU_NONE). Similarly, you set the normals mode for flat or smooth shading using the tags GLU_FLAT and GLU_SMOOTH. For example ...



GLUquadricObj* pQuadric = gluNewQuadric();
gluQuadricNormals(pQuadric,GLU_NONE);
// ...
gluCylinder(
pQuadric,
baseRadius,
topRadius,
height,
slices,
stacks
);



[This message has been edited by pleopard (edited 01-16-2003).]

HamsterofDeath
01-16-2003, 10:23 PM
thx. i need this because :
if the sun is directly above the trees, they are much to dark, because :

sun : here

tree :

/\
&#0124; &#0124; <- 90 degrees to sun -> dark
&#0124; &#0124;

the landscape below the tree is very bright...
so i want to give the whole tree a normal of 0,1,0.
can i do this by setting the normal before the tree is drawn ?