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 / Suggestions on faster way to acheive this...

Author
Message
Duncan
16
Years of Service
User Offline
Joined: 7th Jun 2008
Location:
Posted: 15th Dec 2008 05:18
I'm trying to get the coordinates of the position some X number of units in front of my camera.
Currently I'm using this:



Surely this isn't optimal. I found another thread in the DarkBasic forum with a similar idea and the suggestion involved using dbPickScreen and basically feeding it the center of the screen. My camera is always at (0,0,0) and using dbPickScreen I only seem to get a Z value of 10000 with X and Y remaining zero. It appears to me that dbPickScreen only returns values relative to your camera... so matter which way I turn the camera I get the same values using dbPickScreen(dbScreenWidth/2, dbScreenHeight/2, 10000), those values being 0,0,10000.

Any thoughts from those cleverer than myself?
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 15th Dec 2008 17:23


have you tried it like this, it seems to work.
code master
20
Years of Service
User Offline
Joined: 4th Dec 2003
Location: Illinois
Posted: 16th Dec 2008 21:17
I think that if you can get the orientation of the camera and store it in a vector, then multiply the vector by 1000, you'll have your new position.

Just make the vector with a length of one that originates at 0,0 and points in a specific direction. So make your vector point in the direction of the camera, and then multiply.

That's a really sketchy guess. So don't take my word for it.

Login to post a reply

Server time is: 2024-09-30 13:29:54
Your offset time is: 2024-09-30 13:29:54