PeterouZh / CIPS-3D

3D-aware GANs based on NeRF (arXiv).
MIT License
610 stars 60 forks source link

Question about camera postion #16

Closed shoutOutYangJie closed 2 years ago

shoutOutYangJie commented 2 years ago

In the funtion "sample_camera_positions", you generate a random camera postion. But I am very confused about last three lines.

output_points = torch.zeros((bs, 3), device=device) # (bs, 3)
output_points[:, 0:1] = r torch.sin(phi) torch.cos(theta) # x output_points[:, 2:3] = r torch.sin(phi) torch.sin(theta) # z output_points[:, 1:2] = r * torch.cos(phi) # y

I don't know what it means? Please give me help. I guess it refers to 3d rotation, but I am not sure.

PeterouZh commented 2 years ago

SharedScreenshot

Hope this helps.