Class PathTracer
java.lang.Object
com.marginallyclever.ro3.apps.pathtracer.PathTracer
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addProgressListener
(PathTracerPanel pathTracerPanel) double
getImage()
int
getRayThroughPoint
(Camera camera, double normalizedX, double normalizedY) Return the ray, in world space, that starts at the camera and passes through this viewport at (x,y) in the current projection.getRayThroughPointUntransformed
(Camera camera, double normalizedX, double normalizedY) Return the ray, in camera space, that starts at the origin and passes through this viewport at (x,y) in the current projection.int
long
void
render()
void
setActiveCamera
(Camera camera) void
setMaxDepth
(int maxDepth) void
setSamplesPerPixel
(int samplesPerPixel) void
setSize
(int width, int height) Set the size of the canvas.
-
Constructor Details
-
PathTracer
public PathTracer()
-
-
Method Details
-
render
public void render() -
getRayThroughPoint
Return the ray, in world space, that starts at the camera and passes through this viewport at (x,y) in the current projection. x,y should be normalized screen coordinates adjusted for the vertical flip.
Remember that in OpenGL the camera -Z=forward, +X=right, +Y=up
- Parameters:
normalizedX
- the cursor position in screen coordinates [-1,1]normalizedY
- the cursor position in screen coordinates [-1,1]- Returns:
- the ray coming through the viewport in the current projection.
-
getRayThroughPointUntransformed
Return the ray, in camera space, that starts at the origin and passes through this viewport at (x,y) in the current projection. x,y should be normalized screen coordinates adjusted for the vertical flip.
Remember that in OpenGL the camera -Z=forward, +X=right, +Y=up
- Parameters:
normalizedX
- the cursor position in screen coordinates [-1,1]normalizedY
- the cursor position in screen coordinates [-1,1]- Returns:
- the ray coming through the viewport in the current projection.
-
getStartTime
public long getStartTime() -
setSize
public void setSize(int width, int height) Set the size of the canvas. Destroys the previous image and creates a new one.- Parameters:
width
- the widthheight
- the height
-
getImage
-
setActiveCamera
-
getMaxDepth
public int getMaxDepth() -
setMaxDepth
public void setMaxDepth(int maxDepth) -
getSamplesPerPixel
public int getSamplesPerPixel() -
setSamplesPerPixel
public void setSamplesPerPixel(int samplesPerPixel) -
getAspectRatio
public double getAspectRatio() -
addProgressListener
-