c# - Mapping UV to a bulged triangle strip -


i don't know if "bulged" correct term it's can think of right now. i'm trying map 1-pixel wide (though technically every texture have problem) image along triangle strip simulate laser. when it's uniform , square, how looks:

enter image description here

and wireframe of that:

enter image description here

but problem arises when slide points inwards. uv wrong, since tries map if triangle horizontal.

enter image description here

and wireframe of that:

enter image description here

right can't think of term search work out how i'd map it. want map stripe shrinks along strip itself, not frontal mapping. tips? i'm sure it's easy i'm not able think of right now.

you want perspective correct texture mapping. see affine transformation, doesn't take depth account.

this link explains problem , suggests how solve it:

http://www.reedbeta.com/blog/2012/05/26/quadrilateral-interpolation-part-1/

i did myself recall pass 3rd attribute in addition uv coordinates have homogeneous texture vector passed vertex shader fragment shader. in fragment shader divide uv 3rd argument , use sample texture.

sadly don't have code in front of me best do. page linked should lead solution.


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -

php - Accessing static methods using newly created $obj or using class Name -