Locking the "Trackball" to the mouse movement ?

Topics: User Forum
Jan 8, 2007 at 1:49 AM
Hi, first off I'm a designer not a dev.

I have managed to strip down the "2D on 3D code" and add animation frames from 3D studio max, with the use of ZAM 3D and got it all to work with in Expression Blend. In result i have the foundation to build some cool new rich concept designs.

But the "Trackball" code is beyond my knowledge.I'm after, the ability to lock the "Trackball" to the mouse movement rather than clicking the left mouse button do rotate the view. I do relies this will cause a stop of movement when the cursor is over the dynamic elements (text box). However that is not a problem.

Any Ideas?
Coordinator
Jan 9, 2007 at 8:47 AM
How much C# experience do you have?

The behavior you want is possible, but it requires some code modifications to the TrackballDecorator class. Essentially you just need to remove the requirement that the TrackballDecorator have mouse capture for the trackball to take effect. So OnMouseDown/Up are no longer needed. Then in OnMouseMove, regardless of whether there is capture, you just always have the code work. The only other thing you'll then need to do is have some logic in OnMouseMove to set the previous position for the first time (since before this happened in OnMouseDown).
Jan 11, 2007 at 12:14 AM
Ha, I can understand exactly what you’re saying, but my C# knowledge is not up to it. Maybe I’m jumping the gun here. I’m using blend with the existing 2D on 3D code and getting some amazing results, but this is still quite a challenge for a designer. I will take the time to obtain some skill in C#, do you know of any good places to start?

Is 3D Tools going to be part of the WPF/E Player (if I can call it that) or is there already a way of running the 3D Tools library online?

I have so many questions, is it ok to fire them all at you?

Also some amazing work you guys are doing here, can’t wait to see what you come up with next.

John
Coordinator
Feb 15, 2007 at 3:18 AM
Sorry for the delayed reply - I somehow missed your response.

For learning C#, I'd recommend just going to a local bookstore and checking out the books they have on C#. There probably will be a couple, and then just pick the one that looks like it'll be the most helpful for what you want to do.

3D Tools is just for WPF, but with an xbap you can run WPF within a browser. The WPF documentation should have info on how to create an xbap.

And definitely feel free to send any questions you have our way.
Mar 24, 2007 at 12:26 AM
Edited Mar 24, 2007 at 12:10 PM
Im back... !

I seem to have it working now, strange. Any way im going to post some WPF stuff up on my blog soon will drop you a web link.

// Message was //
I’m still learning C# it’s quite powerful, I really think this track ball is handy for making interfaces. Is there a way of making it work with camera animation’s or is there already a way that I’m not aware of?

John

Mar 25, 2007 at 12:40 AM
LoL, I was intending to use the trackball class as a freely movable camera. Just booted my app got it all working, when I rotated the camera around I realised it doesn’t have a perspective. When I moved the camera forward it seemed to just zoom in. Any way I need to build my own navigation system for this. Hope its ok to pick your brains, this is the post on msdn::

http://forums.microsoft.com/msdn/ShowPost.aspx?postid=1388785&siteid=1

JCRobinson