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 ?
I'm doing a raytracer in C and I need to apply some textures on 3D objects. I saw the noise functions created by Ken Perlin, http://mrl.nyu.edu/~.../doc/oscar.html and i think I could use the noise3() function to apply texture on my 3D objets. I tried to use this functions in my program, but it didn't work. I'm wondering how to use this noise3() function and the return value to get a good texture. Thanks guys for helping me