Now i have elementhost setup i have tried converting Assimp sample (the one i actually need)
i have converted all the subs and classes but the ShowModel sub as one issue,
ContentVisual.Content = model3D
i assume this assigns the loaded model on a WPF form how do i get it to use my elementhost ? this is the code i have:
i have converted all the subs and classes but the ShowModel sub as one issue,
ContentVisual.Content = model3D
i assume this assigns the loaded model on a WPF form how do i get it to use my elementhost ? this is the code i have:
Code:
Private Sub ShowModel(ByVal model3D As Model3D, ByVal updateCamera As Boolean)
ContentVisual.Content = model3D
If Not Object.ReferenceEquals(model3D, Nothing) Then
Me.ContentWireframeVisual.BeginInit
Me.ContentWireframeVisual.ShowPolygonLines = Me.ReadPolygonIndicesCheckBox.IsChecked.GetValueOrDefault
Me.ContentWireframeVisual.OriginalModel = model3D
Me.ContentWireframeVisual.EndInit
If updateCamera Then
Dim bounds As Rect3D = model3D.Bounds
Dim pointd As New Point3D((bounds.X + (bounds.SizeX / 2)), (bounds.Y + (bounds.SizeY / 2)), (bounds.Z + (bounds.SizeZ / 2)))
Dim num As Double = Math.Sqrt((((bounds.SizeX * bounds.SizeX) + (bounds.SizeY * bounds.SizeY)) + (bounds.SizeZ * bounds.SizeZ)))
Me.Camera1.TargetPosition = pointd
Me.Camera1.Distance = (num * 2)
End If
Me.Camera1.ShowCameraLight = If(Not ModelUtils.HasAnyLight(model3D, True), ShowCameraLightType.Always, ShowCameraLightType.Never)
Me.ShowInfoButton.IsEnabled = True
End If
End Sub
Kevan Hampson

