How do I find the parametric UV and du and dv of a primitive on a sphere ? Assuming that is all the information you have on the sphere. I want to find the partial derivatives for a primitive if I the only value I supply is either X,Y,Z ?

  • \$\begingroup\$ There are many different parametrizations of a sphere that we might use in a game. How is your sphere unwrapped? Or, to attack this from another direction, what are you using this for? The more context you give us, the better we can focus on answers that work well for that context. \$\endgroup\$
    – DMGregory
    Jun 9 '20 at 9:31
  • \$\begingroup\$ The sphere is not unwrapped, if that information helps ? I just want to return a value of the derivative of either the X,Y,Z for the parametric UV. Where I'm stuck is if the function asks for a primitive how do find the UV and du / dv of that primitive ? \$\endgroup\$
    – user135470
    Jun 9 '20 at 13:26
  • \$\begingroup\$ A uv coordinate requires an unwrapping. That's what a uv coordinate is - a point on the "skin" of the surface after it's been peeled open and squished flat into the plane. This unwrapping can be defined in math functions rather than in vertex texture coordinates, but we still need a definition somewhere. To give you a parametric uv and its derivatives, we need to know what unwrapping / what parametrization of the sphere you're using. \$\endgroup\$
    – DMGregory
    Jun 9 '20 at 13:38
  • \$\begingroup\$ To get the derivative, there must be UV's. I was thinking otherwise that you could get the derivative with just parametric uvs. Once there is a uv coordinate I only need to give it a point in uv space ? \$\endgroup\$
    – user135470
    Jun 10 '20 at 1:33
  • \$\begingroup\$ Let me put it to you this way: how would you define "parametric UVs" in this case? Do you have a specific parametric equation in mind? \$\endgroup\$
    – DMGregory
    Jun 10 '20 at 1:36

Browse other questions tagged or ask your own question.