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.

Author
Message
Pikapooh
21
Years of Service
User Offline
Joined: 25th Sep 2002
Location: United Kingdom
Posted: 25th Sep 2002 19:13
Hey, I dont suppose there is a function or method which will return the distance from object x to camera posistion?

this would make the game im making infinatly easier to acomplish, thanx
The Darthster
21
Years of Service
User Offline
Joined: 25th Sep 2002
Location: United Kingdom
Posted: 26th Sep 2002 01:17
You could always make your own.

distance = sqrt(((object position x(x)-camera position x(i))^2)+((object position y(x)-camera position y(i))^2)+((object position z(x)-camera position z(i))^2))

Where x is the object number and i is the camera number. It's Pythagorus' Theorem.

Pikapooh
21
Years of Service
User Offline
Joined: 25th Sep 2002
Location: United Kingdom
Posted: 26th Sep 2002 01:21
*duh* why didnt i think of that?

maybe bcoz i didnt attend maths class
Pikapooh
21
Years of Service
User Offline
Joined: 25th Sep 2002
Location: United Kingdom
Posted: 26th Sep 2002 01:22
btw thanx thatll be a gr8 help
The Darthster
21
Years of Service
User Offline
Joined: 25th Sep 2002
Location: United Kingdom
Posted: 26th Sep 2002 01:25
No problem. I think there might be quicker ways to do it using the 3d maths commands, but I haven't really tried them yet.

Login to post a reply

Server time is: 2024-04-25 08:01:55
Your offset time is: 2024-04-25 08:01:55