Hacker News new | ask | show | jobs
by willvarfar 3165 days ago
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.
1 comments

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)

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 :)