WPF??
Here is what Im doing:
Form code
Private Sub cmdLoad_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdLoad.Click
Try
cube.Delete()
Catch
End Try
cube = New DarkGDK.Basic3D.Object3D(txtModelPath.Text)
hscAngleX.Value = cube.AngleX
End Sub
Private Sub hscAngleX_ValueChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles hscAngleX.ValueChanged
cube.Rotate(hscAngleX.Value, cube.AngleY, cube.AngleZ)
lblAngleX.Text = hscAngleX.Value
End Sub
Private Sub hscCameraZ_ValueChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles hscCameraZ.ValueChanged
Camera.DefaultCamera.PositionCurrent(Camera.DefaultCamera.CurrentPositionX, Camera.DefaultCamera.CurrentPositionY, hscCameraZ.Value * -1)
lblCameraZ.Text = hscCameraZ.Value * -1
End Sub
Private Sub CtlDarkGDKViewport1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles CtlDarkGDKViewport1.MouseMove
If e.Button = Windows.Forms.MouseButtons.Left Then
cube.Rotate(e.X, 0, e.Y)
lblAngleX.Text = cube.AngleX
If CInt(lblAngleX.Text) < 360 Then
hscAngleX.Value = lblAngleX.Text
Else
hscAngleX.Value = 360
End If
End If
End Sub
My application.vb
' DarkGDK.NET Startup project
'
Imports DarkGDK
Imports DarkGDK.Camera
''' <summary>
''' Our main application class
''' </summary>
''' <remarks></remarks>
Public Class Application
''' <summary>
''' This is our main Game Loop. This subroutine is used for processing our
''' game events and processes during the lifetime of the application. The
''' subroutine will loop until LoopGDK returns false.
''' </summary>
''' <remarks></remarks>
Public Shared Sub GameLoop()
DarkGDK.Camera.DefaultCamera.ColorBackdrop(Color.BlueViolet)
DarkGDK.Camera.DefaultCamera.AutoCamOff()
While DarkGDK.Engine.LoopGDK()
DarkGDK.Core.Sync()
End While
End Sub
End Class
As you can see I have all the coding in the Form.
Niels Henriksen
www.tales-of-the-realms.com
if Microsoft can sell software with bugs, so can I.