0
$\begingroup$

I have a ray tracer that I wrote myself.

I am not sure that the scene is being drawn correctly, to be more precise, are my reflections on the floor and on the sphere correct?

My scene:

s = Scene(
        [
            Light(
                type_=LightType.ambient, 
                intensity=vec3(0.2, 0.2, 0.2)
            ),
            Light(
                type_=LightType.directional,
                intensity=vec3(0.5, 0.5, 0.5), 
                direction=vec3(0, -2, -1)
            ),
        ],
        [
            Triangle(vec3(-1, -1, 2), vec3(1, -1, 2), vec3(-1, -1, 5), color=vec3(255, 255, 255), specular=500, reflective=0.5),
            Triangle(vec3(1, -1, 2), vec3(1, -1, 5), vec3(-1, -1, 5), color=vec3(255, 255, 255), specular=500, reflective=0.5),
            Triangle(vec3(-1, 1, 5), vec3(-1, -1, 5), vec3(1, -1, 5), color=vec3(0, 255, 255), specular=500, reflective=0),
            Triangle(vec3(-1, 1, 5), vec3(1, -1, 5), vec3(1, 1, 5), color=vec3(0, 255, 255), specular=500, reflective=0),
            
            Sphere(
                color=u8vec3(200, 200, 200), 
                radius=0.5, 
                center=vec3(0, 0, 4),
                specular=-1,
                reflective = 0.8
            )
        ]
)

Result:

enter image description here

If you need any additional information I can provide it to you

And yes, sorry in advance, I'm a beginner)

$\endgroup$

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.