Original Post
Hi guys !
I'm doing a raytracer in C. I have to apply textures on a sphere. I have the coordinates x, y,z where my ray hits the sphere, the radius of the sphere and a function that returns the color of the pixel of the texture for a given x and y.
Do you have a formula to get the x,y of the texture from the x,y,z of the sphere and the radius r ?
Ty !
I'm doing a raytracer in C. I have to apply textures on a sphere. I have the coordinates x, y,z where my ray hits the sphere, the radius of the sphere and a function that returns the color of the pixel of the texture for a given x and y.
Do you have a formula to get the x,y of the texture from the x,y,z of the sphere and the radius r ?
Ty !