Page 1 of 3 123 LastLast
Results 1 to 10 of 22

Thread: Vertex Programs

  1. #1
    Member Newbie
    Join Date
    Aug 2001
    Location
    Switzerland
    Posts
    47

    Vertex Programs

    I've got a problem with TrackMatrixNV(enum target, uint address, enum matrix, enum transform);
    .
    Thr last parameter - transform - could be one of the following values:IDENTITY_NV,INVERSE_NV,TRANSPOSE_NV and INVERSE_TRANSPOSE_NV.

    So, what I understood:
    IDENTITY_NV: Tracks the Matrix as it is e.g. (vector)a' = (matrix)M*(vector)a
    INVERSE_NV: Tracks the inverse of the matrix. e.g. (vector)a = (inverse matrix)M^-1*(vector)a. If you have eyespace coordinates you can transform them back in world-space one's.

    BUT: What does TRANSPOSE_NV and INVERSE_TRANSPOSE_NV mean (my poor english...)? And what does it? Why do you track normals with INVERSE_TRANSPOSE_NV and not with IDENTITY_NV?

    Thanks
    qwert

  2. #2
    Senior Member Regular Contributor
    Join Date
    Feb 2001
    Location
    Australia
    Posts
    431

    Re: Vertex Programs

    Transpose of a matrix is like this:
    Code :
    If M1 =
    [a b c d]
    [e f g h]
    [i j k l]
    [m n o p]
     
    then M1' =
    [a e i m]
    [b f j n]
    [c g k o]
    [d h l p]
    Hope that helps.

  3. #3
    Member Newbie
    Join Date
    Aug 2001
    Location
    Switzerland
    Posts
    47

    Re: Vertex Programs

    Thanks, that helps.

    I try to understand Nutty's spec_nvp on www.nutty.org . There he made the following transformations (all with the ModelView-Matrix): he transforms the vertex-position with GL_IDENTITY_NV. The normal is transformed with GL_INVERSE_TRANSPOSE_NV and the light with GL_INVERSE_NV.

    Why this? why can't I(he) transform everything with the GL_IDENTITY_NV?

  4. #4
    Member Contributor
    Join Date
    Apr 2004
    Posts
    73

    Re: Vertex Programs

    Because normals don't have to be translated such as vertex position, only the rotation part of the matrix is useful (the scaling part can be too easily "annuled" by normals renormalisation or rescaling).

    @+
    Cyclone

  5. #5
    Member Newbie
    Join Date
    Aug 2001
    Location
    Switzerland
    Posts
    47

    Re: Vertex Programs

    Ok. And if I use GL_INVERSE_TRANSPOSE_NV only the Rotation-part of the matrix will by applied? I can't imagine that. The inverse of a Matrix A transforme a already transformed (with Matrix A) point back.

    Is there a rule, that vertex are transformed with the identity, the normals with the inverse_tranpose, and the light by transpose?
    I don't get it.

  6. #6
    Senior Member OpenGL Pro
    Join Date
    Dec 2007
    Posts
    1,077

    Re: Vertex Programs

    That's the point. You won't transform points with the inverse transpose, you will tranform the normals with this. It takes into account, that movement doesn't affect normals, as uniform scaling does not too.

  7. #7
    Member Newbie
    Join Date
    Aug 2001
    Location
    Switzerland
    Posts
    47

    Re: Vertex Programs

    Ok. I think I got it now. Thank you all

  8. #8
    Member Newbie
    Join Date
    Aug 2001
    Location
    Switzerland
    Posts
    47

    Re: Vertex Programs

    But what is with the Light-Poition? With the Normals it's clear. They stand for a direction, so translation would be fatal. The Light-Position should be translated an rotated like a usual Vertex, shouldn't it?

  9. #9
    Junior Member Newbie
    Join Date
    Sep 2001
    Location
    Germany
    Posts
    4

    Re: Vertex Programs

    c[0-4] ModelView Matrix

    "DP3 R0.x ,v[NRML] ,c[0];"
    "DP3 R0.y ,v[NRML] ,c[1];"
    "DP3 R0.z ,v[NRML] ,c[2];"

    Wouldn´t this transform the normal only with
    the 3x3 rotation part of the modelview matrix
    or am i totally wrong?

    so if this is correct why the transpose matrix?

  10. #10
    Senior Member Frequent Contributor
    Join Date
    Aug 2000
    Location
    Portsmouth, Hampshire, England
    Posts
    926

    Re: Vertex Programs

    Dont look at me, I just wrote the things!

    If any of it is wrong, someone tell me, and I'll sort them out.

    Seems to work thoug...

    Nutty

Page 1 of 3 123 LastLast

Similar Threads

  1. The end of vertex programs?
    By Korval in forum OpenGL: Advanced Coding
    Replies: 9
    Last Post: 09-29-2002, 03:35 PM
  2. Vertex programs?
    By blender in forum OpenGL: Advanced Coding
    Replies: 3
    Last Post: 07-01-2002, 11:26 AM
  3. Gf2 does vertex programs?
    By JD in forum OpenGL: Advanced Coding
    Replies: 14
    Last Post: 06-17-2002, 01:48 AM
  4. Vertex programs on a GF2/GF3/GF4
    By passalis in forum OpenGL: Advanced Coding
    Replies: 9
    Last Post: 02-11-2002, 12:39 PM
  5. vertex programs
    By beavis in forum OpenGL: Advanced Coding
    Replies: 3
    Last Post: 03-06-2001, 01:19 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