For bugs and new features, use the issue tracker located at GitHub.
Also try the chat room!
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?
Dynamic Texture on "Earth"
Robert_Smart wrote at 2014-07-02 11:58:
I've just started looking at Helix3D. It looks pretty awesome.
I was just wondering if anyone knew if it was possible or how difficult it would be to add a dynamic texture to something like the Earth demo, so as you zoomed in, you give the zoomed in region higher resolution textures? there are already a map tiling library (brutile) that can handle the fetching of the correct tiles from a mapserver, so it would just be a matter of replacing the texture with the correct resolution one in the correct place right?
Thanks,
Rob
objo wrote at 2014-07-02 13:06:
Robert_Smart wrote at 2014-07-02 15:11:
MapSUI is a great example of map streaming using brutile, so i guess it would be a similar thing to this. I would be willing to lend a hand with the mapping side of things if someone can help with the 3d side of things!
If we can get this working i can see it looking like google earth, which would be awesome.
Thanks
Transparency drawing brush problem
behnam263 wrote at 2014-08-26 13:22:
behnam263 wrote at 2014-08-27 06:01:
sharpdx TeamCity??
eonxxx wrote at 2014-04-21 23:34:
got following Problems at runtime, usoing the sharpdx Alpha package from nuget.
StackTrace:
bei HelixToolkit.Wpf.SharpDX.Viewport3DX.HelixToolkit.Wpf.SharpDX.IRenderer.Render(RenderContext context) in c:\TeamCity\buildAgent\work\4ff441572eb3435d\Source\HelixToolkit.Wpf.SharpDX\Controls\Viewport3DX.cs:Zeile 890.
and s on... any suggestions? what is TeamCity and do I Need it to run the sharpdx Alpha?
thanks for help
eonxxx wrote at 2014-04-24 08:13:
The problem was, that I didn't set the sharpdx_direct3d11_effects_x64.dll to be copied to the debug/release output folder (properties of the DLL).
Missed controls are just a side effect.
Overlay does not function when extending a template from a different project
JasonXtreme wrote at 2014-03-31 13:57:
I have two projects in a WPF solution, P1 is the main .exe assembly including the Helix3DViewport and an object that extends a base class in P2. The base class in P2 sets up an interface and contains a function that among other things sets a text overlay via Overlay.SetPosition3D and updates it on interaction. If this base class is situated in P1, the overlay works perfectly, but if the base class is moved to the other project, the overlay simply applies the text to the bottom left corner of the overlay canvas. Could there be a workaround for this, as I really need the base class to be in a class library rather than in P1?
Thank you in advance,
Jason
objo wrote at 2014-04-29 10:33:
JasonXtreme wrote at 2014-04-30 01:41:
Fix for Memory Leak on MeshElement3D
crashedapp wrote at 2011-10-08 00:13:
I noticed I was getting a memory leak when removing a control from a page that was using several SphereVisual3D objects.
I was able to find the casue.
In MeshElement3D there is an event wired up to CompositionTarget.Rendering
The event doesn't even appear to be needed so I commented it out.
The memory leak is gone.
Thanks to Ants for their great profiler and thanks to you for your great Project!
objo wrote at 2011-10-08 20:53:
thanks for pointing this out!
I removed the subscription to the CompositionTarget.Rendering event, you are right - it should not be needed.
I also improved the ScreenSpaceLines CompositionTarget.Rendering event wiring - it should now unsubscribe automatically when an element is removed from the visual tree.
UpDirection Demo problem?
Elemental wrote at 2011-09-30 08:40:
Hello,
first of all I want to thank you for this great toolkit.
I downloaded it a few months ago when I started developing WPF3D apps and it helped me a lot to understand how things have to be done.
Today I downloaded the source again, but now the UpDirection demo does not work correctly anymore.
When rotating via right mouse button and moving the to the left or right, the rotation suddenly stops and I cannot rotate any further.
Can you confirm this problem? What is wrong here?
Best Regards
objo wrote at 2011-10-02 08:19:
Thanks for the notification! This should be corrected now, see revision 70973.
objo wrote at 2011-10-02 08:25:
Sorry, I forgot the importartant changes in CameraController\RotateHandler.cs, included in revision 70974.
Customer support service by UserEcho