i am having a problem positioning a sphere for a program i am working on. what i want is a sideways sphere (just the circle showing) in the center of the screen with the cam going around it. the way it is now the object is going around the cam and the cylinder is in the vertical position
// Dark GDK - The Game Creators - www.thegamecreators.com
// the wizard has created a very simple project that uses Dark GDK
// it contains the basic code for a GDK application
// whenever using Dark GDK you must ensure you include the header file
#include "DarkGDK.h"
// the main entry point for the application is this function
void DarkGDK ( void )
{
// turn on sync rate and set maximum rate to 60 fps
dbSyncOn ( );
dbSyncRate ( 60 );
float x = 20.0;
float y = 10.0;
float z = 20.0;
float angle = 0.0;
dbPositionCamera(x, y, z);
dbPointCamera(0.0, 0.0, 0.0);
float distance = sqrt(x*x + y*y + z*z);
dbMakeObjectCylinder ( 1 , 120 );
dbPositionObject ( 1 , 0 , 0 , 0 );
// our main loop
while ( LoopGDK ( ) )
{
dbYRotateObject ( 1 , 90.0 );
// move the camera forward to the origin
dbMoveCamera(distance);
// rotate the camera around the Y axis
dbYRotateCamera(angle);
// move the camera back away from the origin
dbMoveCamera(-distance);
// update our angle of rotation
angle = dbWrapValue(angle + 1.0);
// update the screen
dbSync ( );
}
// return back to windows
return;
}
Pimpin aint eazy