Ray-Sphere Intersection (Hit)
const ray = new Ray(
new Point3D(0, 0, 5),
new Vector3D(0, 0, -1)
);
const sphere = new Sphere(
new Point3D(0, 0, 0),
1.0
);
new Point3D(0, 0, 5),
new Vector3D(0, 0, -1)
);
const sphere = new Sphere(
new Point3D(0, 0, 0),
1.0
);
Ray-Sphere Intersection (Miss)
const ray = new Ray(
new Point3D(0, 5, 5),
new Vector3D(0, 0, -1)
);
const sphere = new Sphere(
new Point3D(0, 0, 0),
1.0
);
new Point3D(0, 5, 5),
new Vector3D(0, 0, -1)
);
const sphere = new Sphere(
new Point3D(0, 0, 0),
1.0
);
Ray-Plane Intersection (Hit)
const ray = new Ray(
new Point3D(0, 5, 0),
new Vector3D(0, -1, 0)
);
const plane = Plane.fromPointNormal(
new Point3D(0, 0, 0),
new Vector3D(0, 1, 0)
);
new Point3D(0, 5, 0),
new Vector3D(0, -1, 0)
);
const plane = Plane.fromPointNormal(
new Point3D(0, 0, 0),
new Vector3D(0, 1, 0)
);
Ray-Plane Intersection (Miss)
const ray = new Ray(
new Point3D(0, 0, 0),
new Vector3D(1, 0, 0)
);
const plane = Plane.fromPointNormal(
new Point3D(0, 0, 0),
new Vector3D(0, 1, 0)
);
new Point3D(0, 0, 0),
new Vector3D(1, 0, 0)
);
const plane = Plane.fromPointNormal(
new Point3D(0, 0, 0),
new Vector3D(0, 1, 0)
);
Ray-Triangle Intersection (Hit)
const ray = new Ray(
new Point3D(1, 1, 5),
new Vector3D(0, 0, -1)
);
const triangle = new Triangle(
new Point3D(0, 0, 0),
new Point3D(3, 0, 0),
new Point3D(0, 3, 0)
);
new Point3D(1, 1, 5),
new Vector3D(0, 0, -1)
);
const triangle = new Triangle(
new Point3D(0, 0, 0),
new Point3D(3, 0, 0),
new Point3D(0, 3, 0)
);
Ray-Triangle Intersection (Miss)
const ray = new Ray(
new Point3D(5, 5, 5),
new Vector3D(0, 0, -1)
);
const triangle = new Triangle(
new Point3D(0, 0, 0),
new Point3D(3, 0, 0),
new Point3D(0, 3, 0)
);
new Point3D(5, 5, 5),
new Vector3D(0, 0, -1)
);
const triangle = new Triangle(
new Point3D(0, 0, 0),
new Point3D(3, 0, 0),
new Point3D(0, 3, 0)
);