| Poster | : BhaaL | | Posts | : 1 | | Country | : | | City | : |
| | | | Posted by BhaaL on 30/08/2009 at 07:10:12
| | Hey there!
First off, great tutorial, keep it up!
But there is something that makes me think if anything went wrong...
For the carriage, you translate along +0/+carriage.Height for Draw, but -0/-carriage.Height for the Matrix.
For the rocket, you translate along +42/+240 for Draw and -42/-240 for the Matrix.
However, for the cannon, you translate along +11/+50 for Draw, and +11/+50 for the Matrix (thats your cannonOrigin).
Is there a particular reason why it isnt -11/-50 here?
That aside, where did you get the Matrix.CreateTranslation override from that takes a Vector2? | |
|
|
| |
| |
| Poster | : BotMan | | Posts | : 1 | | Country | : usa | | City | : ca |
| | | | Posted by BotMan on 01/05/2010 at 11:53:48
| | I am wondering the same thing.
I looked ahead a bit and it seems to me that things may be cleared up in the next chapter. For instance, Reimer put "carriage.Height" in his matrix for this chapter although the proper term would be "carriageTexture.Height". And when I looked ahead I saw that the matrix in the next chapter indeed had "carriageTexture.Height".
So I'm guessing Reimer is just using these terms as place holders right now to explain the theory and it'll be cleared up later. Although I still can't think of why the "+"s and "-"s are all switched around if in fact the x and y axis' are being scaled and rotated along with the image.
Any help? | |
|
|
| |
| |
| Poster | : Archenon | | Posts | : 428 | | Country | : Romania | | City | : Oradea |
| | | | Posted by Archenon on 03/05/2010 at 11:17:08
| | Well i say forward that i didn't looked into the chapter you guys specified but for example a wiered translation would be if you say Translate(x,y) * Rotate(180). You might as well go Translate(-x,-y).
It may not be the case but if you give me the direct link i can look into it. | |
|
|
| |
| |
| Poster | : Anonymous | | Posts | : | | Country | : | | City | : |
| | | | Posted by Anonymous on 21/07/2010 at 04:51:29
| | so noone can explain the reason for using the negative carriage.Height?
| Matrix carriageMat = Matrix.CreateTranslation(0, -carriage.Height, 0) * Matrix.CreateScale(playerScaling) * Matrix.CreateTranslation(xPos, yPos, 0) * Matrix.Identity; |
when in the draw it is coded
| spriteBatch.Draw(carriageTexture, player.Position, null, player.Color, 0, new Vector2(0, carriageTexture.Height), playerScaling, SpriteEffects.None, 0); |
| |
|
|
| |
| |
| Poster | : Anonymous | | Posts | : | | Country | : | | City | : |
| | | | Posted by Anonymous on 29/04/2011 at 16:54:31
| | Bump...
Anyone have any ideas? | |
|
|
| |
| |
| Poster | : Anonymous | | Posts | : | | Country | : | | City | : |
| | | | Posted by Anonymous on 04/11/2011 at 15:53:04
| | Well, I don't know about all of these issues, but I think I can answer about the -carriage height.
That transform is to change the origin point of the carriage from the top left corner, where it would normally be, to the bottom left corner, because it's easier to just move the origin than to keep calculating whether the carriage touches the ground by measuring from the top corner, if you see what I mean.
The reason it's a negative is because on our computer display, the Y axis is positive pointing downward and negative pointing up. So moving the origin downward on the carriage is equivalent to moving the carriage upward, or in a negative direction on the Y axis, hence -carriageHeight.
| |
|
|
| |
| |
| Poster | : Anonymous | | Posts | : | | Country | : | | City | : |
| | | | Posted by Anonymous on 04/11/2011 at 15:55:44
| | | Sorry, one more thing I forgot to mention. Anywhere it says to add the carriageHeight is probably just a typo. That may well be the case for some of the other flip-flopping signs as well. It's easier to talk about some of these things in a theoretical sense. But when it comes to coding, you have to get the signs right! | |
|
|
| |
| |
| Poster | : Anonymous | | Posts | : | | Country | : | | City | : |
| | | | Posted by Anonymous on 27/07/2012 at 09:09:02
| | | I loved as much as you'll receive carerid out right here. The sketch is tasteful, your authored subject matter stylish. nonetheless, you command get got an impatience over that you wish be delivering the following. unwell unquestionably come further formerly again since exactly the same nearly very often inside case you shield this increase. | |
|
|