Tangent-Space????

Why is tnagent-space orthonormal basis not recalculated whenever an object gets trnasformed by the model-view matrix? I noticed this in many demos.
I’m working on per pixel bump mapping demo and couldn’t figure out how to use tangent-space correctly?
Thanks in advance.

why arent normals not everytime recalculated when you transform your mesh? possibly because you can transform them as well… tangentspace is just two other vectors additional to your normal, and those vecs can be transformed by the modelview as well…

Look at the source of the nvidia’s per pixel lit torus. The tangent space is calculated once and never transformed by the modelview matrix.

The light and view vectors (or positions depending on your light & material type) are transformed through the inverse modelview to object space. Then to tangent space with the usual math.

BTW, I didn’t check exactly what the code you cited does, this is just how it’s often done, and how I’ve done this in the past:
http://www.dorbie.com/bumplogo.html

[This message has been edited by dorbie (edited 07-07-2002).]

Originally posted by TurboCG:
Why is tnagent-space orthonormal basis not recalculated whenever an object gets trnasformed by the model-view matrix? I noticed this in many demos.
I’m working on per pixel bump mapping demo and couldn’t figure out how to use tangent-space correctly?
Thanks in advance.

well, coz tangent-space is defined in model space and not eye space. so when the model space changes(via changing the model view matrix), tangent-space changes in eye space but remains fixed wrt model space.
when the model view matrix changes, this affects the light or half vects that you need to transform into model space from eye space(via inv of model view)…but the transformation from model space to tangent space(via inv of tangent basis vects) need not change. hope this makes sense…