objects
Class Quadric

java.lang.Object
  extended by objects.Object
      extended by objects.Quadric
All Implemented Interfaces:
IObject
Direct Known Subclasses:
Ellipsoid, UnitCone, UnitSphere, UnitTube

public class Quadric
extends Object


Field Summary
 
Fields inherited from class objects.Object
trans
 
Constructor Summary
Quadric(double a, double b, double c, double d, double e, double f, double g, double h, double j, double k)
          constructor (a*x^2+b*y^2+c*z^2+2*d*x*y+2*e*x*z+2*f*y*z+2*g*x+2*h*y+2*j*z+k<=0)
 
Method Summary
 IntersectionInfo calcIntersection(Ray ray)
          calculates the intersection with an ray
 void calculateTextureCoordinates(IntersectionInfo ri)
          calculates the coordinates at ri.nextPosition
 IObject getCopy()
           
 boolean isInside(Point3D p)
           
 Vector3D normal(Point3D p)
          calculate normal via gradient
 double q(Point3D p)
          calculate the value of the quadric at point p
 void transform(TransformationMatrix4x4 m)
          transforms the object with the matrix m
 
Methods inherited from class objects.Object
assignMap, assignMaterial, getArea, getMap, getMaterial, getTransformationMatrix, move, rotate, rotateAroundX, rotateAroundY, rotateAroundZ, scale, scale, setTransformationMatrix, UniformRandomPoint
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Quadric

public Quadric(double a,
               double b,
               double c,
               double d,
               double e,
               double f,
               double g,
               double h,
               double j,
               double k)
constructor (a*x^2+b*y^2+c*z^2+2*d*x*y+2*e*x*z+2*f*y*z+2*g*x+2*h*y+2*j*z+k<=0)

Parameters:
a - a*x^2
b - b*y^2
c - c*z^2
d - 2*d*x*y
e - 2*e*x*z
f - 2*f*y*z
g - 2*g*x
h - 2*h*y
j - 2*j*z
k -
Method Detail

q

public double q(Point3D p)
Description copied from interface: IObject
calculate the value of the quadric at point p

Parameters:
p - point
Returns:
the value at point p, q(p)<=0 -> inside

isInside

public boolean isInside(Point3D p)
Returns:
is the point inside the object

normal

public Vector3D normal(Point3D p)
Description copied from interface: IObject
calculate normal via gradient

Parameters:
p - the point
Returns:
normal at p

calcIntersection

public IntersectionInfo calcIntersection(Ray ray)
Description copied from interface: IObject
calculates the intersection with an ray

Returns:
the intersection info

transform

public void transform(TransformationMatrix4x4 m)
Description copied from interface: IObject
transforms the object with the matrix m

Parameters:
m - the transformation matrix

calculateTextureCoordinates

public void calculateTextureCoordinates(IntersectionInfo ri)
Description copied from interface: IObject
calculates the coordinates at ri.nextPosition

Parameters:
ri - intersection information

getCopy

public IObject getCopy()
Returns:
the area of the object