ObjectManipulator customization

Using, for example, the Rings styleType, the default appearance of the ObjectManipulator is the following: 

om-1.png

By specifying custom meshes it's possible to change its appearance:

om-0.png

Here is the code:

 
var orig = Mesh.CreateBox(1.6, 1.6, 1.6);
orig.Translate(-0.8, -0.8, -0.8);
design1.ObjectManipulator.Entities[0] = orig;

var meshX = Mesh.CreateArrow(0.4, 15, 0.6, 3, 10, Mesh.natureType.Smooth);
meshX.Translate(-7.5, 0, 0);

var meshY = (Mesh)meshX.Clone();
meshY.Rotate(Math.PI / 2, Vector3D.AxisZ);

var meshZ = Mesh.CreateArrow(0.4, 7.5, 0.6, 3, 10, Mesh.natureType.Smooth);
meshZ.Rotate(-Math.PI / 2, Vector3D.AxisY);

design1.ObjectManipulator.Entities[1] = meshX;
design1.ObjectManipulator.Entities[2] = meshY;
design1.ObjectManipulator.Entities[3] = meshZ;

design1.ObjectManipulator.TranslateX.Color = Color.Pink;
design1.ObjectManipulator.TranslateY.Color = Color.Orange;
design1.ObjectManipulator.TranslateZ.Color = Color.Aquamarine;
design1.ObjectManipulator.Ball.Color = Color.Chocolate;

var reg = new devDept.Eyeshot.Entities.Region(new Circle(5, 0, 0, 0.4));
var arcY = reg.RevolveAsMesh(0, Math.PI, -1 * Vector3D.AxisY, Point3D.Origin, 10, 0.1, Mesh.natureType.Smooth);

var arcX = (Mesh)arcY.Clone();
arcX.Rotate(Math.PI / 2, Vector3D.AxisZ);

reg = new devDept.Eyeshot.Entities.Region(new Circle(5, 0, 0, 0.4));
var arcZ = reg.RevolveAsMesh(0, Math.PI, Vector3D.AxisY, Point3D.Origin, 20, 0.1, Mesh.natureType.Smooth);
arcZ.Rotate(Math.PI / 2, Vector3D.AxisZ);
arcZ.Rotate(Math.PI / 2, Vector3D.AxisY);

design1.ObjectManipulator.Entities[4] = arcX;
design1.ObjectManipulator.Entities[5] = arcY;
design1.ObjectManipulator.Entities[6] = arcZ;

design1.ObjectManipulator.RotateX.Color = Color.Pink;
design1.ObjectManipulator.RotateY.Color = Color.Orange;
design1.ObjectManipulator.RotateZ.Color = Color.Aquamarine;

var sphereX = Mesh.CreateSphere(0.8, 14, 14, Mesh.natureType.Smooth);
sphereX.Translate(11.5, 0, 0);
design1.ObjectManipulator.Entities[7] = sphereX;
var sphereY = Mesh.CreateSphere(0.8, 14, 14, Mesh.natureType.Smooth);
sphereY.Translate(0, 11.5, 0);
design1.ObjectManipulator.Entities[8] = sphereY;
var sphereZ = Mesh.CreateSphere(0.8, 14, 14, Mesh.natureType.Smooth);
sphereZ.Translate(0, 0, 11.5);
design1.ObjectManipulator.Entities[9] = sphereZ;

design1.CompileUserInterfaceElements();

Previous versions of this article: Eyeshot 9

Was this article helpful?
0 out of 0 found this helpful

Comments

1 comment
Date Votes
  • Hi,

    How can we get rendered look with custom mesh entities?

    expected look

    Thanks in advance

    Note: I am using Eyeshot 12 WPF

    0

Please sign in to leave a comment.

Articles in this section

See more