DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   C++ (http://www.daniweb.com/forums/forum8.html)
-   -   Disapearing objects! (http://www.daniweb.com/forums/thread167437.html)

tomtetlaw Jan 10th, 2009 3:36 am
Disapearing objects!
 
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 :)

Freaky_Chris Jan 10th, 2009 6:23 am
Re: Disapearing objects!
 
Just a stab, when you move do you redraw the gun? cause you will need to.

Chris

tomtetlaw Jan 11th, 2009 3:10 am
Re: Disapearing objects!
 
the gun is just in one place, doesnt move at all. but dont worry cuz i fixed it :D


All times are GMT -4. The time now is 7:12 am.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC