GLBasic forum

Main forum => GLBasic - en => Topic started by: djtoon on 2011-Sep-07

Title: cheak if object is visible on screen
Post by: djtoon on 2011-Sep-07
hi
im trying to chk if an object is visible on screen and not behinde other object witch hides it
any way to do this?
i tryed geting the 3d to 2d point and getting the pixel color from there but its very very slow
any ideas?
Title: Re: cheak if object is visible on screen
Post by: Kitty Hello on 2011-Sep-07
with X_WORLD2SCREEN you get a 2d-point and a "z" information. You can use z to determine if the point is behind the camera (negative).
Title: Re: cheak if object is visible on screen
Post by: djtoon on 2011-Sep-07
i mean if anoder object is obscuring the object
if a ball is behine a box and the box is hiding the shear
Title: Re: cheak if object is visible on screen
Post by: backslider on 2011-Sep-07
Maybe you should try it with the X_COLLISIONRAY command.

http://www.glbasic.com/xmlhelp.php?lang=en&id=155&action=view
Title: Re: cheak if object is visible on screen
Post by: Kitty Hello on 2011-Sep-07
usually occlusion culling takes more time than rendering the hidden objects. You can do that when you pack objects into large chunks and only render the chunks that are visible.