yoale

05-05-2003, 03:19 PM

Alright, I think I've got it!!! http://www.opengl.org/discussion_boards/ubb/biggrin.gif

I have a light vector that is from a light source to a vertex that has been tranformed to eye space. Now, if I multiply this vector by the inverse modelview matrix, I get the vector in object space right?

Now here's what I'm thinking...The inverse of a matrix that has only been rigidly transformed (ie no scales or skews), is just the transpose of itself (I read it in a math book at least http://www.opengl.org/discussion_boards/ubb/smile.gif.) Now, is it the same if the matrix has been translated? Or does the translation somehow throw off the inverse calcs? http://www.opengl.org/discussion_boards/ubb/confused.gif

The thing is, I have a bump-mapping algorithm that works well if a light position and three vertices are passed in. The trouble comes when I try to bump map only knowing a vertex, its normal, and a light position. I'd love to use the alg I already have (which requires three vertices), but my boss wants the alg to work if only one vertex can be known at any given time http://www.opengl.org/discussion_boards/ubb/mad.gif http://www.opengl.org/discussion_boards/ubb/mad.gif. I'd appreciate any help. http://www.opengl.org/discussion_boards/ubb/smile.gif http://www.opengl.org/discussion_boards/ubb/smile.gif http://www.opengl.org/discussion_boards/ubb/smile.gif

[This message has been edited by yoale (edited 05-05-2003).]

I have a light vector that is from a light source to a vertex that has been tranformed to eye space. Now, if I multiply this vector by the inverse modelview matrix, I get the vector in object space right?

Now here's what I'm thinking...The inverse of a matrix that has only been rigidly transformed (ie no scales or skews), is just the transpose of itself (I read it in a math book at least http://www.opengl.org/discussion_boards/ubb/smile.gif.) Now, is it the same if the matrix has been translated? Or does the translation somehow throw off the inverse calcs? http://www.opengl.org/discussion_boards/ubb/confused.gif

The thing is, I have a bump-mapping algorithm that works well if a light position and three vertices are passed in. The trouble comes when I try to bump map only knowing a vertex, its normal, and a light position. I'd love to use the alg I already have (which requires three vertices), but my boss wants the alg to work if only one vertex can be known at any given time http://www.opengl.org/discussion_boards/ubb/mad.gif http://www.opengl.org/discussion_boards/ubb/mad.gif. I'd appreciate any help. http://www.opengl.org/discussion_boards/ubb/smile.gif http://www.opengl.org/discussion_boards/ubb/smile.gif http://www.opengl.org/discussion_boards/ubb/smile.gif

[This message has been edited by yoale (edited 05-05-2003).]