When use the \"dbSetCartoonShadingOn\" command it make the sphere disappear. When I // it, it comes back, but not shaded right. I\'m using the images from the DBPro Basic3d1-Example. What am I doing wrong? As far as I can tell, the syntax is right. (also, I cant figure out how to turn all the lights out. dbSetAmbientLight doesn\'t seem to do the trick.)
// \"Main.cpp\"
#include \"DarkGDK.h\"
void DarkGDK ( void )
{
//SyncSetUp
dbAutoCamOff ();
dbSyncOn ( );
dbSyncRate ( 60 );
//From the first 3D example in DBPro
dbLoadImage ( \"edge.bmp\" , 1 );
dbLoadImage ( \"shade.bmp\" , 2 );
//What should be shaded (but really makes it invisalbe)
dbMakeObjectSphere ( 1000 ,50, 120 , 60);
dbSetCartoonShadingOn ( 1000 , 1 , 2 );
//What is visalbe if sphere 1000 isn\'t
dbMakeObjectCube (1, 20);
//Light and Sphere indicator
dbMakeObjectSphere ( 1001 , 5 );
dbMakeLight (1);
dbColorLight ( 1 , dbRGB (255,0,0));
int lightAngle = 0;
int lightDist = 50;
//Why doesn\'t this make everything pitch black?
dbSetAmbientLight ( 0 );
dbColorAmbientLight ( 0);
//Sets up the camera and points it
dbPositionCamera (50,50,50);
dbPointCamera ( 0,0,0);
//Camera Mover Angle and Distance
float cameraMoverAngle = 0;
int cameraDist = 100;
while ( LoopGDK ( ) )
{
// Light mover
dbPositionObject ( 1001 , lightDist * dbSIN (lightAngle) , 0 , lightDist * dbCOS (lightAngle));
dbPositionLight ( 1 , lightDist * dbSIN (lightAngle) , 0, lightDist * dbCOS (lightAngle));
if (lightAngle > 360)
{
lightAngle = 0;
}
lightAngle++;
//Shows Camera angle
dbSetCursor (0,0);
dbPrint ( \"Camera X\");
dbPrint (dbCameraPositionX ());
dbPrint ( \"Camera Y\");
dbPrint (dbCameraPositionY ());
dbPrint ( \"Camera Z\");
dbPrint (dbCameraPositionZ ());
dbSetCursor (0, 100);
//Tell controlls
dbText (0,100, \"Mouse to move the camera.\");
//Shows light location
dbSetCursor (200, 0);
dbPrint ( dbLightPositionX ( 1 ));
dbSetCursor (200, 12);
dbPrint ( dbLightPositionZ ( 1 ));
//Mouse Look and WASD
dbPositionMouse (200,200);
cameraMoverAngle = cameraMoverAngle - dbMouseMoveX ();
dbPositionCamera (cameraDist * dbSIN (cameraMoverAngle), 50, cameraDist * dbCOS (cameraMoverAngle));
if (cameraMoverAngle > 360)
{ cameraMoverAngle = 0; }
dbPointCamera ( 0,0,0);
dbSync ( );
}
return;
}