PDA

View Full Version : Scaling a vertex



MatthewL
09-03-2004, 11:58 PM
Hi! :)

I'm trying to do planar and cubic texture mapping, and to do that I have to scale each vertex from a mesh so it is in 0-1 range to use as texture coordinates.

Does someone know how to do this? :confused:
I tried normalising each vertex but that has distorted results (because normalising results in a -1 to 1 range, not 0 to 1)

Thanks y'all! :p

AdrianD
09-04-2004, 06:49 AM
vertex_range_0_1 = (vertex-meshmin)/(meshmax-meshmin)

MatthewL
09-04-2004, 11:01 PM
Why! That should do the trick ;)

Thank you very much :p