Donnerstag, 18. April 2013

Visual Basic 2012 WPF Drehwürfel mit einstellbaren Koordinaten programmieren von SelMcKenzie Selzer-McKenzie


Visual Basic 2012 WPF Drehwürfel mit einstellbaren Koordinaten programmieren von SelMcKenzie Selzer-McKenzie

Author D.Selzer-McKenzie



 

 

Heute zeige ich Ihnen, wie Sie einen drehenden 3D-Würfel mit einstellbaren Koordinaten bewegen und drehen können. Die Dreh-Koordinaten können je nach Wunsch nach oben, nach unten und auch seitwärts eingestellt werden.

Ebenfalls habe ich den Source Code abgefilmt, wenn Sie den abschreiben, müssten Sie das Video jeweils anhalten. Den kompletten Code finden Sie aber auch im Forum unter


Hier nun der komplette Source Code:

  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

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

 

   

     

     

        

         

            Storyboard.TargetName="SplineProgressTransform"

            Storyboard.TargetProperty="Y"

            Duration="0:0:5" AutoReverse="True" RepeatBehavior="Forever">

                       

           

              Value="0" KeySpline="0.0,0.0 0.0,0.0" KeyTime="100%"/>

         

         

         

            Storyboard.TargetName="TimeProgressTransform"

            Storyboard.TargetProperty="X"

            From="0" To="100" Duration="0:0:5"

            AutoReverse="True" RepeatBehavior="Forever" />

 

           

            Storyboard.TargetName="myTranslateTransform3D"

            Storyboard.TargetProperty="OffsetX"

            AutoReverse="True" Duration="0:0:5" RepeatBehavior="Forever">

           

           

              Value="2.5" KeySpline="0.0,0.0 0.0,0.0" KeyTime="100%"/>

         
     
       

     

   

 

 

 

 

    Drehender Würfel mit Kompass von SelMcKenzie Selzer-McKenzie

   

     

        VerticalAlignment="Stretch" Height="500">

       

         

           

              

             

             

             

           

           

             

             

             

           

           

           

              Grid.Column="0" Grid.Row="0"

              Grid.ColumnSpan="2">Koordinatenpunkt 1

           

              Grid.Column="2" Grid.Row="0"

              Grid.ColumnSpan="2">Koordinatenpunkt 2

 

           

           

              Style="{StaticResource HorizontalSliderStyle}" 

              Name="SliderControlPoint1X"  ValueChanged="OnSliderChanged" />

           

           

              Style="{StaticResource HorizontalSliderStyle}" 

              Name="SliderControlPoint1Y" ValueChanged="OnSliderChanged" />

           

           

              Style="{StaticResource HorizontalSliderStyle}" 

              Name="SliderControlPoint2X" ValueChanged="OnSliderChanged" />

           

             
Value="0"
              Style="{StaticResource HorizontalSliderStyle}" 

              Name="SliderControlPoint2Y"

              ValueChanged="OnSliderChanged" />

 

         

         

           

             

             

           

           

             

             

             

           

           

              Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2"

              FontFamily="Courier New" Margin="0,0,0,10">

              Koordinaten="0.00,0.00 0.00,0.00"

           

           

              HorizontalAlignment="Left">

             

             

               

                  

                   

                     

                       

                         

                           

                             

                           

                         

                         

                           

                             

                               

                                 

                                   

                                     

                                        Point1="0,100" Point2="0,100" Point3="100,0" />

                                    

                                 

                               

                             

                           

                            

                             

                           

                         

                         

                           

                             

                               

                                  Center="0,100"

                                  RadiusX="2" RadiusY="2" />

                               

                                  Center="100,0"

                                  RadiusX="2" RadiusY="2" />

                             

                           

                           

                             

                           

                         

                          

                           

                             

                                x:Name="SplineControlPoint1Marker"

                                Center="0,100"

                                RadiusX="2" RadiusY="2" />

                           

                         

                         

                           

                             

                                x:Name="SplineControlPoint2Marker"

                                Center="0,100"

                                RadiusX="2" RadiusY="2" />

                            

                         

                         

                           

                             

                            

                           

                             

                               

                                 

                                    Center="0,0" RadiusX="2" RadiusY="2" />

                                 

                                 

                                 

                                   

                                 

                               

                               

                                 

                                   

                                 

                               

                             

                           

                         

                       

                      

                   

                 

               

             

           

           

              

               

             

              Bildrahmen Koordinaten (Ausgabe)

           

           

              Lineare Koordinaten (Eingabe)

           

         

       

     

 

     

       

         

         

           

             

               

                  FarPlaneDistance="15" LookDirection="0,0,-1" UpDirection="0,1,0" NearPlaneDistance="1" Position="0,0,6" FieldOfView="60" />

             

             

               

                 

               

                

                 

                   

                     

                       

                         

                       

                     

                     

                       

                         

                       

                     

                     

                        OffsetX="-2.5" OffsetY="0" OffsetZ="0" />

                   

                 

               

             

              

               

                 

                   

                   

                     

                        Storyboard.TargetName="myHorizontalRotation"

                        Storyboard.TargetProperty="Angle"

                        From="0" To="360"

                        Duration="0:0:10" RepeatBehavior="Forever"/>

                     

                        Storyboard.TargetName="myVerticalRotation"

                        Storyboard.TargetProperty="Angle"

                        From="0" To="360"

                        Duration="0:0:10" RepeatBehavior="Forever"/> 

                   

                 

               

             

           

         

       

     

   

 

Keine Kommentare:

Kommentar veröffentlichen

Hinweis: Nur ein Mitglied dieses Blogs kann Kommentare posten.