Hi all, I am battling with something so silly, can anyone tell me why my lights aint moving ?
#include "DarkSDK.h"
#define ACTOR 10
#define ORBIT_RADIUS_BLUE 4
#define ORBIT_RADIUS_RED 6
#define LIGHT_0 100
#define LIGHT_1 101
#define BLUE_LIGHT 1
#define RED_LIGHT 2
float yRot=0.0f;
float xRot=0.0f;
float xPosBlue=0.0f;
float zPosBlue=0.0f;
float yPosRed=0.0f;
float xPosRed=0.0f;
float angle=0.0f;
void DarkSDK(void)
{
dbSyncOn();
dbSyncRate(0);
dbAutoCamOff();
dbMakeObjectCube (ACTOR,4);
// blue light
dbMakeObjectSphere (LIGHT_0,1);
dbPositionObject(LIGHT_0,0,5,0);
dbMakeLight(BLUE_LIGHT);
dbSetPointLight(BLUE_LIGHT,0,5,0);
dbColorLight(BLUE_LIGHT,dbRGB(0,0,255));
dbShowLight(BLUE_LIGHT);
dbGhostObjectOn(LIGHT_0);
// red light
dbMakeObjectSphere (LIGHT_1,1);
dbPositionObject(LIGHT_1,0,5,0);
dbMakeLight(RED_LIGHT);
dbSetPointLight(RED_LIGHT,0,5,0);
dbColorLight(RED_LIGHT,dbRGB(255,0,0));
dbShowLight(RED_LIGHT);
dbGhostObjectOn(LIGHT_1);
dbHideLight(0);
dbPositionCamera(0,5,-10);
dbPointCamera(0,0,0);
while (LoopSDK())
{
angle=angle+0.03f;
if(dbEscapeKey())
return;
if(dbLeftKey()==1) dbWrapValue(yRot += 0.1f);
if(dbRightKey()==1) dbWrapValue(yRot -= 0.1f);
if(dbUpKey()==1) dbWrapValue(xRot += 0.1f);
if(dbDownKey()==1) dbWrapValue(xRot -= 0.1f);
dbYRotateObject(ACTOR,yRot);
dbXRotateObject(ACTOR,xRot);
xPosBlue = dbCos ( angle * 1.5f);
zPosBlue = dbSin ( angle * 1.5f);
xPosRed = dbCos ( angle * 1.5f);
yPosRed = dbSin ( angle * 1.5f);
dbPositionLight ( LIGHT_0, xPosBlue*ORBIT_RADIUS_BLUE, 1, zPosBlue*ORBIT_RADIUS_BLUE );
dbPositionObject ( LIGHT_0, xPosBlue*ORBIT_RADIUS_BLUE, 1, zPosBlue*ORBIT_RADIUS_BLUE );
dbPositionLight ( LIGHT_1, xPosRed*ORBIT_RADIUS_RED, yPosRed*ORBIT_RADIUS_RED ,1);
dbPositionObject ( LIGHT_1, xPosRed*ORBIT_RADIUS_RED, yPosRed*ORBIT_RADIUS_RED ,1);
dbSync();
}
}