Lester's WPF\SL Blog

Simple, Easy & Beautiful

3.5 features: Viewport2DVisual3D

3.5 features: Viewport2DVisual3D

Rate This
  • Comments 9

Viewport2DVisual3D .... this new feature makes things a lot easier in the 3D world.. What this enables is putting interactive 2D on 3D.

 This makes things like having a textbox in 3D a breeze...

 <Viewport2DVisual3D x:Name="vp2d_multiple_children" Geometry="{StaticResource mesh}">

            <Viewport2DVisual3D.Material>

                        <DiffuseMaterial Viewport2DVisual3D.IsVisualHostMaterial="True" Brush="White"/>

            </Viewport2DVisual3D.Material>

            <TextBox />

  </Viewport2DVisual3D>

One other thing is mapping 3D points to 2D is so much more easier... Earlier on I had a post on mapping a mouseclick on a 3d model to a 2d coordinate. This involved using some barycentric coordinates and such... Now all you need is call e.GetPosition(relativeTo) in the mouse event handler... tada!!... your coordinates are ready...

so using this new stuff i created a simple app for keeping track of your travels.

right clicking on the globe puts a tag on the globe. Clicking on the red button deletes the tag. Clicking on the person opens a richtextbox so you could add some notes, tooltips and paste some pics in. Left click again sets the globe in motion. You can also drag the globe around just in case you visited the poles. Closing the app serializes the content - so that on startup the tags are remembered... :) ... The project uses 3DTools library for the trackball support

The project is attached.. have fun..

Also if you just need the binaries you can download the zip file and run the installable.

Share this post

 

Attachment: Photo Globe.zip
Page 1 of 1 (9 items)