0
UIElement Visual3DModel behaves differently than MeshGeometryVisual3D
Hello. I am testing HelixToolKit and I am trying to achieve a simple task:
Create a revolve object and display it on the 3D view port. Since I need the object to be clickable, I am adding it using the UIElement example (changed it to have the rotation instead of the sphere). This is partially achieved, this is, the object displays and I can click on it (and have a desired event), but the object does not render well as the MeshGeometryVisual3D.
See image. Blue glass was added with UIElement, while the red one with MeshGeometryVisual3D. The red one is ok - it is what I want to obtain, while the blue presents parts transparent. If I rotate the camera those parts turn solid, but others transparent. I do not believe that is a question of light as I tested several. The blue glass is half the size of the red one on propose.
In resume red glass is perfect, blue glass is defected.
Relevant WPF code:
Red glass:
Any information is helpful as I am very new to Helix and even to WPF.
Thank you
Create a revolve object and display it on the 3D view port. Since I need the object to be clickable, I am adding it using the UIElement example (changed it to have the rotation instead of the sphere). This is partially achieved, this is, the object displays and I can click on it (and have a desired event), but the object does not render well as the MeshGeometryVisual3D.
See image. Blue glass was added with UIElement, while the red one with MeshGeometryVisual3D. The red one is ok - it is what I want to obtain, while the blue presents parts transparent. If I rotate the camera those parts turn solid, but others transparent. I do not believe that is a question of light as I tested several. The blue glass is half the size of the red one on propose.
In resume red glass is perfect, blue glass is defected.
Relevant WPF code:
<h:HelixViewport3D x:Name="view1">Demo2Element3D construction (Blue glass):
<h:SunLight/>
<h:GridLinesVisual3D Center="6 0 -0.5" Fill="Gray" Visible="True"/>
<local:Demo2Element3D></local:Demo2Element3D>
<h:MeshGeometryVisual3D Transform="{h:Translate -5,0,0}" MeshGeometry="{Binding GlassGeometry}" Fill="Red" Visible="True"/>
</h:HelixViewport3D>
public class Demo2Element3D : UIElement3D {
public Demo2Element3D()
{
var gm = new GeometryModel3D();
var mb = new MeshBuilder();
var profile = new[] { new Point(0, 0), new Point(0, 0.4), new Point(0.06, 0.36), new Point(0.1, 0.1), new Point(0.34, 0.1), new Point(0.4, 0.14), new Point(0.5, 0.5), new Point(0.7, 0.56), new Point(1, 0.46) };
mb.AddRevolvedGeometry(profile, null, new Point3D(0, 0, 0), new Vector3D(0, 0, 1), 200);
gm.Geometry = mb.ToMesh();
gm.Material = Materials.Blue;
Visual3DModel = gm;
}
Red glass:
public MeshGeometry3D GlassGeometry {
get
{
var builder = new MeshBuilder(true, true);
var profile = new[] { new Point(0 * 2, 0.4 * 2), new Point(0.06 * 2, 0.36 * 2), new Point(0.1 * 2, 0.1 * 2), new Point(0.34 * 2, 0.1 * 2), new Point(0.4 * 2, 0.14 * 2), new Point(0.5 * 2, 0.5 * 2), new Point(0.7 * 2, 0.56 * 2), new Point(1 * 2, 0.46 * 2) };
builder.AddRevolvedGeometry(profile, null, new Point3D(0, 0, 0), new Vector3D(0, 0, 1), 100);
return builder.ToMesh(true);
}
}
Any information is helpful as I am very new to Helix and even to WPF.
Thank you
Customer support service by UserEcho
I have read many blogs. This blog is the best I have ever come across. Thanks for creating this blog.
ป๊อกเด้งออนไลน์
สมัครเล่นไพ่ป๊อกเด้งบนมือถือ
https://fcmi-o.com/register-pokdeang-ufabet/