partial support for sculpted prim "inside out" setting

0.6.5-rc1
Dahlia Trimble 2009-04-02 06:54:48 +00:00
parent 59a6dfbf5a
commit b42fec5c74
1 changed files with 37 additions and 10 deletions

View File

@ -231,6 +231,10 @@ namespace PrimMesher
normals = new List<Coord>(); normals = new List<Coord>();
uvs = new List<UVCoord>(); uvs = new List<UVCoord>();
if (mirror)
if (sculptType != SculptType.plane)
invert = !invert;
//float sourceScaleFactor = (float)lod / (float)Math.Max(sculptBitmap.Width, sculptBitmap.Height); //float sourceScaleFactor = (float)lod / (float)Math.Max(sculptBitmap.Width, sculptBitmap.Height);
float sourceScaleFactor = (float)(lod) / (float)Math.Sqrt(sculptBitmap.Width * sculptBitmap.Height); float sourceScaleFactor = (float)(lod) / (float)Math.Sqrt(sculptBitmap.Width * sculptBitmap.Height);
bool scaleSourceImage = sourceScaleFactor < 1.0f ? true : false; bool scaleSourceImage = sourceScaleFactor < 1.0f ? true : false;
@ -337,6 +341,20 @@ namespace PrimMesher
Face f1, f2; Face f1, f2;
if (viewerMode) if (viewerMode)
{
if (invert)
{
f1 = new Face(p1, p4, p3, p1, p4, p3);
f1.uv1 = p1;
f1.uv2 = p4;
f1.uv3 = p3;
f2 = new Face(p1, p2, p4, p1, p2, p4);
f2.uv1 = p1;
f2.uv2 = p2;
f2.uv3 = p4;
}
else
{ {
f1 = new Face(p1, p3, p4, p1, p3, p4); f1 = new Face(p1, p3, p4, p1, p3, p4);
f1.uv1 = p1; f1.uv1 = p1;
@ -348,11 +366,20 @@ namespace PrimMesher
f2.uv2 = p4; f2.uv2 = p4;
f2.uv3 = p2; f2.uv3 = p2;
} }
}
else
{
if (invert)
{
f1 = new Face(p1, p4, p3);
f2 = new Face(p1, p2, p4);
}
else else
{ {
f1 = new Face(p1, p3, p4); f1 = new Face(p1, p3, p4);
f2 = new Face(p1, p4, p2); f2 = new Face(p1, p4, p2);
} }
}
this.faces.Add(f1); this.faces.Add(f1);
this.faces.Add(f2); this.faces.Add(f2);