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

问题:计算具有biased的顶点法向量,代码中是不是需要关于顶点做个轮换 #46

Closed
gaoxinge opened this issue Sep 1, 2023 · 1 comment

Comments

@gaoxinge
Copy link

gaoxinge commented Sep 1, 2023

@archibate

现代码中,基于顶点a计算出具有biased的顶点法向量后,会依次赋值给a, b, c三个顶点:

opengltutor/src/OBJ.cpp

Lines 77 to 79 in 817754a

for (size_t i = 0; i < 3; i++) {
normals[face[i]] += compute_normal_biased(a, b, c);
}

是不是应该改成,基于顶点a, b, c进行轮换的计算,然后再依次赋值:

normals[face[0]] += compute_normal_biased(a, b, c); 
normals[face[1]] += compute_normal_biased(b, c, a); 
normals[face[2]] += compute_normal_biased(c, a, b);  
@archibate
Copy link
Collaborator

archibate commented Sep 1, 2023 via email

@gaoxinge gaoxinge closed this as completed Sep 2, 2023
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