Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


Selecting all visible elements in a circle


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 Plerion   Members   -  Reputation: 368

Like
0Likes
Like

Posted 07 February 2014 - 04:35 PM

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



Sponsor:

#2 timothyjlaird   Members   -  Reputation: 404

Like
0Likes
Like

Posted 07 February 2014 - 11:26 PM

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.


Edited by timothyjlaird, 07 February 2014 - 11:28 PM.





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS