ok i want to make a socom and gears of war style camera, the initial camera would be the socom camera(which i'm almost done with) then when you left click to fire your gun, it switches to the Gears of war side camera(when you press a different button or right mouse click, it gets out of that)
heres what i have so far for the socom camera
// 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
float Max;
float XAngleCamera;
void DarkGDK ( void )
{
// turn on sync rate and set maximum rate to 60 fps
dbSyncOn ( );
dbSyncRate ( 60 );
//Make world Objects
dbLoadObject("gign.x",1);
dbPositionObject(1,0,0,0);
dbMakeMatrix(2,75,75,75,75);
dbScaleObject(1,13,13,13);
dbRotateObject(1,180,0,0);
//snow world
dbLoadObject("fy_snow.x",5);
dbPositionObject(5,0,0,0);
dbScaleObject(5,10,10,10);
//Makes the camera rotation mount above the player
dbMakeObjectSphere(3,1);
dbPositionObject(3,dbObjectPositionX(1)+180,dbObjectPositionY(1) + 2,dbObjectPositionZ(1));
dbScaleObject(3,.001,.001,.001);
//Camera Options
dbPositionCamera(dbObjectPositionX(3),dbObjectPositionY(3),dbObjectPositionZ(3));
dbSetCameraRange ( 1, 1000);
// our main loop
while ( LoopGDK ( ) )
{
//Camera Loop Options
//This Positions the camera so its always at the camera mount.
dbPositionCamera(dbObjectPositionX(3),dbObjectPositionY(3),dbObjectPositionZ(3));
//Positions The camera mount so its always above the player
dbPositionObject(3,dbObjectPositionX(1)+5,dbObjectPositionY(1) +10.8,dbObjectPositionZ(1));
//Makes float XAngleCamera always = the camera mount's X angle
XAngleCamera = dbObjectAngleX(3)+180;
//Makes float Max = the camera mount's object X angle + or minus mouse up and down movement.
Max = dbObjectAngleX(3) + dbMouseMoveY() / 2;
//Rotates the camera mount's X angle to equal Max
dbXRotateObject(3,Max);
//Sets the camera's X and Z angle to the same as the camera mount and sets it's Y angle to the same as the player.
dbRotateCamera(dbObjectAngleX(3),dbObjectAngleY(1),dbObjectAngleZ(3));
//Rotates the player model left and right based on the mouse
dbRotateObject( 1, 0, dbObjectAngleY(1) + dbMouseMoveX() / 2, dbObjectAngleZ(1) ) ;
//Sets the camera to always be behind the camera mount
dbMoveCamera( -15 );
//Hide The Mouse and has the mouse always at the middle of the screen
dbPositionMouse (dbScreenWidth() /2, dbScreenHeight() /2);
dbHideMouse ();
//Player Controls
if (dbKeyState(17)) // W Move Forward
dbMoveObject (1,.25);
if (dbKeyState(30)) // A straffe left
dbMoveObjectLeft(1,.25);
if (dbKeyState(32)) // D straffe Right
dbMoveObjectRight(1,.25);
if (dbKeyState(31)) // S Move Back
dbMoveObject(1,-.25);
// update the screen
dbSync ( );
}
// return back to windows
return;
}
only thing wrong with that code is that i cant get the player to turn around so his back is facing the camera. i could start on teh gears of war camera if i could figure out how to create a new camera, (dbCreateNewCamera; doesnt work, please help me with this project.
here is the socom style camera in use(when hes running n stuff); http://www.youtube.com/watch?v=ml0MJfVMKFo&feature=PlayList&p=FC041F8CC88A5EC1&index=0&playnext=1
here is the Gears of war camera(when hes shooting); http://www.youtube.com/watch?v=ykM8L2TDEo4