Update app.py
Browse files
app.py
CHANGED
@@ -936,8 +936,12 @@ window.snapshot = snapshot;
|
|
936 |
forceUpdate
|
937 |
) {
|
938 |
if (!mesh.isVerticesDataPresent(BABYLON.VertexBuffer.PositionKind) || !mesh.isVerticesDataPresent(BABYLON.VertexBuffer.NormalKind) || !mesh.isVerticesDataPresent(BABYLON.VertexBuffer.UVKind)) {
|
939 |
-
alert("Cannot call applyDisplacementMap: Given mesh is not complete. Position, Normal or UV are missing
|
940 |
-
|
|
|
|
|
|
|
|
|
941 |
}
|
942 |
|
943 |
const positions = mesh.getVerticesData(BABYLON.VertexBuffer.PositionKind, true, true);
|
|
|
936 |
forceUpdate
|
937 |
) {
|
938 |
if (!mesh.isVerticesDataPresent(BABYLON.VertexBuffer.PositionKind) || !mesh.isVerticesDataPresent(BABYLON.VertexBuffer.NormalKind) || !mesh.isVerticesDataPresent(BABYLON.VertexBuffer.UVKind)) {
|
939 |
+
//alert("Cannot call applyDisplacementMap: Given mesh is not complete. Position, Normal or UV are missing");
|
940 |
+
let positions = mesh.getVerticesData(BABYLON.VertexBuffer.PositionKind);
|
941 |
+
let normals = [];
|
942 |
+
BABYLON.VertexData.ComputeNormals(positions, mesh.getIndices(), normals, {useRightHandedSystem: true});
|
943 |
+
mesh.setVerticesData(BABYLON.VertexBuffer.NormalKind, normals);
|
944 |
+
//return mesh;
|
945 |
}
|
946 |
|
947 |
const positions = mesh.getVerticesData(BABYLON.VertexBuffer.PositionKind, true, true);
|