Using Viewport.Project()

Nov 24, 2010 at 5:53 PM


i'm trying to create a billboarding system.

To achieve that, i'm using the Viewport.Project() method to compute screen node position (actually i'm using Node.ActualBoundingSphere.Center position).

What is the matrix parameter ? For the moment, i'm using Matrix.Identity but there is a big offset.

Thanks a lot !

Nov 24, 2010 at 6:37 PM

Have you looked at Sprite?  It basically is a billboarding system - 2D surfaces in 3D.


Sprite is an object like anything else and you can just place it in 3D.

Nov 24, 2010 at 6:41 PM

Sprite class looks good, but i want to put any XAML content (UserControl) inside my billboard.

Can you explain me how to use Viewport.Project() method please ?

Nov 25, 2010 at 6:23 AM

I'd recommend you take a look at the Render method inside Sprite, then you'll get an idea of how you can do it. 

Also, the BeforeRendering() for the complete picture of billboarding as well. 


Nov 26, 2010 at 11:24 AM


i will take a look at these methods :)

Nov 29, 2010 at 7:53 AM

the discussion : "screen coordinates of 3d vertex" might help too

Nov 29, 2010 at 10:08 AM

Problem resolved !

I forgot to Transform the bounding sphere's center with the rendering world matrix !

Anyway, thank you for your help !