aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/Meshing
diff options
context:
space:
mode:
authorDahlia Trimble2009-01-21 02:40:09 +0000
committerDahlia Trimble2009-01-21 02:40:09 +0000
commit032b30ffdb276e6e90ae22e89b9a046d1c0ee908 (patch)
tree2724ddead7769e985d30f53ff2df0b82ad8f503c /OpenSim/Region/Physics/Meshing
parentSet request method for REST requests with no input. (diff)
downloadopensim-SC_OLD-032b30ffdb276e6e90ae22e89b9a046d1c0ee908.zip
opensim-SC_OLD-032b30ffdb276e6e90ae22e89b9a046d1c0ee908.tar.gz
opensim-SC_OLD-032b30ffdb276e6e90ae22e89b9a046d1c0ee908.tar.bz2
opensim-SC_OLD-032b30ffdb276e6e90ae22e89b9a046d1c0ee908.tar.xz
Fix an error in sculpt LOD calculation
Diffstat (limited to 'OpenSim/Region/Physics/Meshing')
-rw-r--r--OpenSim/Region/Physics/Meshing/SculptMesh.cs6
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;