Results 1 to 3 of 3

Thread: Rotation problem.

  1. #1
    Member Newbie
    Join Date
    Jan 2011
    Location
    Australia, Western Australia
    Posts
    37

    Rotation problem.

    I don't know what the problem is, the cross draws properly.
    but there's no rotation.

    helps?!


    Code :
    #include <iostream>
    #include <gl\glut.h>
     
    using namespace std;
    float Color(0.0);
    int Frame(0);
    int Angle(40);
    float interval(0);
    void FrameCount(void)
    { 
    	cout << "Frame: " << Frame << "\n";
    }
    void glCross (void)
    {
    	glClearColor(1, 1, 1, 1);
    	glClear(GL_COLOR_BUFFER_BIT);
    	glOrtho(-1, 1,-1,1,-1,1);
    	glLineWidth(10.0);
    	glBegin(GL_LINES);
    		glRotatef(Angle, 1, 0, 0);
    		glColor3f(0, 0, 0);
    		glVertex2f(-1, 0);
    		glVertex2f(1, 0);
    		glVertex2f(0, 1);
    		glVertex2f(0, -1);
    	glEnd();
    	glutSwapBuffers();
    	glFlush();
    	Frame++;
    	Angle++;
    	FrameCount();
    }
    void main(int argc, char **argv)
    {
    	glutInit(&amp;argc, argv);
    	glutInitWindowPosition(500,500);
    	glutInitWindowSize(500,500);
    	glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
    	glutCreateWindow("Cross");
    	glutDisplayFunc(glCross);
    	glutIdleFunc(glCross);
    	glutMainLoop();
    }

  2. #2
    Senior Member Frequent Contributor
    Join Date
    Mar 2009
    Location
    Karachi, Pakistan
    Posts
    810

    Re: Rotation problem.

    HI,
    Keep your glRotate cal outside glBegin/glEnd call
    call it before glBegin.
    Regards,
    Mobeen

  3. #3
    Member Newbie
    Join Date
    Jan 2011
    Location
    Australia, Western Australia
    Posts
    37

    Re: Rotation problem.

    Okay Thank you

Similar Threads

  1. problem with rotation
    By in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 03-08-2005, 07:25 PM
  2. need help with this rotation problem
    By imported_spooky in forum OpenGL: General
    Replies: 1
    Last Post: 04-15-2004, 11:08 PM
  3. rotation problem
    By hoganh in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 11-28-2003, 08:02 AM
  4. Rotation problem
    By mohsin in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 06-30-2001, 03:17 AM
  5. Rotation problem, i even do a WEB page to let you see my problem
    By sicklab in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 12-19-2000, 12:47 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean