The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!
.(void)awakefromNib
{
rotateX = 30.0;
}
-(GLfloat)rotateX {return rotateX;}
-(void)setRotateX:(GLfloat)rx
{
rotateX = rx;
[self setNeedsDisplay:YES];
}
- (void) drawRect:(NSRect)rect
{
glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glPushMatrix();
GLfloat rx = [self rotateX];
NSLog(@"rx = %.2f \n", rx); // console: rx = 32.56
glRotatef(rx, 1.0, 0.0, 0.0);
glCallList(coordinates);
glPopMatrix();
glFlush ();
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
From novice to tech pro — start learning today.
Don't know why, but the variable should be defined outside the implementation body as
static GLfloat rotateX.
Now I can call myself an expert.