point to uvw?



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 17/06/2005 at 11:10, xxxxxxxx wrote:

    That doesn´t matter to me. I expect the user to have a mesh with clean UV data (and my experience tells me that this is most of the time the case if we exclude beginners).

    One has to choose whether it´s worth exchanging performance with correctness and completeness (or vice-versa). And in my case speed is the only issue I am concerned about, so complex calculations are inacceptable to me.

    Anyway, for my task it wouldn´t even matter if all points have the same uv coordinate. The user has to take care of it when he wants to use UV data. (which should usually of course be handled by the plugin)



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 17/06/2005 at 12:25, xxxxxxxx wrote:

    But how much distortion (including the simple flip, mirror, skew, rotation) will you be able to tolerate? Every human mesh that I've dealt with had extremely high polygon distortion. This is why it's nonlinear. Calculus is necessary to do the interpolation under these circumstances.

    I'm doing a search of ACM and have asked in a related forum, but have yet to pinpoint the actual math/algorithm involved. This is more mathematical than graphics based - most of the references go directly to mapping the texel to screen space.



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 17/06/2005 at 12:49, xxxxxxxx wrote:

    Just calculate the coordinates yourself, there are a number of ways. If its a tri, then its simply the bary coords, if its a quad then a simple one is to split the quad into two tris and use the one the point is in with the barys again. You can get better ones that give a better interpolation over the quad, is volumedata available to you? if so look at the GetRS function and it'll do it all for you.



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 17/06/2005 at 23:42, xxxxxxxx wrote:

    Hi,

    thanks, but where do I get the bary coords from? I am in a generator so VolumeData I cannot use (I would have used GetRS or GetWeights then).

    Thank you!



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 18/06/2005 at 00:06, xxxxxxxx wrote:

    Well, here's the response that I received. If more information is needed, at least a search of 'barycentric' and 'bilinear' may provide more information.

    _I have a solution for triangles, that may be enough for you. The true answer for n-sided polygons depends on the method your renderer is using to interpolate the UV coordinates. For triangles, barycentric is the most common, and for quadrangles, bilinear is common.

    Anyhow, here's what I did when I needed to do this for triangles. I'd either assume that P is in the plane defined by the triangle, or project it to that plane. Then I'd have the vertices of the triangle ABC, with P in the triangle. I'd compute the area of the 3 triangles ABP BCP and CAP. Then the barycentric coordinates of the points A B and C are the areas of the opposite triangles, divided by the sum of the areas. In other words, bary(A) = Area(BCP)/(SumOfAreas). Then use barycentric interpolation of the UVs to find the correct interpolated UV coordinate of P._

    And I agree with David that if you want to use a simple triangular method, best to subdivide n-gons into triangles (very easy) and go from there with Barycentric interpolation.



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 18/06/2005 at 00:20, xxxxxxxx wrote:

    thanks, I wanted to go with Barys from the beginning but someone said it wasn´t enough ;)
    Thanks for the info about the bary calculations though!



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 18/06/2005 at 01:08, xxxxxxxx wrote:

    Not that it's not enough, but that it's a limited solution (only triangles). ;P

    Note that you still need interpolation after the simple barycentric coordinate determination. Oh, the joys of nonlinear interpolation... :)



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 18/06/2005 at 01:14, xxxxxxxx wrote:

    yep, thanks. I first have to get the area calculation. I have an old formula for this I remember, let´s see if it works. :)



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 18/06/2005 at 04:52, xxxxxxxx wrote:

    There are faster ways to calc the barys than the areas, just do a google for them and you'll find lots of info :) flipcode is generally a good source.
    As for n-gons (I noticed them mentioned), you never really need to worry about them since they will always have quads/tris, its rare (only modeling generally) where you need to consider n-gons in CINEMA. UVs are done on the polygon mesh, not the n-gons.
    If you do go with the barys then since you can use them to find if a point is in a tri just calc for one tri, if its in range you have it, if not do the other. Its pretty simple and fast.



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 18/06/2005 at 08:39, xxxxxxxx wrote:

    Thanks Dave, I have a look. :)


Log in to reply