PeterouZh/CIPS-3D

Question about camera postion

shoutOutYangJie opened this issue · 1 comments

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.

SharedScreenshot

Hope this helps.