Lines Matching refs:Ray
1 // The ray tracer code in this file is written by Adam Burmister. It
9 // JavaScript framework which is used by the ray tracer.
12 // the scene was ray traced correctly.
48 // The rest of this file is the actual ray tracer written by Adam
54 // flog/ray.js
281 Flog.RayTracer.Ray = Class.create();
283 Flog.RayTracer.Ray.prototype = {
292 return 'Ray [' + this.position + ',' + this.direction + ']';
452 intersect: function(ray){
456 var dst = Flog.RayTracer.Vector.prototype.subtract(ray.position, this.position);
458 var B = dst.dot(ray.direction);
466 ray.position,
468 ray.direction,
504 intersect: function(ray){
507 var Vd = this.position.dot(ray.direction);
510 var t = -(this.position.dot(ray.position) + this.d) / Vd;
516 ray.position,
518 ray.direction,
600 var ray = new Flog.RayTracer.Ray(pos, dir.normalize());
602 return ray;
606 return 'Ray []';
685 var ray = scene.camera.getRay(xp, yp);
687 var color = this.getPixelColor(ray, scene);
697 getPixelColor: function(ray, scene){
698 var info = this.testIntersection(ray, scene, null);
700 var color = this.rayTrace(info, ray, scene, 0);
706 testIntersection: function(ray, scene, exclude){
715 var info = shape.intersect(ray);
732 return new Flog.RayTracer.Ray(P, R1);
735 rayTrace: function(info, ray, scene, depth){
769 // calculate reflection ray
772 var reflectionRay = this.getReflectionRay(info.position, info.normal, ray.direction);
797 var shadowRay = new Flog.RayTracer.Ray(info.position, v);