Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / If i change position of the camera it also changes position of the object

Author
Message
jontepd
15
Years of Service
User Offline
Joined: 24th Feb 2009
Location: Sweden
Posted: 25th Feb 2009 10:48
I have a robot, and if you hover the mouse over the robot a small laser object will appear (just to test so it's working). However, if you move the camera around it totally messes up the boundaries so if you hover your mouse over the robot it will no longer display the laser (however, if you hover your mouse over some other place in the window it will display the laser because that's where the program thinks the robot is located). So, after i've moved the camera around, how do i make the program know that the position of the robot is different too?

Sharp Bullet
16
Years of Service
User Offline
Joined: 5th Feb 2008
Location: Pluto
Posted: 27th Feb 2009 20:43 Edited at: 27th Feb 2009 20:46
You can try

int myRobot = 1;
dbLoadObject( "robot.3DS", myRobot );

...

if ( dbPickObject( dbMouseX(), dbMouseY(), myRobot, myRobot ) == myRobot )
{
dbShowObject( 2 );
}
else
{
dbHideObject( 2 );
}

and for controlling camera you can use

dbControlCameraUsingArrowKeys( currentCamera, MoveSpeed, TurnSpeed);
or if you like to move to right or left just use

dbMoveCameraLeft( currentCamera, MoveSpeed )
dbMoveCameraRight( currentCamera, MoveSpeed )



First say to yourself what you would be; and then do what you have to do.
Hayer
18
Years of Service
User Offline
Joined: 4th Nov 2005
Location: Norway
Posted: 27th Feb 2009 21:38
LOL
Im rofl'ing.

dbAutoCamOff();



Keep it simple.
Questions? Mail me
jontepd
15
Years of Service
User Offline
Joined: 24th Feb 2009
Location: Sweden
Posted: 28th Feb 2009 01:04
Thanks sharpbullet, you're a lifesaver <3

Login to post a reply

Server time is: 2024-09-30 19:31:42
Your offset time is: 2024-09-30 19:31:42