示例#1
0
 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));
   
 }
示例#2
0
文件: Sphere.cpp 项目: serioja90/Mojo
Sphere::Sphere(){
	this->empty = false;
	this->origin = Point(0.0f,0.0f,0.0f);
	this->radius = 0.5f;
	this->detalization = 25;
	this->setQuadricAttributes(Quadric());
}
示例#3
0
文件: Sphere.cpp 项目: serioja90/Mojo
Sphere::Sphere(Point origin, GLfloat radius, GLint detalization){
	this->empty = false;
	this->origin = origin;
	this->radius = radius;
	this->detalization = detalization;
	this->setQuadricAttributes(Quadric());
}
示例#4
0
 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));
   
 }
示例#5
0
 Quadric transformBy(const MutableMatrix44D& M) const {
   MutableMatrix44D I = M.inversed();
   MutableMatrix44D T = I.transposed();
   return Quadric(T.multiply(Q).multiply(I));
 }