diff options
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/Physics/Meshing/SculptMesh.cs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/OpenSim/Region/Physics/Meshing/SculptMesh.cs b/OpenSim/Region/Physics/Meshing/SculptMesh.cs index 9da74e6..b447eaa 100644 --- a/OpenSim/Region/Physics/Meshing/SculptMesh.cs +++ b/OpenSim/Region/Physics/Meshing/SculptMesh.cs | |||
@@ -56,8 +56,8 @@ namespace PrimMesher | |||
56 | 56 | ||
57 | int destX = 0; | 57 | int destX = 0; |
58 | int destY = 0; | 58 | int destY = 0; |
59 | int destWidth = (int)(sourceWidth * scale); | 59 | int destWidth = (int)(srcImage.Width * scale); |
60 | int destHeight = (int)(sourceHeight * scale); | 60 | int destHeight = (int)(srcImage.Height * scale); |
61 | 61 | ||
62 | Bitmap scaledImage = new Bitmap(destWidth, destHeight, | 62 | Bitmap scaledImage = new Bitmap(destWidth, destHeight, |
63 | PixelFormat.Format24bppRgb); | 63 | PixelFormat.Format24bppRgb); |
@@ -214,7 +214,7 @@ namespace PrimMesher | |||
214 | uvs = new List<UVCoord>(); | 214 | uvs = new List<UVCoord>(); |
215 | 215 | ||
216 | //float sourceScaleFactor = (float)lod / (float)Math.Max(sculptBitmap.Width, sculptBitmap.Height); | 216 | //float sourceScaleFactor = (float)lod / (float)Math.Max(sculptBitmap.Width, sculptBitmap.Height); |
217 | float sourceScaleFactor = (float)(lod * lod) / (float)(sculptBitmap.Width * sculptBitmap.Height); | 217 | float sourceScaleFactor = (float)(lod) / (float)Math.Sqrt(sculptBitmap.Width * sculptBitmap.Height); |
218 | bool scaleSourceImage = sourceScaleFactor < 1.0f ? true : false; | 218 | bool scaleSourceImage = sourceScaleFactor < 1.0f ? true : false; |
219 | 219 | ||
220 | Bitmap bitmap; | 220 | Bitmap bitmap; |