I need somebody to help me figure out how to get this code to make the camera work, where am I messing up at????
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using System.Runtime.InteropServices;
namespace WinFormsShowcase
{
class Program : CDarkGDK
{
static bool m_bKillMe = false;
[DllImport("user32.dll")]
private static extern bool ShowWindowAsync(int hWnd, int nCmdShow);
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
float fX = 0;
float fY = 0;
float fZ = 0;
float fA = 0;
frmMain oForm = new frmMain();
int hOldHwnd;
InitDarkGDK("30820120300d06092a864886f70d01010105000382010d00308201080282010100aa49091e489705899a1085ac00350ede62434a49341f02dafc8fc35f3857497c22510795172a0a1ff366dfe0be36fd034d79c99d15eb65359128cbe84f6228831742b34f53d628dbce88c13cb79a0932c18ce1eef1ace46a9964905fefa3743279bbc5d26a9d83acb655f01edc36d3e33460edadb1e94a5e6610a610f4fe2166d15352eb460f8c1eaa2acd02f0f4bdaa22892a23b83f0fcbfed841273e9c19fc870c8563a3fbe85ca5b8aff19459dd86b35b2aec8f2e54f1bb4bb02ce8f82f7e95e99d69dd4edd456125c293f8e8f8c2537eb2850dc638c2436cf628c2282dca7ae0be8555dc7892b6575dbc240228dc3958631bb5e2487210633393b65ed4b5020111");
oDBFile.SetDir("../../../../Media");
hOldHwnd = oDBDisplay.GetHWND();
oDBDisplay.OverrideHWND(oForm.ctlViewport.Handle.ToInt32());
oDBDisplay.SetDisplayMode(800, 600, 32);
ShowWindowAsync(hOldHwnd, 0);
oDBCamera.BackdropColor(oDB2D.RGBC(0, 0, 0));
oDBCamera.AutoCamOff();
// oDBCamera.PositionCamera(0, 500, -700);
// oDBCamera.PointCamera(0, 0, 0);
oForm.Show();
// Application.EnableVisualStyles();
//Application.SetCompatibleTextRenderingDefault(false);
//oDBImage.LoadImage("water.png", 1);
oDB3D.LoadObject("models/L13.x", 1);
oDB3D.MoveObjectUp(200, 20);
oDB3D.MoveObjectRight(1, 1200);
// oDB3D.SetShadowShadingOn(1);
// oDB3D.MakeObjectPlane(2, 300, 300);
oDB3D.MoveObjectDown(30, 50);
//oDB3D.RotateObject(2, -90, 0, 0);
//oDB3D.TextureObject(2, 1);
oDBLight.SetAmbientLight(100);
//oDBLight.PositionLight(0, 0, 300, 0);
//oDBLight.PointLight(0, 0, -1, 0);
while (oDBP.LoopGDK )
{
///////////////////////////////////////////////////////////////////
//This code is used to move through the world with.
///////////////////////////////////////////////////////////////////
oDBCamera.PositionCamera(50, 50, 50);
//set default values
float xAng, yang, zAng;
xAng = 0;
yang = 0;
zAng = 0;
for (;;)
{
if (oDBInput.UpKey() == 1)
{
xAng = oDBCore.WrapValue(xAng + 1);
oDBCore.Print("Press Space to show dialog.");
}
if (oDBInput.DownKey() == 1)
{
xAng = oDBCore.WrapValue(xAng - 1);
oDBCore.Print("Press Space to show dialog.");
}
if (oDBInput.RightKey() == 1)
{
yang = oDBCore.WrapValue(yang + 1);
oDBCore.Print("Press Space to show dialog.");
}
if (oDBInput.LeftKey() == 1)
{
yang = oDBCore.WrapValue(yang - 1);
oDBCore.Print("Press Space to show dialog.");
}
oDBCore.Sync();
oDBCore.Print("Press Space to show dialog.");
}
//rotate the camera
oDBCamera.RotateCamera(xAng, yang, zAng);
///////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////
///Get Scan Code for a certain key
//////////////////////////////////////////////////////////////////
//oDBCore.Print("Press Space to show dialog.");
///////////////////////////////////////////////////////////////////
oDBCore.Sync();
if (m_bKillMe)
break;
}
}
public static void KillMe()
{
m_bKillMe = true;
}
}
}
G4G