|
Rings Version 0.3 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectthreeD.raytracer.engine.RayTracingEngine
The RayTracingEngine class provides static methods for rendering scenes.
| Field Summary | |
static boolean |
castShadows
Controls wether or not shadow casting will be done during rendering. |
static double |
e
A very small value (0.00000001) that is used in '>=' and '<=' operations to account for computational errors. |
| Constructor Summary | |
RayTracingEngine()
|
|
| Method Summary | |
static RGB |
ambientLightingCalculation(Vector point,
Vector rayDirection,
Surface surface,
Surface[] otherSurfaces,
AmbientLight light)
Performs the lighting calculations for the specified surface at the specified point of interesection on that surface using the lighting data from the specified AmbientLight object and returns an RGB object that represents the color of the point. |
static Intersection |
closestIntersection(Ray ray,
Surface[] surfaces)
Returns an Intersection object that represents the closest intersection (>= RayTracingEngine.e) between a surface in the specified array of Surface objects and the ray represented by the specified Ray object. |
static double |
closestIntersectionAt(Intersection intersect)
Returns the value (>= RayTracingEngine.e) of the closest intersection point of the specified Intersection object If there are no positive intersections, -1.0 is returned. |
static RGB |
directionalAmbientLightingCalculation(Vector point,
Vector rayDirection,
Surface surface,
Surface[] otherSurfaces,
DirectionalAmbientLight light,
Light[] otherLights)
Performs the lighting calculations for the specified surface at the specified point of interesection on that surface using the lighting data from the specified DirectionalAmbientLight object and returns an RGB object that represents the color of the point. |
static RGB |
lightingCalculation(Ray ray,
Surface[] surfaces,
Light[] lights)
Performs intersection and lighting calculations for the specified Ray, Surfaces, and Lights. |
static RGB |
lightingCalculation(Vector point,
Vector rayDirection,
Surface surface,
Surface[] otherSurfaces,
Light[] lights)
Performs the lighting calculations for the specified surface at the specified point of intersection on that surface using the lighting data from the specified Light objects and returns an RGB object that represents the color of the point. |
static RGB |
lightingCalculation(Vector point,
Vector rayDirection,
Surface surface,
Surface[] otherSurfaces,
Light light,
Light[] otherLights)
Performs the lighting calculations for the specified surface at the specified point of interesection on that surface using the lighting data from the specified Light object and returns an RGB object that represents the color of the point. |
static RGB |
pointLightingCalculation(Vector point,
Vector rayDirection,
Surface surface,
Surface[] otherSurfaces,
PointLight light,
Light[] otherLights)
Performs the lighting calculations for the specified surface at the specified point of interesection on that surface using the lighting data from the specified PointLight object and returns an RGB object that represents the color of the point. |
static Vector |
reflect(Vector vector,
Vector normal)
Reflects the specified Vector object across the normal vector represented by the second specified Vector object and returns the result. |
static Vector |
refract(Vector vector,
Vector normal,
double ni,
double nr)
Refracts the specified Vector object based on the specified normal vector and 2 specified indices of refraction. |
static RGB[][] |
render(Scene scene,
int x,
int y,
int dx,
int dy,
int width,
int height,
int ssWidth,
int ssHeight,
ProgressMonitor monitor)
|
static RGB[][] |
render(Scene scene,
int width,
int height,
int ssWidth,
int ssHeight,
ProgressMonitor monitor)
Computes all intersection and lighting calculations required to produce an image of the specified width and height that is a rendering of the specified Scene object and returns the image as an array of RGB objects. |
static RGB[][] |
render(Scene scene,
RenderParameters p,
ProgressMonitor monitor)
Renders the specified scene. |
static RGB[][] |
render(Surface[] surfaces,
Camera camera,
Light[] lights,
int x,
int y,
int dx,
int dy,
int width,
int height,
int ssWidth,
int ssHeight,
ProgressMonitor monitor)
Computes all intersection and lighting calculations required to produce an image of the specified width and height that is a rendering of the specified set of Surface objects using the data from the specified Camera and Light object. |
static Light[] |
separateLights(int index,
Light[] allLights)
Removes the Light object at the specified index from the specified Light object array and returns the new array. |
static Surface[] |
separateSurfaces(int index,
Surface[] allSurfaces)
Removes the Surface object at the specified index from the specified Surface object array and returns the new array. |
static Surface[] |
separateSurfaces(Surface surface,
Surface[] allSurfaces)
Removes the specified Surface object from the specified Surface object array and returns the new array. |
static boolean |
shadowCalculation(Vector point,
Surface[] surfaces,
Light light)
Performs the shadow calculations for the specified surfaces at the specified point using the data from the specified Light object. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static boolean castShadows
public static final double e
| Constructor Detail |
public RayTracingEngine()
| Method Detail |
public static RGB[][] render(Scene scene,
int width,
int height,
int ssWidth,
int ssHeight,
ProgressMonitor monitor)
public static RGB[][] render(Scene scene,
int x,
int y,
int dx,
int dy,
int width,
int height,
int ssWidth,
int ssHeight,
ProgressMonitor monitor)
public static RGB[][] render(Scene scene,
RenderParameters p,
ProgressMonitor monitor)
scene - Scene object to render.p - RenderParamters object to use.monitor - ProgressMonitor to use.
public static RGB[][] render(Surface[] surfaces,
Camera camera,
Light[] lights,
int x,
int y,
int dx,
int dy,
int width,
int height,
int ssWidth,
int ssHeight,
ProgressMonitor monitor)
surfaces - Surface objects in scene.camera - Camera object for scene.lights - Light objects in scene.x - X coordinate of upper left corner of image.y - Y coordinate of upper left corner of image.dx - Width of image.dy - Height of image.width - Width of total image.height - Height of total image.ssWidth - Supersample width.ssHeight - Supersample height.monitor - ProgressMonitor instance to use.
public static RGB lightingCalculation(Ray ray,
Surface[] surfaces,
Light[] lights)
public static RGB lightingCalculation(Vector point,
Vector rayDirection,
Surface surface,
Surface[] otherSurfaces,
Light[] lights)
public static RGB lightingCalculation(Vector point,
Vector rayDirection,
Surface surface,
Surface[] otherSurfaces,
Light light,
Light[] otherLights)
public static RGB ambientLightingCalculation(Vector point,
Vector rayDirection,
Surface surface,
Surface[] otherSurfaces,
AmbientLight light)
public static RGB directionalAmbientLightingCalculation(Vector point,
Vector rayDirection,
Surface surface,
Surface[] otherSurfaces,
DirectionalAmbientLight light,
Light[] otherLights)
public static RGB pointLightingCalculation(Vector point,
Vector rayDirection,
Surface surface,
Surface[] otherSurfaces,
PointLight light,
Light[] otherLights)
public static boolean shadowCalculation(Vector point,
Surface[] surfaces,
Light light)
public static Vector reflect(Vector vector,
Vector normal)
public static Vector refract(Vector vector,
Vector normal,
double ni,
double nr)
vector - A Vector object representing a unit vector in the direction of the incident ray
normal A Vector object respresenting a unit vector that is normal to the surface refracting the ray
ni A double value representing the index of refraction of the incident medium
nr A double value representing the index of refraction of the refracting medium
public static Intersection closestIntersection(Ray ray,
Surface[] surfaces)
public static double closestIntersectionAt(Intersection intersect)
public static Light[] separateLights(int index,
Light[] allLights)
public static Surface[] separateSurfaces(int index,
Surface[] allSurfaces)
public static Surface[] separateSurfaces(Surface surface,
Surface[] allSurfaces)
|
Rings Version 0.3 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||