# sphere vs isometric frustum collision

This topic is 2448 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

So I'm in the process of developing a 3D Isometric game in c++ and opengl. I'm currently working on the lighting system. Basicly I have a max number of lights that can be viewable at one time, but the level has no bounds of how many lights can exist. So I need to filter out the lights that are not viewable.

some valuable information:

EVERY LIGHT IN THE SCENE IS A POINT LIGHT, so a sphere...

The camera frustum is ISOMETRIC 3D. Its positioned about 30 feet above the character, and rotated 45degrees down X and 135 degrees Y (this may change)

I have a function implemented that casts rays from each corner of the screen. For each ray I calculate the x and z value when the y value is 0.
this is because the game is 2.5 D, no terrain to worry about. Ground is always at y = 0

So with these 4 points I can figure out how much of the level is in view (how many ground tiles i have to draw)

Each light has a 3D position and a radius.

Using that information, how can I figure out which lights in the level are visible at a given time?

Any help is appreciated. Thanks!

##### Share on other sites
Iterate the lights and test the center of each sphere against the six planes of the frustum, to determine if it is inside the frustum. If so, the light is visible. If not, iterate the planes of the frustum and find the point on each plane that is nearest the light. Calculate the distance between that point and the center of the sphere. If it is less than the radius of the sphere, then the light is visible.

##### Share on other sites
How would one go about finding the 4 planes of the isometric 3D camera? The 4 planes being left, right, top bottom. Dont really care about near and far because its a 2.5 D isometric game so lights wont be above the camera or below the floor.

The camera data I have access to in my engine is the position, rotation, modelview matrix, projection matrix.

1. 1
2. 2
Rutin
21
3. 3
A4L
15
4. 4
5. 5

• 13
• 26
• 10
• 11
• 44
• ### Forum Statistics

• Total Topics
633741
• Total Posts
3013624
×