how to display the joint angle on the main window - c#

I am new to C# programming and I am following the Kinect For Windows SDK from Channel9msdn and Microsoft Kinect Toolkit examples. My question is how do I obtain and display the joint angles for each joint?
Also, how do I display the coordinates of the joints?
I want to have these displayed when I am running the skeletal tracking.
Thanks in advance for any help.

A quick internet search...
How to calculate an angle from three points?
For displaying the text, you can either draw it directly to the display canvas or create one (or more) TextBlocks that you update the value of. I would probably suggest the TextBlocks, simply because they would be easier to work with.
Information on how to work with TextBlocks can be found in the MSDN development documentation, and all around.

Related

Vertically Stacked Y-Axis Step Line in Live Charts WPF

I've been using Winforms and the built in Charting library to accomplish this task in a hacky sort of way, but the team I'm developing for wants a more interactive solution. I wish I was able to just stack several charts, but as the graph is representative of a digital timing diagram, they need to share the same x-axis. I'm looking at LiveCharts as a solution, but I can't figure out if it's possible to vertically stack the multiple y-axis items to achieve my end goal. Ideally, it would look like this:
It's very important that I maintain them as one chart so that they share the x-axis, and comparisons can be made within the same chart timing wise.
The data getting used is from a generated log file, and is not collected in real time. I would manually offset the data, but the user can choose the order in which the graphed lines are displayed, so I would have to go through the entire series and offset it each time the user moved it.
Perhaps livecharts is not the way to go here? It needs to be a free implementation of something, or SciCharts v2.2 (but I can't find archived documentation) as those are the only resources I currently have access to.
While your question doesn't specifically relate to SciChart, you have tagged it, so I have a suggestion for you.
There is a vertically stacked axis feature in SciChart WPF. This allows you to substitute the YAxis Container template for anything you want. In this example we use a UniformGrid. The result is as follows:
Several traces are on the same plot, but at different vertical positions. Each axis is stacked one over each other. They share the same XAxis and hence response to zooming, panning, tooltips as if they were one chart.
The source code to the above is on the Example Webpage. All the scichart WPF Examples source code is hosted on GitHub so if you click through to the above then scroll down to source and click 'View on Github' you can see how we have achieved this type of chart.
Disclosure to community: Im the tech lead on the SciChart project

Joint Tracking using Kinect SDK

I am trying to track several joints at the same time using the Kinect SDK and C# sample of code from the Channel9.msdn website. I am following the same example code they have there, but I am unable to have one of my image representations move. The two ellipses I have that represent the hands are able to track my movements, but the headImage that represents the head joint automatically moves to the top left corner of the window and doesn't move. If i change the joint to be tracked to be another joint, such as one of the ones represented by the ellipses (which I know is tracking), the headImage still goes to the top left corner of the window. How is it I can track the hand joints using the ellipses, which follow my movements, but the headImage image does not move no matter what joint I set it to?
Update: It seems that when I remove the image object from the .xaml window and replace it with another ellipse object, all the ellipses start moving, which means the ellipse representing the joint that did not move before, is moving and is able to track. It must be a problem with using that particular image object (it is the head image that is the same chosen for the Channel9.msdn tutorial).
In the official Microsoft Kinect for Windows SDK v1.6 Toolkit examples, have a look at the SkeletonBasics project. It shows you have to track the entire skeleton and draw each of the joints, along with connecting lines. Just remove what you don't want.
I sugest look at the Toolkit examples mentioned by #Evil Closet Monkey and perhaps look to the examples provided with kinect.toolbox (Kinect Toolbox page) the examples provided here, are too simple and good.

How to create an interactive Map using Images

I have a couple of images that I would like to create an interactive map of in Silverlight and WPF. The pictures are of States and counties. I tried doing some search on how this is done but have not been able to find a good example on how to go about accomplishing this. So I would appreciate your help. Thanks in advance.
I was involved in creating a Xaml World map from scratch (below) and that alone took nearly a day for a stylised polygon version (no fine detail)....
I have since purchased a Wacom Bamboo tablet & stylus and found that to be about 5 times faster to work with compared with a mouse.
Quoting myself: "You import a map as a background image and use the pen tool to dot-to-dot trace around the country. Combine all those path segments into a single path. Then create a separate poly-path for each state (close them to allow for a fill)."
Once you create them you can name the individual country polygons and connect up mouse logic to make them all glow on mouse over or change colour on press etc.
Basically all the other stuff on that screen are user controls and custom controls. Work out the behaviour you want and create controls to suit your own needs.
In your instance you can use less accurate polygons as they will only be for hit-testing and highlighting and you will want to retain the actual map images under the polygons.

Render Tube and resize, dynamically add text

What I am looking to do in my Windows Forms application (or even WPF). Is to dynamically render an image of a tube, or cylinder (with a 3d look or having some sort of depth for a better visual experience), setting the length and hieght and so on, (also need rulers and such to zoom in and out). But then allow the user to enter some text, which will then be placed on that tube or cylinder, for display purposes, able to scale the text size, to create a visual representation of what it would look like IRL.
Any ideas on where I can start, or some examples I can build off of? This vector type display is new to me, so any help would be appreciated.
This article looked interesting. I would imagine you could tweak it to do what you were after.
http://kindohm.com/technical/WPF3DTutorial.htm
Also I googled "WPF 3D drawing".
If you have the choice WPF is better suited for graphics than WinForms out of the box. Though a good programmer can make WinForms do similar.

WPF Card Design

How can I design an application that contains a card that can be flipped and have content on both side?
The card is something like a post card which has images on 1 side and then the messages on another side. It should be able to be rotated smoothly as well.
The download site has moved around and there doesn't seem to be a documentation page for it anymore, but I think the Bag of Tricks still includes a FlipTile3D control that lets you define both sides of a tile, and lets you flip it over like a playing card.
If you want content on two sides, I recommend Josh Smith's ContentControl3D:
Introducing ContentControl3D
It does exactly what you want and includes a variety of configurable 3D transition effects.
There is also a detailed CodeProject article on the control:
Rotating WPF Content in 3D Space
Rotating from one content to another is a basic WPF/silverlight skill.
Here is a link to a blog post that shows how to rotate to display a cube. If you wanted to show only two faces, rotate 180 degrees instead of 90.
http://oldschooldotnet.blogspot.com/2009/11/how-to-create-your-own-silverlight-cube.html
just have a look at this post
http://www.interact-sw.co.uk/iangblog/2007/05/17/wpf-flippable-3D-list
You need to create the card as a 3d panel with the necessary controls on each side. I would recommend referencing this control as a starting point:
http://flipcontrol.codeplex.com/releases/view/22358

Categories