net.sf.j3d.threeD.raytracer.primitives
Class Cylinder

java.lang.Object
  extended by net.sf.j3d.threeD.raytracer.engine.AbstractSurface
      extended by net.sf.j3d.threeD.raytracer.primitives.Cylinder
All Implemented Interfaces:
Surface

public class Cylinder
extends AbstractSurface

A Cylinder object represents a cylinder in 3d space.


Constructor Summary
Cylinder()
          Constructs a Cylinder object that represents a cylinder with a base radius of 1.0, with base at the origin, that is black.
Cylinder(Vector location, double radius)
          Constructs a Cylinder object that represents a cylinder with the specified base radius, and the specified location, that is black.
Cylinder(Vector location, double radius, RGB color)
          Constructs a Cylinder object that represents a cylinder with the specified base radius, location, and color.
 
Method Summary
 Vector getNormalAt(Vector point)
          Returns a Vector object that represents the vector normal to the 3d surface at the point represented by the specified Vector object.
 boolean intersect(Ray ray)
          Returns true if the ray intersects the 3d surface in real space.
 Intersection intersectAt(Ray ray)
          Returns an Intersection object representing the points along the ray represented by the specified Ray object that intersection between the ray and the cylinder represented by this Cylinder object occurs.
 
Methods inherited from class net.sf.j3d.threeD.raytracer.engine.AbstractSurface
addShader, addTexture, addTransform, calculateTransform, getColor, getColorAt, getColorAt, getIndexOfRefraction, getIndexOfRefraction, getLocation, getParent, getReflectedPercentage, getReflectedPercentage, getRefractedPercentage, getRefractedPercentage, getRotationCoefficients, getScaleCoefficients, getShadeBack, getShadeFront, getShaderSet, getSize, getTexture, getTextures, getTextureSet, getTransform, getTransform, getTransforms, removeTexture, removeTransform, setColor, setIndexOfRefraction, setLocation, setParent, setReflectedPercentage, setRefractedPercentage, setRotationCoefficients, setScaleCoefficients, setShadeBack, setShadeFront, setShaders, setShaders, setSize, setTexture, setTextures, setTransform, setTransforms, shade, triangulate
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Cylinder

public Cylinder()
Constructs a Cylinder object that represents a cylinder with a base radius of 1.0, with base at the origin, that is black.


Cylinder

public Cylinder(Vector location,
                double radius)
Constructs a Cylinder object that represents a cylinder with the specified base radius, and the specified location, that is black.


Cylinder

public Cylinder(Vector location,
                double radius,
                RGB color)
Constructs a Cylinder object that represents a cylinder with the specified base radius, location, and color.

Method Detail

getNormalAt

public Vector getNormalAt(Vector point)
Description copied from interface: Surface
Returns a Vector object that represents the vector normal to the 3d surface at the point represented by the specified Vector object.

Returns:
A Vector object that represents the vector normal to this cylinder at the point represented by the specified Vector object.

intersect

public boolean intersect(Ray ray)
Description copied from interface: Surface
Returns true if the ray intersects the 3d surface in real space.

Returns:
True if the ray represented by the specified Ray object intersects the cylinder represented by this Cylinder object.

intersectAt

public Intersection intersectAt(Ray ray)
Returns an Intersection object representing the points along the ray represented by the specified Ray object that intersection between the ray and the cylinder represented by this Cylinder object occurs.