PDA

View Full Version : transformations on GLUT sphere



curmudgeon42
12-05-2003, 06:38 PM
i have set up a small app that draw a sphere using glutSolidSphere(). i set up lighting and materials before drawing and the sphere looks correct with lighting and everything when the program is run.

however, i'm actually trying to draw a fish using the primitives available, and so i want so skew the sphere using glScaled() to make the sphere wide and flat. when i do this, the lighting looks terrible and all wrong.

is there any way to fix this, or do i have to draw my fish from scratch?

thanks,

justin

mikael_aronsson
12-05-2003, 11:16 PM
It's possible that you mess up your normals so much when you scale it that the lightings goes wacky, you could try to enable GL_NORMALIZE or use GL_RESCALE_NORMAL.

Mikael


[This message has been edited by mikael_aronsson (edited 12-06-2003).]

curmudgeon42
12-06-2003, 07:27 AM
i assume you just use glEnable(GL_NORMALIZE) and same witht he other one? i'll go try it

thanks,

justin

curmudgeon42
12-06-2003, 07:42 AM
that seemed to do it. thanks!