|
|
I have essentially accomplished the end goal 4+ years ago, when I needed a depth
map for laser-engraving "2D" images in 3D relief.
I simply use the orthographic camera, union everything in the scene, find the
min and max z, normalize that to a 0-1 range, and then trace over every pixel
position of the image in the direction of the "direction" vector.
Then I create a 1 pixel-wide box with an rgb value directly proportional to the
normalized distance to the ray intersection point.
It's maybe 30 lines of code including the #debug statements.
Post a reply to this message
|
|