The problem seems to be the height of the cube against the base :
#include "DarkSDK.h"
void DarkSDK(void)
{
dbSyncOn();
dbSyncRate(60);
dbAutoCamOff();
dbMakeObjectBox(1,400,5,400);
//dbMakeObjectCube(1,10);
//dbScaleObject(1,700,5,700);
dbMakeObjectCube(2,10);
dbColorObject(2,dbRgb(255,255,255));
//dbPositionObject(2,0,-3,5);
dbPositionObject(2,0,10,5);
dbPositionCamera(90,50,90);
dbPointCamera(0,0,0);
//dbSetGlobalShadowsOn();
dbSetShadowShadingOn ( 2 );
dbSetShadowShadingOn ( 1 );
dbSetPointLight(0,0,20,0);
//dbMakeLight(1);
//dbSetDirectionalLight (1, 0, -20, 5);
//dbPositionLight (1, 10, 100, 10);
//dbSetPointLight(1,0,20,0);
while(LoopSDK()){
dbSync();
if(dbEscapeKey())return;
dbControlCameraUsingArrowKeys ( 0, 5, 2 );
}
}
But
#include "DarkSDK.h"
void DarkSDK(void)
{
dbSyncOn();
dbSyncRate(60);
dbAutoCamOff();
dbMakeObjectBox(1,400,5,400);
//dbMakeObjectCube(1,10);
//dbScaleObject(1,700,5,700);
dbMakeObjectCube(2,10);
dbColorObject(2,dbRgb(255,255,255));
//dbPositionObject(2,0,-3,5);
dbPositionObject(2,0,40,5);
dbPositionCamera(90,50,90);
dbPointCamera(0,0,0);
//dbSetGlobalShadowsOn();
dbSetShadowShadingOn ( 2 );
dbSetShadowShadingOn ( 1 );
dbSetPointLight(0,0,20,0);
//dbMakeLight(1);
//dbSetDirectionalLight (1, 0, -20, 5);
//dbPositionLight (1, 10, 100, 10);
//dbSetPointLight(1,0,20,0);
while(LoopSDK()){
dbSync();
if(dbEscapeKey())return;
dbControlCameraUsingArrowKeys ( 0, 5, 2 );
}
}
wont
A tidier version :
void DarkSDK(void)
{
dbSyncOn();
dbSyncRate(60);
dbAutoCamOff();
dbMakeObjectBox(1,400,5,400);
dbPositionObject(1,0.0,0.0,0.0);
dbColorObject(1,dbRgb(255,255,255));
dbMakeObjectCube(2,10);
dbColorObject(2,dbRgb(255,255,255));
dbPositionObject(2,0,20,5);
dbPositionCamera(90,90,90);
dbPointCamera(0,0,0);
dbSetGlobalShadowsOn();
dbSetShadowShadingOn ( 2 );
dbSetShadowShadingOn ( 1 );
dbMakeLight(1);
dbPositionLight (1, 10, 200, 10);
dbSetPointLight(0,0,20,0);
while(LoopSDK()){
dbSync();
if(dbEscapeKey())return;
dbControlCameraUsingArrowKeys ( 0, 5, 2 );
}
}
I'm not sure the shadow is displayed correctly though.
With the included picture, the small cube is where the light is (shinng downwards towards the object), whereby the shadow is in the opposite direction (remove all the references to light 1 in the above code).
In addition, surely the objects should be in shades on white (instead of grey - due to lighting).