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.

Newcomers DBPro Corner / problem with 'distance' code.. :(

Author
Message
David iz cool
19
Years of Service
User Offline
Joined: 21st Sep 2005
Location: somewhere lol :P
Posted: 7th Oct 2005 09:05 Edited at: 7th Oct 2005 09:08
hi,a little while back i posted asking for help with getting the distance between two objects.

someone gave some code.i thought it worked perfectly but turns out not.heres the code



the problem is-when moving the object toward the camera,the distance code doesnt seem to be working.

can someone help?
Maps
19
Years of Service
User Offline
Joined: 4th Oct 2005
Location: Paris
Posted: 7th Oct 2005 10:00
replace dz#=ey#-object position z(2) by
dz#=ez#-object position z(2) and it works nice


Tips : make a function "distance(obj1,obj2)"

put it a t the end of you main source or better in a separate #include
then you source will be more lighty and clear :
spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 7th Oct 2005 12:11
dz#=ez#-object position z(2)

Why are you creating another camera?

You are making DBPro work twice as hard because it is now rendering two windows where camera 1 is overlayed on top of camera 0

Boo!
David iz cool
19
Years of Service
User Offline
Joined: 21st Sep 2005
Location: somewhere lol :P
Posted: 7th Oct 2005 15:03
hahaah thank you spooky! for pointing out my spelling flaw.i see it now.


also for the tip on cameras,i thought the default camera was only to view objects if u dont set up a camera.
spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 7th Oct 2005 19:33
99% of all games only use the default camera. You only need to setup new cameras if doing split screen game or showing another view of your world somewhere.

Boo!

Login to post a reply

Server time is: 2024-11-13 21:07:18
Your offset time is: 2024-11-13 21:07:18