screen coordinates of 3d vertex

Aug 23, 2010 at 12:55 PM

Hi Einar, i'm working together with henrikvollesen  at Structural Vibrations Solutions.
And i have just been employeed to port there current wpf 3d implementation into
Silverlight by use of balders great 3d capabilities :-)

I have traversed the forum discussions trying to find a way to
get the screen coordinates from any arbitrary vertex.
but no luck here, but then i found af viewport method in the source
implementede by Dmitriy Kataskin:

viewport.Project(Vector source, Matrix world)

as of my current version i can't reference it though,
is this intended or is there a better way to get the 2d screen positions ?

thanks again for a great framework offering me a fun job.


Aug 23, 2010 at 1:42 PM

Hi and thanks,

in there is no method for doing it - you would need to pull down the latest source code and compile it yourself to get the Project method.
I will however rewrite that method to be a bit faster - resembling the one being used in the rendering pipeline.

I implemented a feature that was vital for Henrik; wireframe for materials - that is also not in - but in the latest source code. There is a lot of bug fixes and new features in the latest source code, so I'd recommend downloading it anyways.

You can build it by running the build.cmd file from command line by doing :

"build All"

In the drops folder you'll find the binaries afterwards.


Hope this helps. 

Aug 23, 2010 at 2:23 PM

Thank for the fast advise ..

It shure helps a lot..

that method should make it easy to position tooltips and labels on the silverlight canvas ..

Aug 23, 2010 at 3:48 PM

Might be worth mentioning; all nodes in Balder has a property called Tooltip. So if you want tooltips on your objects, you can just set this property.

It works like the TooltipService.Tooltip property

Sep 1, 2010 at 9:08 AM
Edited Sep 1, 2010 at 2:22 PM

had an issue with viewport.project method, but i used the wrong world matrix, as parameter, lol

after using the actualWorld everything works just fine :-)

Sep 1, 2010 at 5:54 PM
Would be interesting to know what kind of feature your making. Maybe it's something I could generalize and put inside Balder.
Sep 2, 2010 at 6:36 AM

i'm making text decoration for each node of 3d objects, with silverlight textblocks.

The textblock moves / positions relative to the 3d object. ex. if i rotate the object, the text decoration for node 1, is still

positioned next to node 1. Then i can use this to decorate nodes beloning to rendered arrows etc. and

thereby decorate and arrow with text.

currently this snippet of code works very fine for me:


private void LayoutRoot_MouseMove(object sender, MouseEventArgs e)
if (testList.Count != 0)
// runtimeVertex coordinates has been moved n scaled 

Vertex runtimeVertex = _geometryObject.FullDetailLevel.GetVertices()[_geometryObject.NodeList.FindIndexFromNode(testList[0].NodeNumber)];
Vector3D v = theGame.Viewport.Project(new Vector3D((float)runtimeVertex.X, (float)runtimeVertex.Y, (float)runtimeVertex.Z), _geometryObject.ActualWorld);
DrawTextBlok(v.X, v.Y);



Sep 2, 2010 at 6:40 PM

Now thats an interesting feature. 

What if we could do something in Xaml like so : 

     <Geometries:Content Position="0,0,0">
            <Border BorderThickness="2" BorderBrush="Black">
                 <TextBlock Text="Hello world"/>

  Most objects in Balder can have children - so having a type like this that would make it possible to place any arbitrary Silverlight content on top at a given Location, relative to its parent. The :Content control could also just be used directly in a Scene. It could even be transformed to scale according to its position in 3D.

Sep 3, 2010 at 7:09 AM

that would be a very nice feature if the Content.position property relates directly to a Vertex position, and thereby

making it possible for the content to dynamically position it self when vertex moves, ex. when object rotates.

But we really don't know if scalling the content is good or bad though.

maybe it just distracts the eye, instead of clarifying the whole model.

Sep 4, 2010 at 6:07 AM

It could be an option if it should scale or not. 

As for the Vertex position thing, that could be an attached property or something. I'll put this feature on the list, its a very cool one.

Sep 4, 2010 at 6:09 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.