Track camera rotation

May 31, 2012 at 2:17 PM

This is a great project! Many thanks.

I have 3D labels that sit above the scene models. I want the labels to rotate when the camera is rotated so the labels always face the camera. This should occur as the rotation is taking place - not just at the end. Is there an easy way to accomplish this?

Coordinator
May 31, 2012 at 7:04 PM

See the "Billboard" and "Overlay" examples in the "Example browser". The billboard text has an issue when spinning the camera (this is not a problem with billboard images) - have not figured that one out yet. The "Overlay" example uses TextBlock elements over the 3D viewport - in some cases this can be the best way to show labels.

Jun 12, 2012 at 12:30 AM

Thanks! This worked well. There is one unexpected behavior that I saw that may be obvious to many but not to a novice like myself. It seems that the backgound material of the billboard cannot be set and it uses the material of most distant object in the Z plane. In many cases, when using this control as a label and not necessarily as a billboard you would want the text to show up with a transparent background. Adding this line to the example xaml after all the TextBillboardVisual3D objects are created will illustrate the problem.  <ht:BoxVisual3D Fill="Chocolate" Center="0,0,0" Length="20" Width="10" Height ="20"/> As you rotate the labels overtop of the box the white background of the view shows through. The only way I found to control this so the labels appear to have a transparent background is to ensure the labels are always added to the end of the visual tree. Perhaps there is a better way?