Selecting all visible elements in a circle

Started by
0 comments, last by timothyjlaird 10 years, 2 months ago

Hello all

I have the following situation:

6NEpi.png

My goal is to select all visible cubes (in one of the viewports) around a certain radius of the mouse. The first part of the problem is selecting all cubes in a cylinder around the mouse which is no big deal. The main problem is how to decide if a cube is visible or if its hidden by another cube in the circle. What would you think is the most efficient way to only select the visible cubes? For the orthographic projections ist pretty easy i just need to check if theres a block in direction of the camera with its depth smaller than the one querying. But for the perspectivic projection i fail to find a good way to check for that property.

Any help is greatly appreciated!

Greetings and thanks in advance

Plerion

Advertisement

What are your limitations? Is this WebGL?

Since you asked for *any* help...I just know of the older school solution of picking by making a separate frame buffer, giving each granular of geometry a unique color (in your case each cube), doing a render to that separate frame buffer, extracting all colors in the radius of your cylinder and that would tell you the cubes that were selected. I think that leaves with with a limit of 255^3 cubes per scene though...and performance would be shot to hell but it might technically work.

This topic is closed to new replies.

Advertisement