views:

378

answers:

3

How to create a interactive 3D object in WPF? For example it can be a 3D Cube which can be rotated and with "tap" gesture for each side triggering different action.

+1  A: 

Interactive 3D effects are certainly doable in WPF/Surface, although it'll take a bit of work. For example, have a look at the stuff here, especially the rolling globe about 1:50 into the first picture. The implementation shown is Surface, but that is largely WPF with some different input mechanisms... Unfortunately, he doesn't show the code...

Marc Gravell
+2  A: 

Take a look at the ViewPort3D class - it has a camera that you can rotate in 3d. Just hook up a MouseDown event handler and modify the camera position.

http://www.kindohm.com/technical/wpf3dtutorial.htm

James Cadd
Surface doesn't have a mousedown - it has touch events. Same idea, though - but you need to figure out what to do when you have 30 touches dragging the same object in different directions ;-p
Marc Gravell
Oh duh, i guess there's no mouse! Do the touch events come through the same mechanism as the Stylus (i.e. same as touch events in Windows 7)?
James Cadd
You can put a control(e.g. button) on each side of the cube as a texture and it will work as if you clicked on it, then you can simply implement ClickButton events.
sklitzz
A: 

Take a look at codeplex.com/3DTools. Wrap your ViewPort3D into Interactive3DDecorator.

modosansreves