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.

AppGameKit Classic Chat / Determine if 3D object is currently on screen or visible by the camera

Author
Message
aviles22
10
Years of Service
User Offline
Joined: 1st Dec 2013
Location: New Jersey, USA
Posted: 7th Oct 2014 02:47
GetObjectInScreen does not work at all and I just can't figure out any other way to determine if a 3d object(.obj) is in the camera's view or on screen.
SoftMotion3D
AGK Developer
19
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 7th Oct 2014 03:21
yes its deffinetly a broken command...

i think paul is already aware of this and it will probably not be fixed for v1 at all and v2 will be waiting till the 3d stuff is worked on.

aviles22
10
Years of Service
User Offline
Joined: 1st Dec 2013
Location: New Jersey, USA
Posted: 7th Oct 2014 04:02
@ SoftMotion3D.

Your the 3d man here. You have any ideas to do this?
aviles22
10
Years of Service
User Offline
Joined: 1st Dec 2013
Location: New Jersey, USA
Posted: 7th Oct 2014 04:47
UPDATE:

Markus had a great solution with working code to a temporary fix for the broken GetObjectInScreen() until TGC fixes this:

http://forum.thegamecreators.com/?m=forum_view&t=212285&b=41

Thank You Markus!
SoftMotion3D
AGK Developer
19
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 7th Oct 2014 05:05
well i would have to do some tests as i have not run into this problem before. The time i did use GetScreenXFrom3D( x, y, z ) and that GetScreenYFrom3D( x, y, z ) it worked as my camera was an overhead view. It simply reported values that were off screen if they were not visible.

best solution i can think of is to point the camera at the object and then back to where its suppose to be and measure the angle difference. If its within ~90 deg + or - and your getscreeny,x from 3d reports actual values inside your virtual screen size then its probably on the screen. now thats not going to work if its on the screen but hiding behind an object.

I would do a raycast bounce possibly.

if i get a chance tomorrow i will do some tests for ya to see what method is best.

aviles22
10
Years of Service
User Offline
Joined: 1st Dec 2013
Location: New Jersey, USA
Posted: 7th Oct 2014 14:55
@ SoftMotion3D. Thank You

Login to post a reply

Server time is: 2024-11-25 10:43:50
Your offset time is: 2024-11-25 10:43:50