Skip to content

Fix calculating geometric normals - #270

Merged
syoyo merged 1 commit into
tinyobjloader:masterfrom
DomGries:patch-1
Mar 30, 2020
Merged

Fix calculating geometric normals#270
syoyo merged 1 commit into
tinyobjloader:masterfrom
DomGries:patch-1

Conversation

@DomGries

@DomGries DomGries commented Mar 30, 2020

Copy link
Copy Markdown
Contributor

Based on normal calculation of old tinyobj version cross product should be different order

float3 normal = v12.crossproduct(v13);

float3 crossproduct(const float3 &vec) {
float a = y * vec.z - z * vec.y;
float b = z * vec.x - x * vec.z;
float c = x * vec.y - y * vec.x;
return float3(a, b, c);
}

@syoyo
syoyo merged commit cbf733c into tinyobjloader:master Mar 30, 2020
@syoyo

syoyo commented Mar 30, 2020

Copy link
Copy Markdown
Collaborator

Awesome! Thank you!

syoyo pushed a commit that referenced this pull request Nov 10, 2025
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

Successfully merging this pull request may close these issues.

2 participants