Results 1 to 5 of 5

Thread: a rectangle as a inclined parallelogram

  1. #1
    Junior Member
    Join Date
    Mar 2008
    Posts
    9

    a rectangle as a inclined parallelogram

    Hello everyone, I was trying to make an example using openGL and then porting it to openGLES.
    I draw a rectangle like this:
    v0 = -1.0, 0.0, 0
    v1 = -1.0, 1.0, 0
    v2 = 1.0, 1.0, 0
    v3 = 1.0, 0, 0
    GLfloat vertices[] = {v0,v1,v2,v3};
    ...
    glVertexPointer(3, GL_FLOAT, 0, vertices);
    glDrawArrays(GL_TRIANGLE_FAN, 0, 4);

    and in desktop I see it right but when I port the code to openGLES I see it like a parallelogram with a 45 inclination.
    Desktop vs. PDA


    Can anybody tell me what can make this transformation?
    Thanks in advance,
    Santiago

  2. #2
    Junior Member
    Join Date
    May 2008
    Posts
    6

    Re: a rectangle as a inclined parallelogram

    Hello Santiago,

    My first reaction to seeing those images is that that is not a tranformation problem but a pixel copy problem.

    Given those images, it seems the implementation is copying scan lines to the frame buffer from bottom to top and that it's copying one pixel more per line than it should. That creates the vertical bar you can find at the top right of the image. If you just draw an empty scene does that black bar (or garbage pixels) still appear at the top right?

    If this is the problem I would have no idea about how to go about fixing it. It's seems to be a bug with memory copying so I'd start by checking all the places where you are copying into the framebuffer.

    I hope that helps,
    Ian

  3. #3
    Junior Member
    Join Date
    Mar 2008
    Posts
    9

    Re: a rectangle as a inclined parallelogram

    Hi, thanks a lot for your reply.
    ...If you just draw an empty scene does that black bar (or garbage pixels) still appear at the top right?...
    I've just tried and yes... it still appear. I also made another test, I draw an empty scene with another size (an square of 191X191).
    The result:

    In this example I have 2 black bars, so it incremments the amount of garbage pixels.
    It seems to be what you said, but I don't know what can I do to fix it.
    I'm using Vincent implementation and I'm doing all the test in an IPaq hx2700 with Win Mobile5. Do you recommend me another opengles implementation?
    I'm going to see what you said, the places where I copy into the framebuffer.
    Thanks,
    Santiago

  4. #4
    Junior Member
    Join Date
    May 2008
    Posts
    6

    Re: a rectangle as a inclined parallelogram

    Quote Originally Posted by srobles
    I'm using Vincent implementation and I'm doing all the test in an IPaq hx2700 with Win Mobile5. Do you recommend me another opengles implementation?
    Sorry, I'm actually not familiar with opengl-es and it's implementations enough to recommend a different version or a fix. With Vincent you have all the source code so maybe you can track it down.

    Good Luck,
    Ian

  5. #5
    Junior Member
    Join Date
    Mar 2008
    Posts
    9

    Re: a rectangle as a inclined parallelogram

    Problem fixed!
    my surface was 1 pixel wider than the openGLES's scene.
    Thanks for the help, I wouldn't discovered the error without your help.
    Santiago

Similar Threads

  1. Rendering a textured rectangle diaganol artifact
    By ceptri in forum Developers Coding:Beginner
    Replies: 1
    Last Post: 03-24-2012, 02:43 PM
  2. How to move Rectangle from one location to other location?
    By mnarkhede in forum OpenGL ES general technical discussions
    Replies: 5
    Last Post: 04-08-2008, 06:41 AM

Posting Permissions

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