Ok thx that helped.
My function is working now, but everytime i press space my camera moves to (0,0,0).
Heres my code:
#include "DarkGDK.h"
void CreateSphere(int objects,float size, float posx, float posy, float posz)
{
dbMakeObjectSphere(objects,size,16,16);
if (objects>1)
dbPositionObject(objects,posx,posy,posz);
}
void DarkGDK ( void )
{
dbSyncOn ( );
dbSyncRate ( 60 );
int myColor=dbRGB( 0, 100,100);
dbBackdropOn();
dbColorBackdrop(myColor);
int objects=0;
float radius,size,posx,posy,posz;
while ( LoopGDK ( ) )
{
dbText(0,20,dbStr(dbScreenFPS()));
dbText(0,40,dbStr(objects));
dbText(0,60,dbStr(dbCameraPositionX(0)));
dbText(0,80,dbStr(dbCameraPositionZ(0)));
dbRotateObject(1,dbObjectAngleX(1)+0.3,dbObjectAngleY(1)+0.3,dbObjectAngleZ(1)+0.3);
dbControlCameraUsingArrowKeys(0,0.5,1);
dbSync ( );
if (dbSpaceKey())
{
CreateSphere(objects,dbRnd(3),dbRnd(10),dbRnd(10),dbRnd(10));
objects+=1;
}
}
return;
}