+3

AddExtrudedGeometry problem

MCv 7 years ago updated by nxymin10 1 year ago 203

Hi Everyone,

I'm trying to create a simple 3d object, extruded one out of 4 pairs of 2D coordinates. But what I'm getting - is a 2d object. I can't understand: it's a my mistake or something else is wrong?


Here is my xaml code:

<Grid>
        <helix:HelixViewport3D x:Name="view1" Background="LightBlue" IsHeadLightEnabled="True" >

            <helix:MeshGeometryVisual3D  MeshGeometry="{Binding GlassGeometry}" Fill="White"/>
        </helix:HelixViewport3D>
    </Grid>


And code behind method:

  public MeshGeometry3D GlassGeometry
        {
            get
            {
                var builder = new MeshBuilder(true, true);                 List<Point> pints2D = new List<Point>()
                {
                    new Point(-1, -1),
                    new Point(0, -1),
                    new Point(1, 1),
                    new Point(-1, 1)
                };
                Point3D sp = new Point3D(0, 0, 0);
                Point3D ep = new Point3D(0, 0, 1);

               builder.AddExtrudedGeometry(pints2D, new Vector3D(1,0, 0), sp, ep);

                return builder.ToMesh(true);
            }

What I'm expecting to see is just a cube(in this case). But in the future I would like to get something like this:

Image 107

But now my result looks like:

Image 108

Image 109

Or is it a possibility to create a 3d Object in code using 8 pairs of 3D coordinates?

Thank you in advance.

You seemed to have thought of everything in this topic! I will save your site and come back here real soon to read more informative post from you.

sa gaming

เล่นคาสิโนsa gamingเว็บไหนดี

เล่นคาสิโนสดsa gamingเว็บไหนดี

You seemed to have thought of everything in this topic! I will save your site and come back here real soon to read more informative post from you.

ebet

ทางเข้าเล่นคาสิโนebet

ทางเข้าเล่นคาสิโนออนไลน์ebet

These are great wise words from the voice of experience and talented person like you! Thank your for sharing all of this and more motivating us.

gold diamond gaming

ทางเข้าเล่นคาสิโนgold diamond gaming

ทางเข้าเล่นgdg casino

These are great wise words from the voice of experience and talented person like you! Thank your for sharing all of this and more motivating us.

ufabet

เว็บพนันufabetเว็บไหนดี

สมัครเว็บพนันufabetเว็บไหนดี

You seemed to have thought of everything in this topic! I will save your site and come back here real soon to read more informative post from you.

กำถั่ว

ทางเข้าเล่นกำถั่ว

ทางเข้าเล่นกำถั่วขั้นต่ำ 2 บาท

+1

I had the same propblem and solved this problem with method “AddExtrudedSegments”.You can refer to the usage of menhod "AddExtrudedSegments" in "SimpleDemo"(Source\Examples\WPF.SharpDX\SimpleDemo)

Thank you for blog. It’s perfact for me.

วีนัสคาสิโน