Im on Windows XP pro.
im using DarkGDK engine.
I am making a FPS in a map that a tutorial provides.

T tell it to load my object and position it under the camera and when i run it i look down and i can see it, but if I move at all, the gun disapears!

heres my code:

#include "DarkGDK.h"

void DarkGDK ( void )
{
	dbSyncOn   ( );
	dbSyncRate ( 60 );
	SetCurrentDirectory ( "resources" );
	dbLoadObject		( "universe.dbo", 1 );
	dbSetObjectLight	( 1, 0 );

	dbLoadObject		( "skybox2.x", 2 );
	dbSetObjectLight	( 2, 0 );
	dbSetObjectTexture	( 2, 3, 2 );
	dbScaleObject		( 2, 5000, 5000, 5000 );

	dbLoadObject		( "mp5.x", 3 ); //this is the object
	dbPositionObject    ( 3, 434, 447, -517 );

	dbPositionCamera	( 434, 450, -517 );

	float fCameraAngleX = 0.0f;
	float fCameraAngleY = 0.0f;

	while ( LoopGDK ( ) )
	{
		dbHideMouse ( );

		dbControlCameraUsingArrowKeys ( 0, 5.0f, 0.3f );

		fCameraAngleX = dbWrapValue ( fCameraAngleX + dbMouseMoveY ( ) * 0.4f );
		fCameraAngleY = dbWrapValue ( fCameraAngleY + dbMouseMoveX ( ) * 0.4f );

		dbXRotateCamera ( fCameraAngleX );
		dbYRotateCamera ( fCameraAngleY );
		
		dbSync ( );
	}

	return;
}

any help would be appreciated, thanks in advance :)

Recommended Answers

All 2 Replies

Just a stab, when you move do you redraw the gun? cause you will need to.

Chris

the gun is just in one place, doesnt move at all. but dont worry cuz i fixed it :D

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.