How to move the camera in XNA only after few moments? [closed] - c#

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
I made the camera position 10 units from an object, but not behind it. I dont want the camera position behind the object right away when it rotates, I want that when I will rotate the object, the camera position will move slowly until it will be behind the object.

Check out the Camera Sample in XNA App Hub: http://create.msdn.com/en-US/education/catalog/sample/chasecamera
It basically does what you describe: it's a chase camera that lags behind the object and follows it using a "spring like" behavior.
From the overview: "The motion of both the ship and the camera are governed by simple physics. When the ship speeds away, the camera pulls back. When the ship turns, the camera lags behind in the turn to show a partial profile view of the ship. When the ship stops moving, the camera gradually slides back into place"

Related

Detect head tilt in a image [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
I am suppose to detect if there is a head tilt in photos. These photos are identity card size photos or passport size photos. If a head tilt is detected, then I need to correct / rectify the tilt error by rotating the image clockwise or anticlockwise.
I want to know if there is any open source library or dll that can be used in the project that will help me detect face & facial features like eyes and ears.
The detection must be done on the fly as there will be a 1000's of images opened from a directory.
I've gone through http://www.codeproject.com/Articles/462527/Camera-Face-Detection-in-Csharp-Using-Emgu-CV-Open tutorial, but did not solve my problem. Also I've gone through EmguCV's eg. Example.FaceDetection.exe in the bin folder, but it does not detect the face. I tried loading other images as well, but still the same & no highlighting of face or facial features.
Use a library for face detection, look at the height of the eyes and establish the tilt of the face. If the angle is within +/-5 degrees of horizontal, apply the rotation to the image by drawing the image to a new new image with a rotation.
Face detection in C# example (easily converted to VB.NET) http://www.codeproject.com/Articles/462527/Camera-Face-Detection-in-Csharp-Using-Emgu-CV-Open
Note: it is assumed that you have pictures of people looking straight into the camera, such as passport photos, that you want to straighten. For a photo where a person is looking slightly sideways, the angle of the camera will make the eyes be non level even if the persons head is not tilted.

XNA Game Programming: Spawn enemies in a circle [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
Could someone please give me some direction on how to spawn enemies in a circle (XNA Programming)?
I want the enemies to randomly spawn along the circumference of a circle that is just outside the bounds of the window. I want them to move in straight lines through the center of the window and out to the opposite side of where they started (or as close to that as possible).
Ideally this would create an environment where enemies are randomly coming across from seemingly all directions. Any help would be appreciated.
Just generate a random number between 0 and 360 (or 0 and 2π if it uses radians), and use trigonometry based on the radius of the circle you want.

Multi Bullet Shot Xna [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I previously posted on this and showed my code for getting an explosion of bullets
going in a number of directions all at one time.
I was just wondering if someone could give me a clean example that I can go off of.
My idea was to have my left click make the player throw a grenade and when it collides with an enemy it explodes and bullets come out of every direction.
sorry for the double post,
thanks.
if(whatever the collision code is for xna again)
{
bullets.add(new bullet(startpos, direction))
}
if you expand that... bullets is whatever your using to manage your bullets, bullet is your newly created particle with a start position being where your collision took place, the direction will be a direction that your bullet should travel in (1 for north,ne,east,se,south,sw, west, nw) or whatever yo uwant

how to slide image with finger touch in wp7 [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I am developing an windows phone 7 with silverlight application in which i want to slide images with finger touch, can any one help me how to do that
You need to subscribe to the ManipulationDelta event, which sends you information about the changes made by a touch event. e.g:
<Image ManipulationDelta="abc_ManipulationDelta" Height="100" Width="100" Name="abc" Source="smiley.jpg" Stretch="Fill"/>
Now, your event handler should be something like:
private void abc_ManipulationDelta(object sender, ManipulationDeltaEventArgs e)
{
abc.Margin = new Thickness(abc.Margin.Left +e.DeltaManipulation.Translation.X,
abc.Margin.Top + e.DeltaManipulation.Translation.Y,
abc.Margin.Right, abc.Margin.Bottom);
}
The e.DeltaManipulation.Translate informs us about the amount of shift the touch gesture had in X and Y directions. I've altered the Margins of the image control by that amount. If there is a downward drag the Translate.Y is +ve i.e, the Top Margin is increased, the opposite happens in upward drag.
You can use more complex margin alterations to produce better drag effects, but this answer gives you basic idea about the technique.

What is the logic behind game coding, moving graphics simultaneously? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
I was reviewing a code from a simple PONG game code in c#, the logic as far as I could understand was reading a key press (UP and Down) in a infinte loop and update the position of the ball and bar each n milliseconds one after another.
I want to know how to draw objects on a graphic box simultaneously?
I am just interested in making simple games using a imagebox and simple graohics.
If you want to make really simple games like Tetris or other puzzle-like, you could simply drop the "infinite loop" part. I've seen plenty of simple games built with Winforms/user controls/standard events (keypress/mousemove...).
If you plan to write something more complicated, then you probably want start learning XNA. Microsoft kindly provides useful starter kits.
You don't do it simultaneously, you do it in a loop but that loop happens so fast that a human cannot tell they are being updated one at a time.

Categories