0

Best place to trigger element sorting when camera position changes

Anonymous 10 years ago 0
This discussion was imported from CodePlex

PhilDotC wrote at 2014-04-17 23:12:

Hi, I have several billboard elements which follow the camera. I need to sort these for transparency reasons whenever the camera moves. Is there an event I can use to achieve this by adding the appropriate code in the handler?

objo wrote at 2014-04-29 10:18:

What is transparent - the billboards or other objects in the scene?
Should the billboards be shown behind or in front of the other objects in the scene?
Can you create an example/demo?

PhilDotC wrote at 2014-04-29 13:02:

I have uploaded an example solution here:

Download demo solution zip file

If you pan around you will see that depending upon which direction you are looking from the transparency works or doesn't depending on which billboard is nearest the camera. I need to add code to sort the viewport contents depending on their distance from the camera but I am unsure where to hook this in. It would be nice if the was a camera position changed event or something like that or perhaps you can suggest a better solution.

objo wrote at 2014-05-05 15:03:

Thanks for creating the demo, now I understand :)
I created https://helixtoolkit.codeplex.com/workitem/10046