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 / Intersect Object ( dbIntersectObject ) : Speed and use with terrain.

Author
Message
Yellow Billy Cat
18
Years of Service
User Offline
Joined: 4th Apr 2006
Location:
Posted: 10th May 2006 06:56
I have a couple of questions about the performance (speed-wise, that is) of dbIntersectObject.

After searching the forums for a while, it seems a speed improvement was made to the DBPro version in 5.5. Has this propagated to the SDK?

It also seems that the performance of this function is directly related to the complexity of the object against which the intersection is being checked, which is reasonable, though unfortunate.

The question that I'm ultimately death spiraling into here is, has anyone used dbIntersectObject to determine if an object is behind terrain or if a vector intersects terrain before hitting an object?

I'm attempting to determine if on screen objects should be marked as detected targets, or if those objects are actually obstructed by the terrain or other objects. Using the terrain as the object results in FPS reductions of about 50%. Using other, less complex objects ( is the tank behind the cube?, for example ) results in no FPS loss.

dbIntersectObject does work perfectly in terms of allowing me to only mark as detected targets those on-screen objects that are not obscured, it's just slow. For me. Today.

Or am I just trying to solve this problem back asswards?

Any thoughts?
Barnski
18
Years of Service
User Offline
Joined: 26th Jan 2006
Location: Switzerland, Zurich
Posted: 10th May 2006 19:08
I think you can avoid using intersect object when you simply want to check the terrain / matrix.

If you are interested whether your object is visible from your position and not behind the terrain, then simply "think" a line from your position to the object, and check the ground heights at discrete points. if they are higher than the "line of sight" at this position, the object is hidden. If you manage to reach the object then it is visible. Using the bresenham algorithm for calculating lines using discrete points you will get a pritty fast result I think.

Have a try!

Yellow Billy Cat
18
Years of Service
User Offline
Joined: 4th Apr 2006
Location:
Posted: 10th May 2006 20:25
Checking the height is indeed the way to go!

I'm currently checking 3 targets against the terrain with no drop in
FPS.

Thanks for the help!

Login to post a reply

Server time is: 2024-11-19 06:34:17
Your offset time is: 2024-11-19 06:34:17