Commit graph

352 commits

Author SHA1 Message Date
92e67215b9 Get rid of commented out Box intersection code 2014-08-03 16:36:12 -07:00
556e13ae74 I was a little to hasty with this clean up
I actually need this check to get the closest shape for intersection.
2014-08-03 13:05:22 -07:00
4cbe9df324 Legacy code clean up for t values
Intersection methods push values into the t vector in ascending order, so no need to check them in TraceRay.
2014-08-03 12:46:14 -07:00
2ade996783 p.z comparison was comparing against mFar.y 2014-08-03 12:45:34 -07:00
6f4d91af01 Ray parameterization takes a Double 2014-08-03 12:44:53 -07:00
b1d18a124f Move the oneBox camera to see the angles 2014-08-03 12:24:15 -07:00
d79c95be71 Playing with the implementation of slab intersection
This stuff is commented out anyway because it all moved to IntersectSlab...
2014-08-03 12:23:59 -07:00
3ce6987d78 Add the declaration of Box::IntersectSlab 2014-08-03 12:23:19 -07:00
8831dec40c Use NearlyEqual in Box::compute_normal 2014-08-03 12:23:05 -07:00
ecb15470ac Some tweaks to floating point utility methods
- Implement NearlyEqual
- NearZero and TooFar take const Double&
- NearZero and NearlyEqual are templated to take Double& and Double&& (and anything else that can be subtracted and/or passed into std::fabs.
2014-08-03 12:22:30 -07:00
8d5dfe5154 Move slab intersection to Box::IntersectSlab
Makes it easier to debug because I don't have to change things in three places.

This change also includes the fix! The swap was the problem. I didn't have the optimization right. I'll have to go back and figure it out.
2014-08-03 12:20:48 -07:00
8275c9baee Update header for basics.h 2014-08-03 12:18:53 -07:00
dc1849a786 Test reverse subtraction (v2 - v1) 2014-08-03 10:51:38 -07:00
467edaf02b planeSphere scene: move some stuff around
To get a better view of where things are supposed to be.
2014-08-03 08:18:13 -07:00
6dcb9dd37f The problem was this one subtraction. Seriously. 2014-08-02 23:46:02 -07:00
e638764340 Put the light where I actually want it to be 2014-08-02 23:45:49 -07:00
f03945c0f7 Always return the normal, even if the point isn't in the plane
Getting so much closer!
2014-08-02 15:40:24 -07:00
5390600cdd TODO: what does this (apparently) random conditional do? 2014-08-02 15:32:27 -07:00
8ea832c090 Disable specular calculations for now.
Just to simplify things while I'm figuring out the lighting model...
2014-08-02 15:23:22 -07:00
79c951030d Move Stats to its own module
Move Stats to its own module and pass it around to the intersection methods to keep track of how many tests and successful intersections there are.
2014-08-02 15:21:14 -07:00
b60e27824b Forgot declaration of shadowRay <- shadow_ray 2014-08-02 14:33:50 -07:00
5ddfe068a6 No specular reflections (for now) 2014-08-02 14:33:32 -07:00
8de737decd Little bit of code clean up in TraceRay 2014-08-02 14:30:40 -07:00
1a5a46c468 Use NearZero in plane intersection calculations
Also clean up the "point on surface" logic and remove the normal flipping (doesn't make sense without a ray origin anyway).
2014-08-02 14:12:01 -07:00
82c7e75e11 Normalize primary ray direction vectors 2014-08-02 14:10:28 -07:00
57f3154986 Add a NearZero for temporary values 2014-08-02 14:10:04 -07:00
0d4b700546 Add EPSILON, MAX_DISTANCE, and NearZero and TooFar 2014-08-02 12:19:46 -07:00
0d6a238b44 Clean up some implementation header comments 2014-08-02 10:40:41 -07:00
662867f529 Return the appropriate normal
I'm not actually sure this is necessary...
2014-08-02 10:39:56 -07:00
20b88f6dac Clarify some notation in plane intersection 2014-08-02 10:39:29 -07:00
964b6a5751 Add Plane object parsing to ObjectParser 2014-08-02 10:13:39 -07:00
d37b82b116 A new scene: plane with a sphere above it 2014-08-02 10:04:10 -07:00
6ddd47fe64 Redo planes in normal-distance form
This is how POV-Ray does it. This is how The Book does it. I'm just going along for the ride… :) But seriously, it seems to make some things easier.
2014-08-02 10:00:54 -07:00
d44fa4dd2a Add Vector3::normalized()
Makes a copy of the vector, normalizes it, and returns it.
2014-08-02 10:00:00 -07:00
c80a6e9ac7 Rename object_plane -> objectPlane 2014-08-02 09:26:22 -07:00
ea1fac7501 Add ctags file 2014-08-02 00:42:59 -07:00
b6d7a65ae5 Merge branch 'feature/logging' into develop 2014-08-02 00:40:52 -07:00
86a4594e7f Initialize logging based on passed in parameters 2014-08-02 00:40:38 -07:00
f8ec140f8e Do some logging in Scene 2014-08-02 00:28:02 -07:00
3ab7c92d36 Duplicate logging symbols :( 2014-08-02 00:27:50 -07:00
0346e21ebd Set the log level to trace. 2014-08-02 00:02:11 -07:00
97a172bbe9 Add logModule.hh
Defines some helper macros to make it easier to log message. Define LOG_NAME before including this file and a number of logging macros will be defined that will allow users to skip specifying the name of the log stream for each statement.
2014-08-02 00:02:01 -07:00
3a94433f5c Set global default level in Init() 2014-08-01 23:49:52 -07:00
f8c7c9c6ea Add function Tracer 2014-08-01 23:49:33 -07:00
7cfb304296 Update logging stuff in main() 2014-08-01 23:28:13 -07:00
ea6cd488a6 LOG_FOO macros to help with printing messages 2014-08-01 23:27:32 -07:00
089c4cdc73 Print milliseconds 2014-08-01 23:27:18 -07:00
627854bc20 Use logging! 2014-08-01 22:28:47 -07:00
c00afe1cd1 Rudimentary logging! 2014-08-01 22:28:41 -07:00
d2b2382c95 Include <memory> in object.h 2014-07-25 15:10:29 -07:00