I’m trying to add a black border around my polygons. What I use to dram them is:
public static void DrawBox(double startX, double startY, double startZ, double length, double width, double heigth, Color color)
{
var outputDir = System.Environment.GetEnvironmentVariable(“OuputDir”);
var outputFileName = System.Environment.GetEnvironmentVariable(“OutputFileName”);
Scene scene = new Scene(outputDir + outputFileName);
Node cubeNode = new Node("cube");
cubeNode.Material = new PhongMaterial() { DiffuseColor = new Vector3(color) };
Mesh mesh = Common.CreateMeshUsingPolygonBuilder(startX, startY, startZ, length, heigth, width);
mesh.CastShadows = false;
RotateNode(cubeNode);
cubeNode.Entity = mesh;
scene.RootNode.ChildNodes.Add(cubeNode);
// Save 3D scene in the supported file formats
scene.Save(outputDir + outputFileName, FileFormat.FBX7400ASCII);
}
public static Mesh CreateMeshUsingPolygonBuilder(double startX, double startY, double startZ, double length, double height, double width)
{
Vector4[] controlPoints = DefineControlPoints(startX, startY, startZ, length, height, width);
Mesh mesh = new Mesh();
mesh.ControlPoints.AddRange(controlPoints);
int[] indices = new int[]
{
0,1,2,3, // Front face (Z+)
1,5,6,2, // Right side (X+)
5,4,7,6, // Back face (Z-)
4,0,3,7, // Left side (X-)
0,4,5,1, // Bottom face (Y-)
3,2,6,7 // Top face (Y+)
};
int vertexId = 0;
PolygonBuilder builder = new PolygonBuilder(mesh);
for (int face = 0; face < 6; face++)
{
builder.Begin();
for (int v = 0; v < 4; v++)
{
builder.AddVertex(indices[vertexId++]);
}
builder.End();
}
return mesh;
}
I end up with a picture like this:
image.png (23.9 KB)
I need to have a thick black border around my boxes. How can I do that ?