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 / Enemies

Author
Message
xiva
15
Years of Service
User Offline
Joined: 16th Apr 2009
Location:
Posted: 27th May 2009 17:12
Hi can somebody tell me how i can use variables so that when the camera is at a certain distance from the object it will turn to face the camera.
Im new to c++ but was thinking that i could do something like


But as i said im new to this so HELP is appreciated. Emphasis on HELP

"Lifes like a box of chocolates, you never know which one you get" Forest Gump
Unless you read the leaflet, thats why hes so "different"
AlexI
19
Years of Service
User Offline
Joined: 31st Dec 2004
Location: UK
Posted: 27th May 2009 18:48 Edited at: 27th May 2009 18:49
Please search the forums & documentation next time

Distance formula: http://forum.thegamecreators.com/?m=forum_view&t=70128&b=22

Then use the dbPointObject function with the cameras positions

DannyE
15
Years of Service
User Offline
Joined: 10th May 2009
Location:
Posted: 28th May 2009 00:31
I belive this would find the position of the camera and object.

float fCamera = dbCameraPosition ( );
float fObject = dbObjectPosition ( 1 );
AlexI
19
Years of Service
User Offline
Joined: 31st Dec 2004
Location: UK
Posted: 28th May 2009 03:43 Edited at: 28th May 2009 03:43
NOPE

There is no such function as dbCameraPosition();

You need to use the distance formula with X,Y,Z coordinates.

Using the camera positions functions dbCameraPositionX(),dbCameraPositionY(),dbCameraPositionZ()

and the object ones

dbObjectPositionX(1),dbObjectPositionY(1),dbObjectPositionZ(1)

Login to post a reply

Server time is: 2024-10-01 03:35:27
Your offset time is: 2024-10-01 03:35:27