Re:A reasonably speedy Python ray tracer
by m00s3 on Saturday October 21, 2017 @01:20PM
(#15522587)
Anyone besides me disturbed that one of the code samples had function that took 3 parameters, 2 of which where 'O' and 'D'?
I had to look at it a few times before I realized those were different variables.
[ Parent
| on HN ]
Re:A reasonably speedy Python ray tracer
by willvarfar on Saturday October 21, 2017 @01:54PM
(#15522724)
In 3D programs it's normal for O to be origin and D direction. It's a convention you'll see in most codebases and it's completely undisturbing.
Really? Since when?
It's been a long-o time since I did any 3d physics or rendering code (in C), maybe even since before the WWW, but I don't remember this convention... (I mean - sure - it makes sense, but I don't recall the two 3-space triples being necessarily called that even in things like GL)
Re:A reasonably speedy Python ray tracer
by berkut on Saturday October 21, 2017 @04:05PM
(#15523367)
OpenGL doesn't do raytracing where you have a ray origin and direction though, so you wouldn't have seen it there.
Using the full terms or shortening them to Dir and Orig are more conventional in my experience.
It gets even more fun when you get to evaluating BSDFs for materials and you have variables like wi, wo, and different people use them in different ways :)
Re:A reasonably speedy Python ray tracer
by dahart on Saturday October 21, 2017 @05:23PM
(#15523689)
Anytime I start to feel disturbed about anyone else's code, I remember to re-read this: https://news.ycombinator.com/item?id=13571159
Re:A reasonably speedy Python ray tracer
by tomjakubowski on Saturday October 21, 2017 @09:23PM
(#15524601)
You'll get used to it after reading a couple dozen Shadertoy ray marchers.