The GDK.NET samples is working fine. I was making spinning cube in LightEngine... working..
Suddenly my program dont work?
I only have this
Imports CDarkGDK
Imports System.Drawing
Imports LightOrb.LightEngine
Imports LightOrb.LightEngine.Basic3D
Imports LightOrb.LightEngine.IO
Module Module1
Public oDarkGDK As New CDarkGDK("The Very Long Secret Code")
Public Matr2 As New LightMatrix(750, 750, 75, 75)
Public Obj1 As New LightBox(1, 3, 1)
Public Obj2 As New LightSphere(0.5)
Public Speed As Double = 0.25
Public Orbit_Amount As Double = 0.0
Public Orbit_Distance As Double = 1.0
Sub Main()
LightDisplay.SetDisplayMode(1024, 768, 32)
LightDisplay.SetWindowPosition(300, 100)
Obj1.Position(10, 1.5, 10)
While oDBP.LoopGDK()
MovePlayer()
OrbitObject()
LightCore.Sync() <-- here it breaks
End While
End Sub
Sub MovePlayer()
''Player Controls
Speed = 0.25
If LightKeyboard.State(LightKeys.ShiftRight) Then Speed = 1
If LightKeyboard.State(LightKeys.W) Then Obj1.Move(Speed)
If LightKeyboard.State(LightKeys.A) Then Obj1.YRotate(Obj1.AngleY - 1)
If LightKeyboard.State(LightKeys.D) Then Obj1.YRotate(Obj1.AngleY + 1)
If LightKeyboard.State(LightKeys.S) Then Obj1.Move(-Speed)
If LightKeyboard.State(LightKeys.R) And Orbit_Distance < 3 Then Orbit_Distance = Orbit_Distance + 0.1
If LightKeyboard.State(LightKeys.T) And Orbit_Distance > 1 Then Orbit_Distance = Orbit_Distance - 0.1
LightCamera.Position(Obj1.X, Obj1.Y + 3, Obj1.Z)
LightCamera.Move(-8)
LightCamera.AngleY = Obj1.AngleY
End Sub
Sub OrbitObject()
'orbit object around player
Dim posX As Double = Obj1.X + Orbit_Distance * System.Math.Sin(Orbit_Amount)
Dim posZ As Double = Obj1.Z + Orbit_Distance * System.Math.Cos(Orbit_Amount)
Orbit_Amount = Orbit_Amount + 0.1
Obj2.Position(posX, 2, posZ)
End Sub
Niels Henriksen
www.tales-of-the-realms.com
if Microsoft can sell software with bugs, so can I.