# RoyP

Member

42

202 Neutral

• Rank
Member

1. ## Learning C#?

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#.   Here's the link again ...   Just scroll down the page until you find the 2012 edition.   Hope it helps.   Roy
2. ## Will i make it in game dev ?

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.    [quote]do you think ill be able to catch up in time to be any good at it ?[/quote] 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
3. ## Need help getting a child object to orbit a parent object ...

@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
4. ## Need help getting a child object to orbit a parent object ...

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
5. ## Need help getting a child object to orbit a parent object ...

[quote]Or, I think your can comment out this line of code and try once :   childShipRotationRadians += MathHelper.ToRadians(15);[/quote]   That just rotates the texture itself, so commenting it out just keeps the child ship pointing straight up.  It doesn't affect it's position in world space, so the child ship is still rotating around the 0,0 world origin.   Roy
6. ## Need help getting a child object to orbit a parent object ...

That's not going to do anything.  Those are just the center points on the actual textures themselves so I can rotate the texture around the texture's center point instead of the top left corner.  They have nothing to do with world space.  The coordinates that deal with the ship positions in world space are childShipPositionPoint and parentShipPositionPoint.   Roy

8. ## Need help getting a child object to orbit a parent object ...

Ok, I understand what you're saying conceptually.  How do I actually implement that in XNA?  Can you break it down step-by-step for me?  It would really help me learn it since this is my first time doing anything like this.   Roy
9. ## Need help getting a child object to orbit a parent object ...

So how would I go about doing that?  This is my first adventure with matrices, so I need some help understanding what I'm supposed to do and why.   Roy
10. ## Need help getting a child object to orbit a parent object ...

I'm not doing anything with a matrix for the parent ship.  I'm just assigning it's rotation a value in the Update method and using that value to change the angle the texture is rendered at in the Draw method.  The parent ship's texture is just rotating at the center point of the screen.   Roy
11. ## Need help getting a child object to orbit a parent object ...

I'm trying to figure out how to make a child object orbit around a parent object.  In my situation, I'm trying to create a parent ship that rotates waypoints with it when it rotates.  A smaller child ship will park itself in a waypoint to maintain it's position within the fleet.     Here are a couple of images showing what I'm going for:        The child ship must keep it's position relative to the parent ship so it maintains it's position within the fleet.   i've tried learning enough about matrices to do it, but I'm screwing something up.  I've got my child ship orbiting the origin point of the screen instead of the parent ship.   Here's the code I'm using when I press a key: parentShipRotationRadians += MathHelper.ToRadians(15); childShipRotationRadians += MathHelper.ToRadians(15); Matrix.CreateRotationZ(parentShipRotationRadians, out childShipRotationMatrix); childShipPositionPoint = Vector2.Transform(childShipPositionPoint, childShipRotationMatrix);     How do I rotate the child ship's center point around the parent ship's center point with matrices?     Please break it down for me and help me understand what you're doing.  I've tried researching it and I just can't find the info.   Roy
12. ## Programmer from Taiwan looking for like-minded individuals interested in hand-painted indie game development

Very nice graphics.  I love your style.  Nice work.   Roy
13. ## NWA Game Developer Meetup -- December 29 -- Fayetteville AR

Interested in making video games and having fun?  Come join us at our next meetup on December 29th.   We're looking for people in Northwest Arkansas who are passionate about game development and want to learn more about it while working on fun game projects together.   We're not just for programmers.  We have members interested in game design, game programming, game art, game music and sound effects, level design, writing story for game development, and more.   It doesn't matter if you're an enthusiastic beginner or a seasoned pro, come hang out with us.  We'd love to meet you.   You can find all the details at our Meetup site.
14. ## How do I rotate a group of child objects in relation to a parent object?

Thanks, mate.  I don't know how to work with matrices yet, but this experience has taught me I need to learn linear algebra.  So that's what I'm focusing on right now.  I appreciate the help.   Roy
15. ## How do I rotate a group of child objects in relation to a parent object?

@Alvaro: Thanks for the suggestion, Alvaro. I was able to figure it out from your suggestion. Thanks for the help. I was setting the top left corner of the satellite ship to the new point rather than setting it's center to the new point. @Morphex: I appreciate the offer, but I'm not at that level yet. I don't know how to transform matrices ... but it's on my list to learn. :-) Thanks for the help, everyone. You guys rock! Roy