Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 4 of 4

Thread: Wrong direction

  1. #1
    Junior Member Newbie
    Join Date
    Jun 2001
    Location
    mumbai, india
    Posts
    15

    Wrong direction

    i created a sphere and and was able to map a world texture on it. but texture i have pasted is not positioned properly.
    for eg.
    texture on sphere must be like this


    1.0 1,1

    0,0 0,1

    but on sphere it is like this,


    1,1 0,1

    1,0 0,0

    what should i do ?
    we bring good programming to life......

  2. #2
    Member Regular Contributor
    Join Date
    May 2000
    Location
    Philadelphia
    Posts
    332

    Re: Wrong direction

    You can use texture matrix to flip or rotate.

  3. #3
    Junior Member Newbie
    Join Date
    Jun 2001
    Location
    mumbai, india
    Posts
    15

    Re: Wrong direction

    how ?
    we bring good programming to life......

  4. #4
    Member Regular Contributor
    Join Date
    May 2000
    Location
    Philadelphia
    Posts
    332

    Re: Wrong direction

    glMatrixMode(GL_TEXTURE);
    glLoadIdentity();
    glRotatef(90.0f, 0.0f, 0.0f, 1.0f); //to rotate by 90 degrees
    glScalef(-1.0f, 1.0f, 1.0f); //to flip horizontally
    ....
    ....
    glMatrixMode(GL_MODELVIEW); //back to model view

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •