Coffeehouse Thread

1 post

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

How I can place Controls in Viewport3D?

Back to Forum: Coffeehouse
  • User profile image
    LIMIT

    I can not place, for example, Button in 3D to a stage, in Viewport3D, it turns out only:


    This Image

    code:

    <Window x:Class="MyContentIn3D.Window1"

        xmlns="http://schemas.microsoft.com/winfx/avalon/2005"

        xmlns:x="http://schemas.microsoft.com/winfx/xaml/2005"

        Title="MyContentIn3D"   

        > 

     

        <Grid>

          <Grid.RowDefinitions>

            <RowDefinition Height="25"/>

            <RowDefinition Height="*"/>

          </Grid.RowDefinitions>

     

          <DockPanel       

            Grid.Row="0">

           

              <Button

                Click="btn1_Click"

                DockPanel.Dock="Left"

                Content="Push!"/>

     

          </DockPanel>

     

          <Viewport3D

            Grid.Row="1">

     

            <Viewport3D.Camera>

              <PerspectiveCamera

                FarPlaneDistance="100"

                LookAtPoint="0,0,0"

                Up="0,1,0"

                NearPlaneDistance="1"

                Position="1,1,3"

                FieldOfView="60" />

            </Viewport3D.Camera>

     

            <Viewport3D.Models>

              <Model3DGroup >

                <AmbientLight Color="White" />

                <GeometryModel3D>

                 

                  <GeometryModel3D.Geometry>               

                    <MeshGeometry3D

                      TriangleIndices="0,1,2 3,4,5 6,7,8 9,10,11 12,13,14 15,16,17 18,19,20 21,22,23 24,25,26 27,28,29 30,31,32 33,34,35 "

                      Normals="0,0,-1 0,0,-1 0,0,-1 0,0,-1 0,0,-1 0,0,-1 0,0,1 0,0,1 0,0,1 0,0,1 0,0,1 0,0,1 0,-1,0 0,-1,0 0,-1,0 0,-1,0 0,-1,0 0,-1,0 1,0,0 1,0,0 1,0,0 1,0,0 1,0,0 1,0,0 0,1,0 0,1,0 0,1,0 0,1,0 0,1,0 0,1,0 -1,0,0 -1,0,0 -1,0,0 -1,0,0 -1,0,0 -1,0,0 "

                      TextureCoordinates="1,1 1,0 0,0 0,0 0,1 1,1 0,1 1,1 1,0 1,0 0,0 0,1 0,1 1,1 1,0 1,0 0,0 0,1 1,1 1,0 0,0 0,0 0,1 1,1 1,0 0,0 0,1 0,1 1,1 1,0 0,0 0,1 1,1 1,1 1,0 0,0 "

                      Positions="-0.5,-0.5,-0.5 -0.5,0.5,-0.5 0.5,0.5,-0.5 0.5,0.5,-0.5 0.5,-0.5,-0.5 -0.5,-0.5,-0.5 -0.5,-0.5,0.5 0.5,-0.5,0.5 0.5,0.5,0.5 0.5,0.5,0.5 -0.5,0.5,0.5 -0.5,-0.5,0.5 -0.5,-0.5,-0.5 0.5,-0.5,-0.5 0.5,-0.5,0.5 0.5,-0.5,0.5 -0.5,-0.5,0.5 -0.5,-0.5,-0.5 0.5,-0.5,-0.5 0.5,0.5,-0.5 0.5,0.5,0.5 0.5,0.5,0.5 0.5,-0.5,0.5 0.5,-0.5,-0.5 0.5,0.5,-0.5 -0.5,0.5,-0.5 -0.5,0.5,0.5 -0.5,0.5,0.5 0.5,0.5,0.5 0.5,0.5,-0.5 -0.5,0.5,-0.5 -0.5,-0.5,-0.5 -0.5,-0.5,0.5 -0.5,-0.5,0.5 -0.5,0.5,0.5 -0.5,0.5,-0.5 "/>

                  </GeometryModel3D.Geometry>

     

                  <GeometryModel3D.Material>

                    <DiffuseMaterial>

                      <DiffuseMaterial.Brush>

                        <VisualBrush>

                          <VisualBrush.Visual>                       

                              <Button

                                Width="200"

                                Height="100"

                                Content="Button1"/>                       

                          </VisualBrush.Visual>

                        </VisualBrush>

                      </DiffuseMaterial.Brush>

                    </DiffuseMaterial>

                  </GeometryModel3D.Material>

     

                </GeometryModel3D>

              </Model3DGroup>

            </Viewport3D.Models>

          </Viewport3D>

        </Grid>

    </Window>

    BUT! This all simply figure, the button is not interactive. We shall admit if I place in the same way TextBox, and in runtime I shall try to change its value (Text) nothing will occur, for some reason this контро even at task Name we do not see in a behind-file.
    I need to wait Sparkle?

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.