Ray projection in XNA

Trying to implement the crosshair and shooting where cross-hair is looking at, here are some of my finds:


Animation Data structures in XNA framework

>> Root is the root (BoneContent type) of the given skeletan.

Root.Animations => (Animations is a property of type AnimationContentDictionary)

Animations: This property holds all the
animations associated with a model(for e.g. walking, running, jumping)
in AnimationContentDictionary.

AnimationContentDictionary : is a dictionary of

where name = name of the animation and AnimationContent is the animation data for that animation of the whole model

Thus, one AnimationContent describes a single animation (for e.g. walking).

AnimationContent (e.g. WALK):

It contains a collection of data channels. Also, it represents one complete animation for the model; which can be visualized with all the data channels working together.

AnimationContent.Channels => (Channels is a property of type AnimationChannelDictionary)

AnimationChannelDictionary : Dictionary of

where name = name of the object being animated by each channel.

AnimationChannel (e.g. Movement of right leg in WALKing animation= 1 AnimationChannel):

It is a collection of Keyframes describing the movement of a single object/bone.

class AnimationChannel : ICollection

Thus, I said AnimationChannel “is” made up of a bunch of AnimationKeyFrame.

AnimationKey:

It describes the position of AnimationChannel at a single point in
time, a.k.a, the position of the associated bone/object (from the
AnimationChannelDictionary.Key (string)).

It comprises of these members which completely describe the AnimationChannel:

Matrix Transform : Position/Orientation

TimeSpan Time: Time instant


meshes/bones in xna

- ” Whats the difference between a mesh and a bone ?”
- “what is a mesh and what is a bone ?”

@ Gamedev.net
@ Gamecareerguide.com

Response:

  1. Shawn Hargreaves Blog post (from the man himself! => this one is WOW, its all that you need to know)

3D Collision Detection

I see a lot of updates for my FAQ :D But all of these will have to wait for my semester to get over. Soon, it shall be over, ahem.

Aight, so what am I doing these days? I am trying to get a FPS prototype up and running with a new game mechanic I have in my head.

How far am I from it ? Very far! Though, for baby steps, I’ve learnt to
- 3D right handed Coordinate system, a special thanks to folks at gamecareerguide.com for that.
- load a model & display it.
- A First/Third person camera working.
- Strafing for the player (WASD) and looking around using mouse (rotation).
- Collision between world and objects (no gravity yet)

These days, I am trying to get a collision detection between a gun shot and a part of the body. Its just a bit tricky, since I have to extract the mesh part where the bullet would hit.

Also, I am pondering about the overall code architecture for the game. I really want to spend some time designing stuff, but time is what I don’t have :(

Anyways, I shall soon be posting about all my findings and struggles I faced on my way to making this prototype.


3D coordinate system & relative movement

I am trying to learn 3D game programming now (in XNA). Though, its really a math question..

(XNA follows the right hand coordinate system: From MSDN:

  The XNA Framework uses a right-handed coordinate system, with the positive z-axis pointing toward the observer when the positive x-axis is pointing to the right, and the positive y-axis is pointing up.

Ok, now in this tutorial at msdn, its about basic movement and displaying stuff. Before that, here are some positions:

Camera:
AvatarHeadOffset = new Vector3(0, 7, -15);
TargetOffset = new Vector3(0, 5, 0);

Objects located at:
Cube.Position = new Vector3(10, 0, 10);
Pyramid.Position = new Vector3(20, 0, 10);

My Position = Origin

As per these, in my opinion, the cube should be displayed on the right and the pyramid afterwards at x = 10 and x = 20.
But, when I run the tutorial, it displays: the cube first on the left followed by pyramid (feels as if, cube is at x = -10 and pyramid at x = -20).

I dont understand why this is happening ? Given the coordinate system and where I currently am, should they not be seen on the right ?

The next question follows this one:
Its about movement along the x axis again. on right arrow, if i decrease my current position, i strafe right.

Can somebody please explain me as to what am I doing wrong here ?

The tutorial can be found over here.

Also, I have attached a copy of the code over here. Its XNA 3.0 (& it uses WASD for strafing, Q/E for rotation).

I am following them at Gamecareerguide.com and gamedev.net


Follow

Get every new post delivered to your Inbox.