For bugs and new features, use the issue tracker located at GitHub.
Also try the chat room!

Select Object into the view
CesarMayorine wrote at 2014-09-01 12:59:
CesarMayorine wrote at 2014-09-01 13:00:

Camera rotate around centroid or specific point
charlh wrote at 2012-07-30 17:33:
Hi there.
Is there any way to always have the camera rotate about a model's centroid (say a cube for example)? In other words, update the rotation point when a model is zoomed in on or panned so that the point of rotation is always about the model's centroid or a point of choice in 3d space. Thanks for the help.
objo wrote at 2012-08-09 00:52:
This is a new feature in the 'camera controller'. Need to create a new mode where the rotation point is fixed (currently you can choose between rotating around the 'mouse down point' or the camera 'target' point).
Added as issue http://helixtoolkit.codeplex.com/workitem/9961

Moving the Model instead of the camera
MikeCo wrote at 2012-10-24 18:42:
Is there a way to move the model in space and not the camera?
Thanks!
objo wrote at 2012-10-26 08:54:
The mouse handlers in this toolkit moves the camera, you need to write your own mouse handlers if you want to transform your model!

CuttingEarsTriangulator possible bug
baucez wrote at 2013-04-19 16:03:
It works almost all the time but I found some cases in which method Triangulate gives me null even if the polygons is valid.
One of this cases is when I pass the following list of points:
0,0
0,1.894
-2.536,1.42
-5.072,1.42
-5.072,2.84
-10.144,2.84
-10.144,0
How can I get my triangles? Is there a workaround?
RobPerkins wrote at 2013-04-22 23:05:
http://www.codeproject.com/Articles/8238/Polygon-Triangulation-in-C
The code is conveniently in C# and contains no dependencies on anything except .NET (probably .NET 1.1, so it would be good for any .NET stack)
objo wrote at 2013-04-26 22:23:
RobPerkins: thanks for the link, I will have a look at that implementation, and possible use it to verify results
objo wrote at 2013-04-30 23:09:
var polygon = new[]
{
new Point(0, 0),
new Point(0, 1.894),
new Point(-2.536, 1.42),
new Point(-5.072, 1.42),
new Point(-5.072, 2.84),
new Point(-10.144, 2.84),
new Point(-10.144, 0)
};
var result = CuttingEarsTriangulator.Triangulate(polygon);
gives the result{0 1 2 3 4 5 6 0 2 3 5 6 6 2 3}
which looks correct to me...baucez wrote at 2013-05-02 10:21:
I looked better at my code and I found that the list of points that I gave you was approximated.
If you try this code will fail:
{
var polygon = new[]
{
new Point(0, 0),
new Point(0, 2.97),
new Point(-2.389999999999997, 2.97),
new Point(-2.389999999999997, 1.4849999999999999),
new Point(-4.7799999999999976, 1.4849999999999999),
new Point(-4.7799999999999976, 2.97),
new Point(-9.5599999999999987, 2.97),
new Point(-9.5599999999999987, 0),
};
var result = CuttingEarsTriangulator.Triangulate(polygon);
Assert.IsNotNull(result);
}
The problem is caused by double arithmetic approximations.In particular (but I'm not sure is the only place in the code) the problem is in the comparisons at the end of CuttingEarsTriangulator.InsideTriangle method
objo wrote at 2013-05-08 15:28:

Meshbuilder with 32000 position, normal and etc memory problem
behnam263 wrote at 2014-07-05 09:07:
I started to add position and normal and texture coordinates to a meshbuilder but i get memory inefficient by debuger!
Is it a memory leak? How can i handle this?
objo wrote at 2014-07-11 21:45:
behnam263 wrote at 2014-07-22 10:41:

FileModelVisual3D and opacity
regha wrote at 2013-09-20 18:42:
I don't know how to change the opacity of an FileModelVisual3D object.
Somebody can help me...
objo wrote at 2013-09-29 10:03:
regha wrote at 2013-09-29 10:55:
I can access to children of viewport but after... I don't know...
regha wrote at 2014-07-30 14:59:
Anybody knows how to retrieve geometryModel3D from FileModelVisual3D ?
everytimer wrote at 2014-07-30 19:24:
Model3DGroup grupo = (Model3DGroup)myFileModelVisual3D.Content;
foreach (var modelo in grupo.Children.OfType<GeometryModel3D>())
{
GeometryModel3D model = (GeometryModel3D)modelo;
var mat1 = modelo.Material.Clone();
var mat2 = modelo.BackMaterial.Clone();
MaterialHelper.ChangeOpacity(mat1, SliderVerifyOpacity.Value);
MaterialHelper.ChangeOpacity(mat2, SliderVerifyOpacity.Value);
model.Material = mat1;
model.BackMaterial = mat2;
}
foreach (var group in grupo.Children.OfType<Model3DGroup>())
{
Model3DGroup grupoModel = (Model3DGroup)group;
foreach (var modelo in grupoModel.Children.OfType<GeometryModel3D>())
{
GeometryModel3D model = (GeometryModel3D)modelo;
var mat1 = modelo.Material.Clone();
var mat2 = modelo.BackMaterial.Clone();
MaterialHelper.ChangeOpacity(mat1, SliderVerifyOpacity.Value);
MaterialHelper.ChangeOpacity(mat2, SliderVerifyOpacity.Value);
model.Material = mat1;
model.BackMaterial = mat2;
}
}
In this example the opacity is controlled by a Slider, change to a specific value if you want it so.
Good luck.

Fill polygon with texture
Nikodem wrote at 2014-06-25 22:55:
For the rectangle I use two triangle and for texture I added coordinates for triangles:
// triangle ABC
mesh.TriangleIndices.Add(0);
mesh.TriangleIndices.Add(1);
mesh.TriangleIndices.Add(2);
// triangle ACD
mesh.TriangleIndices.Add(0);
mesh.TriangleIndices.Add(2);
mesh.TriangleIndices.Add(3);
mesh.TextureCoordinates.Add(new Point(0, 1)); // point A
mesh.TextureCoordinates.Add(new Point(1, 1)); // point B
mesh.TextureCoordinates.Add(new Point(1, 0)); // point C
mesh.TextureCoordinates.Add(new Point(0, 0)); // point D
var d = new DiffuseMaterial(imgBrush);
mGeometries.Add(new GeometryModel3D(mesh, d));
....
On this discussion I found functions for create of polygon.
public static MeshGeometry3D FillPolygon(Polygon p)
{
List<Point3D> pts3D = new List<Point3D>();
foreach (var point in p.Points)
{
pts3D.Add(new Point3D(point.X, point.Y, 0));
}
Polygon3D p3 = new Polygon3D(pts3D);
return FillPolygon(p3);
}
public static MeshGeometry3D FillPolygon(Polygon3D p3)
{
var meshBuilder = new MeshBuilder(false, false);
Polygon polygon = p3.Flatten();
var triangleIndexes = CuttingEarsTriangulator.Triangulate(polygon.Points);
meshBuilder.Append(p3.Points, triangleIndexes);
return meshBuilder.ToMesh();
}
Polygon drawing right, but I do not know how I do configuration for fill texture on the polygon.
Texture is rectangle image and I wants show shape cut of texture on the polygon.
Thank you very much.
Jindrich

Help with cutting plane group

Purpose of EnableCurrentPosition property
If we inspect the code we can see that it controls whether CurrentPosition is calculated or not:
[HelixViewport3D.cs]
protected override void OnMouseMove(MouseEventArgs e)
{
base.OnMouseMove(e);
if (this.EnableCurrentPosition)
{
var pt = e.GetPosition(this);
var pos = this.FindNearestPoint(pt);
if (pos != null)
{
this.CurrentPosition = pos.Value;
}
else
{
var p = this.Viewport.UnProject(pt);
if (p != null)
{
this.CurrentPosition = p.Value;
}
}
}
So, each time OnMouseMove method is called the (Point3D) pos is calculated (by FindNearstPoint) and that may be a costly operation to perform each time the mouse is moved.
Why CurrentPosition is needed and why it is optional?
Customer support service by UserEcho