Results 1 to 5 of 5

Thread: local and world coordinates

  1. #1
    Senior Member Regular Contributor
    Join Date
    Jul 2003
    Location
    Bangalore, Karnataka, India
    Posts
    123

    local and world coordinates

    Dear All,

    I always come across these two different tems.What do they refer.All these days I assumed there is only one coordinates which is the screen coordinate.Can any one provide difference with some examples

    With regards
    RAJESH.R
    RAIC,

  2. #2
    Senior Member Regular Contributor
    Join Date
    Apr 2003
    Location
    Toulouse, France
    Posts
    133

    Re: local and world coordinates

    an example:
    you have a model which is defined in local coordinates. that means that if you want to put the model in your scene, you have to translate+rotate it to the correct location.
    using glTranslate and glRotate, you manipulate the modelview matrix. when you call rendering functions, the vertice you give to opengl are transformed by this matrix.
    after this transformation, the vertice are in eye coordinate.
    in fact the modelview matrix combine two transformation: the view tranformation and the model transformation. first, the vertice are transformed by the model matrix and then are in world coordinate. then those vertice are transformed by the view matrix to get them in view coordinate.
    when modelview transfo is done, the vertice are transformed by the projection matrix. then they are in screen coordinate.

    local coordinate
    |
    MODEL matrix
    |
    world coordinate
    |
    VIEW matrix
    |
    view coordinate
    |
    PROJECTION matrix
    |
    screen coordinate

  3. #3
    Senior Member Frequent Contributor
    Join Date
    Nov 2002
    Location
    Latvia
    Posts
    626

    Re: local and world coordinates

    BTW, wtf is happening with normal? When I specify it I specify it in object(model/local) coordinates. In vshader I must mul it with MIT to get from Eye(View) to Obj coords, though vertex position is still in object coords and must be transformed by matrices later. So it comes that normal is transformed by Modelview before passing to vp, but vertices arn't

  4. #4
    Senior Member Regular Contributor
    Join Date
    Apr 2003
    Location
    Toulouse, France
    Posts
    133

    Re: local and world coordinates

    normals are not pre-transformed by modelview before VP.
    modelview is a 4x4 matrix. the upper left 3x3 matrix represent the rotation.
    Code :
    |       tx |
    |   R   ty |
    |       tz |
    | 0 0 0  1 |
    a 3x3 rotation matrix has this property:
    R^-1 (inverse) == R^t (transpose)

    so, modelview inverse transpose is:
    Code :
    |           0 |
    |     R     0 |
    |           0 |
    | tx ty tz  1 |
    in a VP, you have to transform the normal only by the rotation matrix (it have no sense to translate a normal). since in a VP you don't have the 3x3 rotation matrix, you have to use the inversed transposed modelview matrix.

  5. #5
    Senior Member Regular Contributor
    Join Date
    Apr 2003
    Location
    Toulouse, France
    Posts
    133

    Re: local and world coordinates

    a little mistake, the inversed transposed modelview matrix is;
    Code :
    |              0 |
    |      R       0 |
    |              0 |
    | -tx -ty -tz  1 |

Similar Threads

  1. Texture Coordinates and Depth Buffer to obtain world coordinates
    By snkhan42 in forum OpenGL: Basic Coding
    Replies: 6
    Last Post: 04-27-2018, 11:52 AM
  2. Replies: 4
    Last Post: 06-08-2016, 07:01 PM
  3. Replies: 2
    Last Post: 06-02-2012, 08:10 AM
  4. Converting LOCAL coordinates to WORLD coordinates - How do I do it?
    By VuurSnikkel in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 07-23-2002, 08:48 AM
  5. Transforming local coordinates to world coordinates.
    By VuurSnikkel in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 07-19-2002, 01:46 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