Jump to content

  • Log In with Google      Sign In   
  • Create Account

We need your feedback on a survey! Each completed response supports our community and gives you a chance to win a $25 Amazon gift card!


Perpendicular vectors on mesh starting from screen space


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 cifa   Members   -  Reputation: 226

Like
0Likes
Like

Posted 12 August 2014 - 02:08 PM

Hi there,

 

I was wondering if it is possible somehow to find two orthogonal vectors on a mesh, but starting from screen space. 

I know that I can bring two points (e.g. currPixel and currPixel + (1,0)) to object space if I have also depth info. In such way I can find a vector that is on the mesh in object space.

Now we all know that in 3D there are an infinite number of perpendicular vectors to another one so if I just take one of them I have no guarantee it would be on the surface of the mesh. Taking perpendicular vectors in screenspace is of no help as they may well map to non-orthogonal vector in object space.

 

Is it possible, starting from the data I have (persp. matrix, viewMatrix, modelMatrix, depth info and screenspace info), to obtain the said vector or is it an impossible task? 

 

Thank you!


Edited by cifa, 12 August 2014 - 02:08 PM.


Sponsor:

#2 Álvaro   Crossbones+   -  Reputation: 13937

Like
1Likes
Like

Posted 12 August 2014 - 07:02 PM

From currPixel and currPixel + (0,1) you can compute another vector that is approximately tangent to the mesh. Now use the Gram-Schmidt procedure to make the two vectors perpendicular, while still spanning the same plane. That should do.

#3 cifa   Members   -  Reputation: 226

Like
0Likes
Like

Posted 13 August 2014 - 02:20 AM

From currPixel and currPixel + (0,1) you can compute another vector that is approximately tangent to the mesh. Now use the Gram-Schmidt procedure to make the two vectors perpendicular, while still spanning the same plane. That should do.

Thank you very much! I don't know why I didn't thought of Gram-Schmidt. 






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS