diff --git a/orx-mesh-noise/src/commonMain/kotlin/MeshNoise.kt b/orx-mesh-noise/src/commonMain/kotlin/MeshNoise.kt index af596105..af9f08f0 100644 --- a/orx-mesh-noise/src/commonMain/kotlin/MeshNoise.kt +++ b/orx-mesh-noise/src/commonMain/kotlin/MeshNoise.kt @@ -32,6 +32,10 @@ fun nonUniformBarycentric(weight0: Double, weight1: Double, weight2: Double, ran var b0 = b.x / weight0 var b1 = b.y / weight1 var b2 = b.z / weight2 + val b = uniformBarycentric(random) + var b0 = b.x * weight0 + var b1 = b.y * weight1 + var b2 = b.z * weight2 val totalWeight = b0 + b1 + b2 b0 /= totalWeight b1 /= totalWeight