Using, for example, the Rings styleType, the default appearance of the ObjectManipulator is the following:
By specifying custom meshes it's possible to change its appearance:
Here the code:
var orig = Mesh.CreateBox(1.6, 1.6, 1.6);
orig.Translate(-0.8, -0.8, -0.8);
model1.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);
model1.ObjectManipulator.Entities[1] = meshX;
model1.ObjectManipulator.Entities[2] = meshY;
model1.ObjectManipulator.Entities[3] = meshZ;
model1.ObjectManipulator.TranslateX.Color = Color.Pink;
model1.ObjectManipulator.TranslateY.Color = Color.Orange;
model1.ObjectManipulator.TranslateZ.Color = Color.Aquamarine;
model1.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);
model1.ObjectManipulator.Entities[4] = arcX;
model1.ObjectManipulator.Entities[5] = arcY;
model1.ObjectManipulator.Entities[6] = arcZ;
model1.ObjectManipulator.RotateX.Color = Color.Pink;
model1.ObjectManipulator.RotateY.Color = Color.Orange;
model1.ObjectManipulator.RotateZ.Color = Color.Aquamarine;
var sphereX = Mesh.CreateSphere(0.8, 14, 14, Mesh.natureType.Smooth);
sphereX.Translate(11.5, 0, 0);
model1.ObjectManipulator.Entities[7] = sphereX;
var sphereY = Mesh.CreateSphere(0.8, 14, 14, Mesh.natureType.Smooth);
sphereY.Translate(0, 11.5, 0);
model1.ObjectManipulator.Entities[8] = sphereY;
var sphereZ = Mesh.CreateSphere(0.8, 14, 14, Mesh.natureType.Smooth);
sphereZ.Translate(0, 0, 11.5);
model1.ObjectManipulator.Entities[9] = sphereZ;
model1.CompileUserInterfaceElements();
Previous versions of this article: Eyeshot 9
Comments
Hi,
How can we get rendered look with custom mesh entities?
expected look
Thanks in advance
Note: I am using Eyeshot 12 WPF
Please sign in to leave a comment.