Discard lines behind camera when processing grease penicl line art

pull/241/head
DJLevel3 2024-04-23 09:25:45 -06:00 zatwierdzone przez James H Ball
rodzic 894a21f7d8
commit f13258e195
1 zmienionych plików z 10 dodań i 5 usunięć

Wyświetl plik

@ -157,6 +157,10 @@ std::vector<Line> LineArtParser::generateFrame(juce::Array <juce::var> objects,
double rotatedY2 = end.x * allMatrices[i][4] + end.y * allMatrices[i][5] + end.z * allMatrices[i][6] + allMatrices[i][7];
double rotatedZ2 = end.x * allMatrices[i][8] + end.y * allMatrices[i][9] + end.z * allMatrices[i][10] + allMatrices[i][11];
// I think this discards every line with a vertex behind the camera? Needs more testing.
// - DJ_Level_3
if (rotatedZ < 0 && rotatedZ2 < 0) {
double x = rotatedX * focalLength / rotatedZ;
double y = rotatedY * focalLength / rotatedZ;
@ -167,5 +171,6 @@ std::vector<Line> LineArtParser::generateFrame(juce::Array <juce::var> objects,
}
}
}
}
return frame;
}