Reframe all objects
#1
I've tried to reuse the examples given but im struggling', i want the user to select a button and reframe on all elemnts just incase they slide the 3d model of the screen i would like to reset it back to the original camera location

thanks

Madxae
Code:
<cameras:TargetPositionCamera Name="Camera1"
                                     TargetPosition="0 1000 0"
                                     Heading="150" Attitude="-25" Bank="0"
                                     Distance="250"
                                     ShowCameraLight="Always"
                                     TargetViewport3D="{Binding ElementName=MainViewport}"/>


Code:
//Adjustment factor = 20

private void FitIntoView()
       {
           Camera1.FitIntoView(ObjectsRootVisual3D.Children,
                               FitIntoViewType.CheckAllPositions,
                               false,
                               this._selectedAdjustmentFactor);

       }
I tried this, but i get od results
Code:
       private void Btn_FitAllIn_Click(object sender, RoutedEventArgs e)
       {
           
           Camera1.TargetPosition = new Point3D(0, 1000, 0);
           Camera1.Heading = 150;
           Camera1.Attitude = -25;
           Camera1.Bank = 0;
           Camera1.Distance = 250;

           //this.FitIntoView();
       }
#2
so this works to reset the camera to the original position but how do i guarantee that all objects are in the field of view?

Code:
       private void Btn_FitAllIn_Click(object sender, RoutedEventArgs e)
       {        
           Camera1.TargetPosition = new Point3D(0, 1000, 0);
           Camera1.Heading = 150;
           Camera1.Attitude = -25;
           Camera1.Bank = 0;
           Camera1.Distance = 250;

           Camera1.FitIntoView();
       }
  


Forum Jump:


Users browsing this thread:
1 Guest(s)