From 032b30ffdb276e6e90ae22e89b9a046d1c0ee908 Mon Sep 17 00:00:00 2001 From: Dahlia Trimble Date: Wed, 21 Jan 2009 02:40:09 +0000 Subject: [PATCH] Fix an error in sculpt LOD calculation --- OpenSim/Region/Physics/Meshing/SculptMesh.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/OpenSim/Region/Physics/Meshing/SculptMesh.cs b/OpenSim/Region/Physics/Meshing/SculptMesh.cs index 9da74e6ad8..b447eaa43c 100644 --- a/OpenSim/Region/Physics/Meshing/SculptMesh.cs +++ b/OpenSim/Region/Physics/Meshing/SculptMesh.cs @@ -56,8 +56,8 @@ namespace PrimMesher int destX = 0; int destY = 0; - int destWidth = (int)(sourceWidth * scale); - int destHeight = (int)(sourceHeight * scale); + int destWidth = (int)(srcImage.Width * scale); + int destHeight = (int)(srcImage.Height * scale); Bitmap scaledImage = new Bitmap(destWidth, destHeight, PixelFormat.Format24bppRgb); @@ -214,7 +214,7 @@ namespace PrimMesher uvs = new List(); //float sourceScaleFactor = (float)lod / (float)Math.Max(sculptBitmap.Width, sculptBitmap.Height); - float sourceScaleFactor = (float)(lod * lod) / (float)(sculptBitmap.Width * sculptBitmap.Height); + float sourceScaleFactor = (float)(lod) / (float)Math.Sqrt(sculptBitmap.Width * sculptBitmap.Height); bool scaleSourceImage = sourceScaleFactor < 1.0f ? true : false; Bitmap bitmap;