|
Post by mariog on Oct 10, 2019 21:29:20 GMT
Hi,
I think I found another bug, this time with the ring pattern -when I run the test case it passes but upon attempting to render the pattern the method always returns the colour white resulting in a white rendered sphere. As far as I have been able to determine the pattern function will always return white because the values of point.x and point.z are *between* -1 and 1, not inclusive. Here is the Java method I am using to return the colour for a point:
public Colour patternAt(Tuple point) { double squareSum = point.x*point.x + point.z * point.z; if( Math.floor(Math.sqrt(squareSum)) % 2 == 0) { return a; // white colour } else { return b; // black colour } }
|
|
|
Post by Jamis on Oct 14, 2019 17:37:51 GMT
Hey mariog, the issue might be due to the size of your sphere, relative to the texture. Because we're expecting the texture to have a radius of 2 (that's what the modulus is doing), the first half of the ring (the white color) will have a radius of 1, which is exactly the radius of your sphere. If you aren't scaling the ring texture down by at least a factor of 2, you won't see anything on a sphere. Try it on a plane, instead, and see what it gives you. - Jamis
|
|