Why can't I get 3dTools to work?

Mar 10, 2009 at 9:49 PM
Edited Mar 11, 2009 at 3:24 AM
This site


implies that 3.5 contains some "new to me" 3d support.  Not sure if that is WPF 3.5 or .Net 3.5, but anyway, I created a C# WPF application in VS Express and replaced the window code with what is in the article. I changed all the goofy quotes in the article with regular double quotes.

But I still get errors.  On this line (amongst other lines that cause errors)

            <MeshGeometry3D x:Key="uiMesh" TriangleIndices="0,1,2 3,4,5″
                            Positions="-1,-1,2 1,-1,2 1,1,2 1,1,2 -1,1,2 -1,-1,2"

TriangleIndices shows up in red which I think means it recognizes it, but Positions is in blue and the error message is:

Error    1    'Name cannot begin with the '-' character, hexadecimal value 0x2D. Line 9, position 44.' XML is not valid.    C:\Users\mtiede\AppData\Local\Temporary Projects\WpfApplication1\Window1.xaml    9    44    WpfApplication1

What am I missing?  Is there some assembly I need to be adding to something or what?

Mar 11, 2009 at 7:39 AM
It looks like you didn't change the ending quote of TriangleIndices, so everything up to the start of the Positions value is considered TriangleIndices data. That would explain the error you are seeing.
Mar 11, 2009 at 3:48 PM
Edited Mar 11, 2009 at 6:17 PM

   You were right.  Don't know why the ReplaceAll didn't catch that.  And I tried it at 2 different times and both times it missed that one.  Odd.  So now I'm past that.  Got the app to work.

   Of course, now I just have more questions.  I'm confused if and how I should use the 3dtools.  Apparently at least some of this stuff is now in .Net 3.5?  But BackMaterial, for instance, is not in the framework yet. 

   So I downloaded the tools.  What do I do with them?  Do I just add a reference to the assembly(ies)?  Does what is in the tools somehow override what is in the framework?

   The main thing I am trying to figure out how to do is take some WPF shapes and put them on the surface of a spinning sphere.  Apparently the spinning sphere example that I have working doesn't use the new 3.5 stuff.  I'm not sure how to integrate or convert from the example that uses ModelVisual3D into Viewport2DVisual3D (either framework one or tools one).

   Any help there?

   Apparently that sample had comments that were like <!  >  and not <!-- --> .  I assume the comment was the style used in some previous version and now the new version has a different syntax.  Is that right?