Glavin001 / Raytracer

Raytracer for CSCI 4471 Computer Graphics class project
http://glavin001.github.io/Raytracer
8 stars 2 forks source link

Adaptive bounding boxes or bounding spheres #50

Open Glavin001 opened 9 years ago

Glavin001 commented 9 years ago

Object3D

class Object3D
    virtual bool hit()
    virtual box bounding-box()

Bounding box for Sphere

box sphere::bounding-box ()
    vector3f min = center - vec3(radius, radius, radius);
    vector3f max = center + vec3(radius, radius, radius);
    return box(min, max);

Bounding box for Triangle