Forum
Contact





DirectX using C#
DirectX using C++
DirectX using Visual Basic



Latest Forum posts

 No download link for 2d series: shooter
  Posted by: zaboleq
  When: 07/05/2013 at 15:46:28

 Collision Class?
  Posted by: Anonymous
  When: 05/05/2013 at 19:03:59

 stack overflow
  Posted by: cityguy
  When: 07/04/2013 at 01:58:38

 Meshes looks strange.
  Posted by: ab_saratov
  When: 01/04/2013 at 04:31:08

 Lamppost Not loaded
  Posted by: Anonymous
  When: 22/03/2013 at 06:43:52

 Collision Class?
  Posted by: Da_Boom
  When: 21/03/2013 at 01:23:09

 Math boggles me
  Posted by: cityguy
  When: 17/03/2013 at 03:44:48

 Collision Class?
  Posted by: Da_Boom
  When: 16/03/2013 at 03:44:42

 Tree update
  Posted by: Anonymous
  When: 15/03/2013 at 21:11:22

 XNA 4.0
  Posted by: Anonymous
  When: 15/03/2013 at 19:43:57

 Error when I try to run.
  Posted by: Anonymous
  When: 15/03/2013 at 19:21:06

 Error With the Effect File
  Posted by: Anonymous
  When: 15/03/2013 at 18:21:01

 Can only get shadowmap
  Posted by: Anonymous
  When: 15/03/2013 at 15:48:52

 Vertex and Pixel Shader Versions?
  Posted by: Anonymous
  When: 15/03/2013 at 15:07:16

 Unsupported properties
  Posted by: Anonymous
  When: 15/03/2013 at 14:23:00

 Problem Loading Skybox
  Posted by: Rana
  When: 15/03/2013 at 10:34:45

 Black Screen Of Death - Help!
  Posted by: Anonymous
  When: 15/03/2013 at 03:43:43

 2.0 anyone?
  Posted by: Anonymous
  When: 15/03/2013 at 02:19:48

 Defitinition of tha rotation axis
  Posted by: Anonymous
  When: 15/03/2013 at 00:55:14

 Typo / Inconsistancy for 360 deployment.
  Posted by: Anonymous
  When: 14/03/2013 at 19:48:23




Topic: Offset once +, once -?



  
Goto parent category
  
Create a new user account


   Offset once +, once -?
 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.

  
Post a new reply
 





Google
 
Web www.riemers.net
If you appreciate the amount of time I spend creating and updating
these pages, feel free to donate -- any amount is welcome !
- Website design & DirectX code : Riemer Grootjans -
©2006 Riemer Grootjans


News
Home
Forum
XNA 2.0 Recipes Book (8)
XNA 3.0 Recipes Book (8)
Downloads
Extra Reading (3)
Matrices: geometrical
Matrix Mathematics
Homogenous matrices
Community Projects (1)
Tutorials (160)
XNA 4.0 using C# (89)
DirectX using C# (54)
Series 1:Terrain (14)
Opening a window
Linking to the Device
Drawing a triangle
Camera
Rotation - Translation
Indices
Terrain creation
Terrain from file
DirectInput
Importing bmp files
Colored vertices
DirectX Light basics
Mesh creation
Mesh lighting
Series 2: Flightsim (19)
Series 3: HLSL (19)
Short Tuts (2)
Resizing problem
Checking Device caps
DirectX using C++ (15)
DirectX using VB (2)