Find block texture by block ID and blockstates

I'm working on an external program that is given a list of blocks and their blockstates, and needs to render it. However, all the blocks have different textures, for example, doors have top/bottom, logs have top/side, rails have normal/on, and so on. Is there some way to input a camera direction, blockstates and block id and be given the texture name? Even anything remotely related would be useful, thanks!

Continue to help post