Class PunchedSphere
java.lang.Object
org.autochthonous.graphics.rt.Renderable
org.autochthonous.graphics.rt.Bounded
PunchedSphere
- All Implemented Interfaces:
- java.lang.Cloneable, ColorCalculator, NormalCalculator, Partitionable, Traceable
- public class PunchedSphere
- extends Bounded
- implements NormalCalculator
a sphere with holes in it around the axis... Essentially xHole gives the
radius of a cylinder around the xAxis which is removed from the surface,
yHole give the radius of a cylinder around the yAxis, etc...
Note: the holes are punched in the spheres cannonical coordinate system.
Sample RML:
<PunchedSphere radius="1.0" center="0, 0, 0" xHole="0.2" yHole="0.2" zHole="0.2"/>
Document Type Definition:
<!ENTITY %Color3f "CDATA">
<!ENTITY %Float "CDATA">
<!ENTITY %Point3f "CDATA">
<!ELEMENT PunchedSphere EMPTY>
<!ATTLIST PunchedSphere
color %Color3f; "1, 1, 1"
radius %Float; "1"
center %Point3f; "0, 0, 0"
xHole %Float; "0"
yHole %Float; "0"
zHole %Float; "0">
Fields inherited from class org.autochthonous.graphics.rt.Bounded |
bBox |
Methods inherited from class org.autochthonous.graphics.rt.Renderable |
clone, createObjectSpaceRay, getColor, getColor, getShader, hasShader, isSelfShadowing, processObject, readObject, setColor, setColor, setSelfShadowing, setShader, toObjectSpace, toObjectSpace, transformNormal |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.autochthonous.graphics.rt.Traceable |
clone |
PunchedSphere
public PunchedSphere(Point3d c,
double r,
double xHole,
double yHole,
double zHole)
getInstance
public static PunchedSphere getInstance(RMLReader in)
throws java.io.IOException
- Throws:
java.io.IOException
processParameters
protected void processParameters(ParametersMap params)
- Overrides:
processParameters
in class Renderable
isIntersected
public boolean isIntersected(Ray r)
- Specified by:
isIntersected
in interface Traceable
- Specified by:
isIntersected
in class Bounded
isShadowing
public boolean isShadowing(Ray r)
- Specified by:
isShadowing
in interface Traceable
- Specified by:
isShadowing
in class Bounded
intersections
public HitList intersections(Ray r)
- this one can't be used in CSG (an exercise for the reader!)
- Specified by:
intersections
in interface Traceable
getN
public void getN(Hit hit,
Vector3f n)
- Description copied from interface:
NormalCalculator
- set the normal for this hit point (object space) in hd
the value is returned in n
- Specified by:
getN
in interface NormalCalculator