Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inquiry Regarding Tn(normal) Calculation #36

Open
dukang opened this issue May 20, 2024 · 1 comment
Open

Inquiry Regarding Tn(normal) Calculation #36

dukang opened this issue May 20, 2024 · 1 comment

Comments

@dukang
Copy link

dukang commented May 20, 2024

Recently, I've been quite confused by matrix multiplication. I noticed that in forward.cu, the normal is calculated by multiplying it with the viewMatrix, which transforms the normals into camera space. However, in render/init.py, the viewMatrix is multiplied again when rendering it as the final normal_map. My question is, why do we need to multiply the viewMatrix twice, considering that I believe the final normal_map is already in camera space?

@hbb1
Copy link
Owner

hbb1 commented May 21, 2024

Tn is transformed to view space via viewMatrix in CUDA, and is transformed back to world space via the transpose of viewMatrix in Python. As a result, you see multiplication twice. Be care that transpose equates inverse for a rotation transformation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants