rabbityl / DeformingThings4D

[ICCV 2021] A dataset of non-rigidly deforming objects.
302 stars 22 forks source link

Question about ray direction used in ray casting #6

Open Xiaoming-Zhao opened 2 years ago

Xiaoming-Zhao commented 2 years ago

Hi @rabbityl, thanks a lot for this great work! I have a question about ray direction used in the anime_renderer.py file and hope you can give me a hand if possible. My question is mainly about ray_direction used in the following line:

https://github.com/rabbityl/DeformingThings4D/blob/aa5e38d3326347c10434a963e351459169954a1e/code/anime_renderer.py#L240

I checked Blender's reference, function ray_cast requires ray_direction to be defined in object space. However, it seems like ray_direction is set up to be in world space:

https://github.com/rabbityl/DeformingThings4D/blob/aa5e38d3326347c10434a963e351459169954a1e/code/anime_renderer.py#L170-L173

I checked some meshes and find that their raycast_mesh.matrix_world is identical, which means that their object space is aligned with world space and there is no need to transform ray_direction. However, in general, I think we still need to have such a transformation, right?

Not sure whether I miss something so any guidance would be appreciated. Thanks in advance.