static Quadric fromPlane(double a, double b, double c, double d) { return Quadric(MutableMatrix44D(0, 0, 0, a/2, 0, 0, 0, b/2, 0, 0, 0, c/2, a/2, b/2, c/2, d)); }
Sphere::Sphere(){ this->empty = false; this->origin = Point(0.0f,0.0f,0.0f); this->radius = 0.5f; this->detalization = 25; this->setQuadricAttributes(Quadric()); }
Sphere::Sphere(Point origin, GLfloat radius, GLint detalization){ this->empty = false; this->origin = origin; this->radius = radius; this->detalization = detalization; this->setQuadricAttributes(Quadric()); }
static Quadric fromEllipsoid(const Ellipsoid* ellipsoid) { // assuming ellipsoid is centered on origin const Vector3D R = ellipsoid->getOneOverRadiiSquared(); return Quadric(MutableMatrix44D(R._x, 0, 0, 0, 0, R._y, 0, 0, 0, 0, R._z, 0, 0, 0, 0, -1)); }
Quadric transformBy(const MutableMatrix44D& M) const { MutableMatrix44D I = M.inversed(); MutableMatrix44D T = I.transposed(); return Quadric(T.multiply(Q).multiply(I)); }