Xamarin - Panning and scaling the view of a graph - c#

I want to make a 2d coordinate graph where you can put coordinates on it. The graph can be zoomed in and out, and panned in all directions. I'm thinking of making the screen kind of like a camera, looking down on the graph. Simply moving the camera lets you see different parts of the graph. Is that possible to do? If so, how? Thanks!

Related

Draw 3D rectangle, that does something different for each of its side you click on

A client with a container shipping business wants me to create a WPF windows app. After a physical examination of a container, his employees will click on a 3d rectangle (which represents the physical metal container), to mark which side of it came in damaged. I will insert that information on an SQL table.
Now I have no problem with the SQL side of things but I am a super noob when it comes to WPF and I don't know how to draw a 3d rectangle like one in the picture attached where each of its sides call a different method when you click on it. any ideas or help is welcomed.
If the "rectangle" does not rotates, it should be simple enough to just use polygons to draw each side. This has a MouseDown event, to it should be fairly easy to just attach event handlers to the polygons for each side.
If you need to rotate the box you have a few options, but you probably need some basic knowledge about 3D graphics to use this effectivly. One is to create your own rotation matrix to rotate a 3D box, but do the drawing with 2D polygons. Another option would be to use wpf 3d classes to do the drawing, see also How to: Hit Test in a Viewport3D.

How To Apply Bounds in Unity For iOS devices

I've made an unity game for iOS devices. It has a game object(sphere) which moves by the force applied to it. But I want to limit the sphere within the screen bounds.
I've seen the unity reference to Bounds, but i don't know how apply it according to the iOS device screens. Please Help.
ThankYou.
Use Mathf.clamp to keep your movement within the screen size. This will be more efficient than using colliders on the edges of your screen. Just play around with your object until you get the right numbers to keep it on your screen. Of course if you plan to use iOS tablets etc you will need to be able to account for the change in your clamping area.
Here is a link to the Unity Documentation which actually includes an example of what you are trying to do.
http://docs.unity3d.com/Documentation/ScriptReference/Mathf.Clamp.html

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.

ideas to create a software where shows views of cubes?

I'm planning to draw these shapes in WPF. It's for an educational software.
What idea's do you have in how to implement these cubes and views?
I was planning at the beginning starting using canvas and draw, but I guess it will be become eternal. So I supposed if exists some library to help me drawing them?
The ability to draw 3D shapes (such as cubes) and render them from different angles is built right into WPF. From the look of your cubes, you're going to want an orthographic camera, rather than a perspective camera, because the lines composing your cubes are parallel.
You might also find the Petzold.Media3D library helpful, because it has objects like cubes built in (you don't have to write your own algorithms to build them).
Finally, you might this primer helpful in getting started with WPF 3D.
Once you have some idea of how to use 3D, it will just be a matter of putting cubes in your scene at the proper locations and positioning the cameras properly for viewing the cubes. You will probably want to keep reusing the same four camera positions: one for the "3D view", and one each for the top, side, and front views.
This should be a lot less work than trying to draw the cubes using 2D.

Silverlight Collision Detection when controls are in different canvasses/layers

For our game we have to create collision detection.
The problem is that the collided objects are in different canvasses/layers, which makes collision detection by pointlocation inpossible.
Does anyone have an idea how to solve this?
It's hard to give a great answer without some more information, but if all your layers are the same size then you can just roll your own collision detection. All you need to know is the locations and sizes of two things to be collision detected. Then you just test to see if one rectangle intersects with the other rectangle.
There is also a function that might be useful to use called TranslatePoint. This translates from one UIElements coordinates to another. So if you had a ball bouncing around in a smaller area of the screen with it's own local coordinate system, you could get the ball's coordinates relative to the entire screen with this function.
Can I suggest you try using the Farseer physics engine just to save yourself some pain?
http://farseerphysics.codeplex.com/
It's very good and is in use in some WP7 games already.
http://www.farseergames.com/
There's also some Blend behaviors and helpers to make using it even easier:
http://physicshelper.codeplex.com/

Categories