1. ## 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. ## 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. ## 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. ## 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. ## 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. ## 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. ## Re: Vertex Programs

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

8. ## 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. ## 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. ## 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 Last

#### Posting Permissions

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