X-Git-Url: http://www2.svjatoslav.eu/gitweb/?p=sixth-3d.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Feu%2Fsvjatoslav%2Fsixth%2Fe3d%2Frenderer%2Foctree%2Fraytracer%2FRayTracer.java;h=daeb417d5123af95c0e8795b586a238ce2fab627;hp=d389a82d46d590c007699b433c7fedc9a8ac91fb;hb=a3ff3683bd0a025061667b26b6fcf56fe20f0afc;hpb=3f589bbc56ebfb1bd35b538b8a77d4019396b5aa diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/raytracer/RayTracer.java b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/raytracer/RayTracer.java index d389a82..daeb417 100755 --- a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/raytracer/RayTracer.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/raytracer/RayTracer.java @@ -1,5 +1,5 @@ /* - * Sixth 3D engine. Author: Svjatoslav Agejenko. + * Sixth 3D engine. Author: Svjatoslav Agejenko. * This project is released under Creative Commons Zero (CC0) license. */ package eu.svjatoslav.sixth.e3d.renderer.octree.raytracer; @@ -87,9 +87,9 @@ public class RayTracer implements Runnable { cameraView.cameraCenter.y, cameraView.cameraCenter.z), new Point3D( - cx3 - cameraView.cameraCenter.x, cy3 - - cameraView.cameraCenter.y, cz3 - - cameraView.cameraCenter.z) + cx3 - cameraView.cameraCenter.x, cy3 + - cameraView.cameraCenter.y, cz3 + - cameraView.cameraCenter.z) ); final int c = traceRay(r); @@ -140,13 +140,13 @@ public class RayTracer implements Runnable { final Ray r1 = new Ray( new Point3D( - ray.hitCellX, - ray.hitCellY - (float) 1.5, - ray.hitCellZ), + ray.hitCellX, + ray.hitCellY - (float) 1.5, + ray.hitCellZ), new Point3D((float) l.location.x - (float) ray.hitCellX, l.location.y - - (ray.hitCellY - (float) 1.5), (float) l.location.z - - (float) ray.hitCellZ) + - (ray.hitCellY - (float) 1.5), (float) l.location.z + - (float) ray.hitCellZ) ); final int rt1 = octreeVolume.traceCell(0, 0, 0, @@ -160,13 +160,13 @@ public class RayTracer implements Runnable { final Ray r2 = new Ray( new Point3D( - ray.hitCellX - (float) 1.5, - ray.hitCellY, ray.hitCellZ), + ray.hitCellX - (float) 1.5, + ray.hitCellY, ray.hitCellZ), new Point3D( - l.location.x - (ray.hitCellX - (float) 1.5), (float) l.location.y - - (float) ray.hitCellY, (float) l.location.z - - (float) ray.hitCellZ) + l.location.x - (ray.hitCellX - (float) 1.5), (float) l.location.y + - (float) ray.hitCellY, (float) l.location.z + - (float) ray.hitCellZ) ); final int rt2 = octreeVolume.traceCell(0, 0, 0, @@ -186,13 +186,13 @@ public class RayTracer implements Runnable { } final Ray r3 = new Ray( - new Point3D ( - ray.hitCellX, ray.hitCellY, - ray.hitCellZ - (float) 1.5), new Point3D( - (float) l.location.x - (float) ray.hitCellX, (float) l.location.y - - (float) ray.hitCellY, l.location.z - - (ray.hitCellZ - (float) 1.5)) + ray.hitCellX, ray.hitCellY, + ray.hitCellZ - (float) 1.5), + new Point3D( + (float) l.location.x - (float) ray.hitCellX, (float) l.location.y + - (float) ray.hitCellY, l.location.z + - (ray.hitCellZ - (float) 1.5)) ); final int rt3 = octreeVolume.traceCell(0, 0, 0, @@ -212,14 +212,14 @@ public class RayTracer implements Runnable { final Ray r4 = new Ray( new Point3D( - ray.hitCellX, - ray.hitCellY+ (float) 1.5, - ray.hitCellZ), + ray.hitCellX, + ray.hitCellY + (float) 1.5, + ray.hitCellZ), new Point3D( - (float) l.location.x - (float) ray.hitCellX, l.location.y - - (ray.hitCellY + (float) 1.5), (float) l.location.z - - (float) ray.hitCellZ) + (float) l.location.x - (float) ray.hitCellX, l.location.y + - (ray.hitCellY + (float) 1.5), (float) l.location.z + - (float) ray.hitCellZ) ); final int rt4 = octreeVolume.traceCell(0, 0, 0, @@ -239,14 +239,14 @@ public class RayTracer implements Runnable { final Ray r5 = new Ray( new Point3D( - ray.hitCellX + (float) 1.5, - ray.hitCellY, ray.hitCellZ), + ray.hitCellX + (float) 1.5, + ray.hitCellY, ray.hitCellZ), new Point3D( - l.location.x - (ray.hitCellX + (float) 1.5), (float) l.location.y - - (float) ray.hitCellY, (float) l.location.z - - (float) ray.hitCellZ) - ); + l.location.x - (ray.hitCellX + (float) 1.5), (float) l.location.y + - (float) ray.hitCellY, (float) l.location.z + - (float) ray.hitCellZ) + ); final int rt5 = octreeVolume.traceCell(0, 0, 0, octreeVolume.masterCellSize, 0, r5); @@ -265,14 +265,14 @@ public class RayTracer implements Runnable { final Ray r6 = new Ray( new Point3D( - ray.hitCellX, ray.hitCellY, - ray.hitCellZ + (float) 1.5), + ray.hitCellX, ray.hitCellY, + ray.hitCellZ + (float) 1.5), new Point3D( - (float) l.location.x - (float) ray.hitCellX, (float) l.location.y - - (float) ray.hitCellY, l.location.z - - (ray.hitCellZ + (float) 1.5))); + (float) l.location.x - (float) ray.hitCellX, (float) l.location.y + - (float) ray.hitCellY, l.location.z + - (ray.hitCellZ + (float) 1.5))); final int rt6 = octreeVolume.traceCell(0, 0, 0, octreeVolume.masterCellSize, 0, r6);