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.

DarkBASIC Discussion / 3rd person rotations

Author
Message
Hell IVIonkey
22
Years of Service
User Offline
Joined: 1st Apr 2003
Location: Outer Limits
Posted: 28th Jun 2003 12:25 Edited at: 28th Jun 2003 12:28
I can't figure this one out.

If given a pitch# and a yaw#, how can I reposition a camera r# units behind, say, the origin (0,0,0).

I played around with newxvalue(), newyvalue(), and newzvalue(), but found that they only really work with 2-dimensional rotations. I tried to consider what the correct zval should be given an x and y by using the sphere formula (3d distance formula) in the form of: z=[r^2-z^2-y^2]^(1/2), but nothing good came of it. It's because none of the values, x,y,z, are independent of eachother.

Any insights?

ReD_eYe
22
Years of Service
User Offline
Joined: 9th Mar 2003
Location: United Kingdom
Posted: 28th Jun 2003 12:54
not sure if this would help, i don't understand maths to well but this is a 3rd person camera demo type thing:


#for dbc
dunno if it'll be any use

hi guys
Hell IVIonkey
22
Years of Service
User Offline
Joined: 1st Apr 2003
Location: Outer Limits
Posted: 28th Jun 2003 13:20
Never mind, just solved the problem with a bit of 3d trig! Sorry to trouble...



Hell IVIonkey
22
Years of Service
User Offline
Joined: 1st Apr 2003
Location: Outer Limits
Posted: 28th Jun 2003 13:21
However, I did enjoy running around your nice field of cubes!

ReD_eYe
22
Years of Service
User Offline
Joined: 9th Mar 2003
Location: United Kingdom
Posted: 28th Jun 2003 13:41
yep that sure is fun

hi guys

Login to post a reply

Server time is: 2025-05-19 13:12:03
Your offset time is: 2025-05-19 13:12:03