• Create Account

# RoyP

Member Since 10 Nov 2012
Offline Last Active Jan 23 2013 08:06 PM

### In Topic: Learning C#?

16 January 2013 - 12:45 PM

I started learning C# a few months ago using Rob Miles' C# Yellow Book.  It's a free download and it helped me get up to speed pretty quickly with C#.

Just scroll down the page until you find the 2012 edition.

Hope it helps.

Roy

### In Topic: Will i make it in game dev ?

06 January 2013 - 10:09 AM

Try the book 3D Math Primer for Graphics and Game Development.  It's helping me learn the math I need for 2D and 3D game development.

do you think ill be able to catch up in time to be any good at it ?

Well, you know you can learn because you learned computer science ... so yeah, why can't you?  It's entirely up to you.

Don't wait for the right moment, just tear into it and do the work.  Learn something new, figure out how you would apply that in a game context, then apply it to a little test case.  You'll learn it quicker than you think.

Roy

### In Topic: Need help getting a child object to orbit a parent object ...

03 January 2013 - 08:02 AM

@FromShadow ... you are a genius. :-)  It does exactly what I needed.  Thanks for explaining it to me and providing the code to do it.

@NewDisplayName ... thanks for trying to help.  I appreciate it.

Roy

### In Topic: Need help getting a child object to orbit a parent object ...

02 January 2013 - 12:07 PM

Let me try explaining exactly what I'm trying to do.  I might not be making it as clear as I thought.

Here's an image showing what I'm trying to do:

The purple ship is the parent ship.  The orange ship is the child ship.

1 - I'm starting with a parent ship at (640, 320) in world space (center of the view port).  I set the child ship's position with an offset of (-47, -47) from the parent ship's position.  Both ships start with a rotation of 0 degrees (I convert all the degrees to radians with the MathHelper.ToRadians method).  The only thing I do with the rotation amount is to use it for the SpriteBatch.Draw call in the game's Draw method and use it to pass the rotation value to the Matrix.CreateRotationZ method.

2 - When I hit the right arrow, I want to rotate the parent ship 15 degrees clockwise and compute the new center point for the child ship in relation to the parent ship.  The goal is to have the child ship rotate with the parent ship while maintaining it's position within the fleet.  (My eventual goal is to turn the concept into a waypoint system so I can park different child ships at the waypoints.)

3 to 7 -  I need to repeat step 2 over and over again, so that the child ship keeps orbiting the parent ship while maintaining it's fleet formation.  I want it to orbit in a complete circle.

When I press the left arrow key, I want to do the same thing, but in the counter clockwise direction.

Does that make it any clearer?

I know that I need to use matrix transformations to do it, but I need help understanding how to actually do the matrix transformations.  I've never done it before and I need someone to walk me through it step-by-step so that I can learn what I'm doing.

I have a basic understanding of matrix and vector math, but I'm having trouble applying the abstract concepts to a concrete implementation in XNA.

Roy

### In Topic: Need help getting a child object to orbit a parent object ...

02 January 2013 - 10:49 AM

Or, I think your can comment out this line of code and try once :