Results 1 to 10 of 121

Thread: G.T.A.2 Map Editor

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #11
    I think you are almost there, but it's unclear why some other also have offset. Like peds:
    Right side has offset:



    In my friends renderer he deals with "alignment"
    He draws peds with alignment like this:

    Code:
       if (align){         VBO.Add(Vector3f(pos.x+w/2,pos.y+h/2,pos.z),Vector2f(texEntry->U2,texEntry->V2));
                VBO.Add(Vector3f(pos.x+w/2,pos.y-h/2,pos.z),Vector2f(texEntry->U2,texEntry->V1));
                VBO.Add(Vector3f(pos.x-w/2,pos.y-h/2,pos.z),Vector2f(texEntry->U1,texEntry->V1));
                
                VBO.Add(Vector3f(pos.x+w/2,pos.y+h/2,pos.z),Vector2f(texEntry->U2,texEntry->V2));
                VBO.Add(Vector3f(pos.x-w/2,pos.y-h/2,pos.z),Vector2f(texEntry->U1,texEntry->V1));
                VBO.Add(Vector3f(pos.x-w/2,pos.y+h/2,pos.z),Vector2f(texEntry->U1,texEntry->V2));
    }
    He does some addition and dividing. "Pos" struct is (X,Y,Z) position to draw ped at, "W" is ped sprite width (NPOT).

    I should try to make minimal app with this VBO and use my texture, maybe it actually solve this.
    Im not sure.



    EDIT

    Ok, i think you are correct that this actually should be like this.
    if you look at the ped above, it's centered. I tried some other peds and objects.
    They seem to be centered enough.

    I think that's it. It's just supposed to be like that.

    Another ex:
    Black borders but c. car is centered:



    Thank you for helping.
    Last edited by hwnd; 31-03-2013 at 04:02 PM.

Tags for this Thread

Bookmarks

Posting Permissions

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