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
275 Flog.RayTracer.Ray = Class.create();
277 Flog.RayTracer.Ray.prototype = {
286 return 'Ray [' + this.position + ',' + this.direction + ']';
421 intersect: function(ray){
425 var dst = Flog.RayTracer.Vector.prototype.subtract(ray.position, this.position);
427 var B = dst.dot(ray.direction);
435 ray.position,
437 ray.direction,
473 intersect: function(ray){
476 var Vd = this.position.dot(ray.direction);
479 var t = -(this.position.dot(ray.position) + this.d) / Vd;
485 ray.position,
487 ray.direction,
569 var ray = new Flog.RayTracer.Ray(pos, dir.normalize());
571 return ray;
575 return 'Ray []';
654 var ray = scene.camera.getRay(xp, yp);
656 var color = this.getPixelColor(ray, scene);
666 getPixelColor: function(ray, scene){
667 var info = this.testIntersection(ray, scene, null);
669 var color = this.rayTrace(info, ray, scene, 0);
675 testIntersection: function(ray, scene, exclude){
684 var info = shape.intersect(ray);
701 return new Flog.RayTracer.Ray(P, R1);
704 rayTrace: function(info, ray, scene, depth){
738 // calculate reflection ray
741 var reflectionRay = this.getReflectionRay(info.position, info.normal, ray.direction);
766 var shadowRay = new Flog.RayTracer.Ray(info.position, v);