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 / Could someone explain the how FOV works please?

Author
Message
Hamish McHaggis
22
Years of Service
User Offline
Joined: 13th Dec 2002
Location: Modgnik Detinu
Posted: 30th Apr 2003 21:47
I need to work out a formula that finds a 3D point from the mouse position (I know it's been asked before) but I don't know how hard it would be.

I take it that I need to know how FOV works first, what the formula to work it out is and how each part works. I am just wanting to find a point on a plane.

Thanks.
Why the hell'd you ask me for crying out loud!?!

Athelon XP 1400 Plus - Nvidia Geforce MX400 - 256mb RAM
Hell IVIonkey
22
Years of Service
User Offline
Joined: 1st Apr 2003
Location: Outer Limits
Posted: 1st May 2003 01:12
Best way is to use collisions and very thin planes or projectiles.

If you want to do it the hard way, you can figure out the on-screen X and Y coords with these equations:

Screen_X = World_X / World_Z
Screen_Y = World_Y / World_Z

However, you'll need to play around with offsets to get them to display on the screen correctly. And rotation; don't even ask me. Also, this can bring up the problem of the fisheye effect. I don't wanna look further into this now, but there's a start.
indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 1st May 2003 07:01
Hamish McHaggis
22
Years of Service
User Offline
Joined: 13th Dec 2002
Location: Modgnik Detinu
Posted: 1st May 2003 19:04 Edited at: 1st May 2003 19:09
Cool, thanks both!

Umm, Indi, where is this tutorial? I can't find it on the website or in the db help files.

Why the hell'd you ask me for crying out loud!?!

Athelon XP 1400 Plus - Nvidia Geforce MX400 - 256mb RAM
indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 1st May 2003 19:23
its a pro tute but should have the same theory to dbc

http://www.darkbasicpro.com/tutorials.php

last tute

Hamish McHaggis
22
Years of Service
User Offline
Joined: 13th Dec 2002
Location: Modgnik Detinu
Posted: 1st May 2003 19:49
Thanks

Do you know what the d stands for in the formula in the bottom?

Why the hell'd you ask me for crying out loud!?!

Athelon XP 1400 Plus - Nvidia Geforce MX400 - 256mb RAM
Richard Davey
Retired Moderator
23
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 1st May 2003 20:57
distance

"Gentlemen, we are about to short-circuit the Universe!"
Hamish McHaggis
22
Years of Service
User Offline
Joined: 13th Dec 2002
Location: Modgnik Detinu
Posted: 1st May 2003 22:15
Sorry, I really don't know what it is the distance of, sorry !

Why the hell'd you ask me for crying out loud!?!

Athelon XP 1400 Plus - Nvidia Geforce MX400 - 256mb RAM
Hamish McHaggis
22
Years of Service
User Offline
Joined: 13th Dec 2002
Location: Modgnik Detinu
Posted: 2nd May 2003 00:43
I have been experimenting with the method I am thinking of. Can you tell me whether this bears any resemblence to the way the camera in DB works?

Thanks



Why the hell'd you ask me for crying out loud!?!

Athelon XP 1400 Plus - Nvidia Geforce MX400 - 256mb RAM

Login to post a reply

Server time is: 2025-05-18 15:38:50
Your offset time is: 2025-05-18 15:38:50