Пример #1
0
Range3f RayTesselatedSpherePrimitive::ComputeBoundingBox(const Intervalf& time, int approximationSamples) {
    Vec3f p;
    float r;
    Matrix4d m;
    Matrix4d mi;
    _ResolveSphereAttrib(p,r,m,mi);
    return m.TransformBBox(ElementOperations::SphereBoundingBox(p,r));
}
Пример #2
0
float RayTesselatedSpherePrimitive::ComputeAverageArea(const Intervalf& time, int approximationSamples) {
    Vec3f p;
    float r;
    Matrix4d m;
    Matrix4d mi;
    _ResolveSphereAttrib(p,r,m,mi);
    float area = ElementOperations::SphereArea(r);
    Range3f bbox(-area/2,area/2);
    return m.TransformBBox(bbox).GetSize().GetLength();
}