You can subscribe to this list here.
2000 
_{Jan}

_{Feb}

_{Mar}

_{Apr}

_{May}

_{Jun}

_{Jul}
(390) 
_{Aug}
(767) 
_{Sep}
(940) 
_{Oct}
(964) 
_{Nov}
(819) 
_{Dec}
(762) 

2001 
_{Jan}
(680) 
_{Feb}
(1075) 
_{Mar}
(954) 
_{Apr}
(595) 
_{May}
(725) 
_{Jun}
(868) 
_{Jul}
(678) 
_{Aug}
(785) 
_{Sep}
(410) 
_{Oct}
(395) 
_{Nov}
(374) 
_{Dec}
(419) 
2002 
_{Jan}
(699) 
_{Feb}
(501) 
_{Mar}
(311) 
_{Apr}
(334) 
_{May}
(501) 
_{Jun}
(507) 
_{Jul}
(441) 
_{Aug}
(395) 
_{Sep}
(540) 
_{Oct}
(416) 
_{Nov}
(369) 
_{Dec}
(373) 
2003 
_{Jan}
(514) 
_{Feb}
(488) 
_{Mar}
(396) 
_{Apr}
(624) 
_{May}
(590) 
_{Jun}
(562) 
_{Jul}
(546) 
_{Aug}
(463) 
_{Sep}
(389) 
_{Oct}
(399) 
_{Nov}
(333) 
_{Dec}
(449) 
2004 
_{Jan}
(317) 
_{Feb}
(395) 
_{Mar}
(136) 
_{Apr}
(338) 
_{May}
(488) 
_{Jun}
(306) 
_{Jul}
(266) 
_{Aug}
(424) 
_{Sep}
(502) 
_{Oct}
(170) 
_{Nov}
(170) 
_{Dec}
(134) 
2005 
_{Jan}
(249) 
_{Feb}
(109) 
_{Mar}
(119) 
_{Apr}
(282) 
_{May}
(82) 
_{Jun}
(113) 
_{Jul}
(56) 
_{Aug}
(160) 
_{Sep}
(89) 
_{Oct}
(98) 
_{Nov}
(237) 
_{Dec}
(297) 
2006 
_{Jan}
(151) 
_{Feb}
(250) 
_{Mar}
(222) 
_{Apr}
(147) 
_{May}
(266) 
_{Jun}
(313) 
_{Jul}
(367) 
_{Aug}
(135) 
_{Sep}
(108) 
_{Oct}
(110) 
_{Nov}
(220) 
_{Dec}
(47) 
2007 
_{Jan}
(133) 
_{Feb}
(144) 
_{Mar}
(247) 
_{Apr}
(191) 
_{May}
(191) 
_{Jun}
(171) 
_{Jul}
(160) 
_{Aug}
(51) 
_{Sep}
(125) 
_{Oct}
(115) 
_{Nov}
(78) 
_{Dec}
(67) 
2008 
_{Jan}
(165) 
_{Feb}
(37) 
_{Mar}
(130) 
_{Apr}
(111) 
_{May}
(91) 
_{Jun}
(142) 
_{Jul}
(54) 
_{Aug}
(104) 
_{Sep}
(89) 
_{Oct}
(87) 
_{Nov}
(44) 
_{Dec}
(54) 
2009 
_{Jan}
(283) 
_{Feb}
(113) 
_{Mar}
(154) 
_{Apr}
(395) 
_{May}
(62) 
_{Jun}
(48) 
_{Jul}
(52) 
_{Aug}
(54) 
_{Sep}
(131) 
_{Oct}
(29) 
_{Nov}
(32) 
_{Dec}
(37) 
2010 
_{Jan}
(34) 
_{Feb}
(36) 
_{Mar}
(40) 
_{Apr}
(23) 
_{May}
(38) 
_{Jun}
(34) 
_{Jul}
(36) 
_{Aug}
(27) 
_{Sep}
(9) 
_{Oct}
(18) 
_{Nov}
(25) 
_{Dec}

2011 
_{Jan}
(1) 
_{Feb}
(14) 
_{Mar}
(1) 
_{Apr}
(5) 
_{May}
(1) 
_{Jun}

_{Jul}

_{Aug}
(37) 
_{Sep}
(6) 
_{Oct}
(2) 
_{Nov}

_{Dec}

2012 
_{Jan}

_{Feb}
(7) 
_{Mar}

_{Apr}
(4) 
_{May}

_{Jun}
(3) 
_{Jul}

_{Aug}

_{Sep}
(1) 
_{Oct}

_{Nov}

_{Dec}
(10) 
2013 
_{Jan}

_{Feb}
(1) 
_{Mar}
(7) 
_{Apr}
(2) 
_{May}

_{Jun}

_{Jul}
(9) 
_{Aug}

_{Sep}

_{Oct}

_{Nov}

_{Dec}

2014 
_{Jan}
(14) 
_{Feb}

_{Mar}
(2) 
_{Apr}

_{May}
(10) 
_{Jun}

_{Jul}

_{Aug}

_{Sep}

_{Oct}

_{Nov}
(3) 
_{Dec}

2015 
_{Jan}

_{Feb}

_{Mar}

_{Apr}

_{May}

_{Jun}

_{Jul}

_{Aug}

_{Sep}

_{Oct}
(12) 
_{Nov}

_{Dec}
(1) 
2016 
_{Jan}

_{Feb}
(1) 
_{Mar}
(1) 
_{Apr}
(1) 
_{May}

_{Jun}
(1) 
_{Jul}

_{Aug}
(1) 
_{Sep}

_{Oct}

_{Nov}

_{Dec}

S  M  T  W  T  F  S 






1
(5) 
2

3

4
(1) 
5

6

7
(11) 
8
(8) 
9

10

11

12
(5) 
13
(2) 
14
(3) 
15

16

17

18

19

20

21
(1) 
22
(1) 
23

24

25

26

27

28

29


From: Will Vale <will@se...>  20080207 21:02:00

> Because of this I find it more helpful to think of my matrices as > object2world, world2view, view2proj rather than just 'world', 'view' or > 'proj' as the link between the two is relevant. Amen to that  it makes the concatenations much more straightforward to errorcheck. Will 
From: Jon Watte <hplus@mi...>  20080207 18:38:55

Direct3D uses row vectors on left. Thus, the "X" basis vector lives in the first row, not first column. For more information, see http://www.mindcontrol.org/~hplus/graphics/matrixlayout.html Cheers, / h+ Bruno Sanches wrote: > > Hello Folks, > > I am reading this list emails (and learning a lot) from some time and > I would like to ask some help with basic 3d transformations that is > giving a lot of headaches for me on last days (and nights)... > > On the framework that I am working (d3d9) I have a basic scene graph > system, each node has a transformation matrix. > > On rendering, I have a code (pseudo code) like this: > > Vec3 fwd; > > fwd.x = cameraMatrix._11; > fwd.y = cameraMatrix._21; > fwd.z = cameraMatrix._31; > > //My coordinate system, x is forward, y is right, Z is up (right hand > with Z pointing up) > Vec3 origin = cameraOrigin; > Vec3 at = origin + fwd; > > Vec3 up; > up.x = cameraMatrix._13; > up.x = cameraMatrix._23; > up.x = cameraMatrix._33; > > D3DXMATRIX viewMat; > D3DXMatrixLookAtRH(&viewMat, cameraOrigin, &at, &up); > > screen>SetViewTransform(viewMat); > > After setting up the camera transformation like above, I go rendering > my objects: > > for each object > { > D3DXMATRIX mat = object.matrix; > screen>SetWorldTransform(mat); > > DrawObject(); > } > > And everything works fine. > > But, now I am trying to move a object forward, and this is where my > problems start, for moving my objects, I do: > > void moveObject(float dist) > { > Vec3 fwd; > > fwd.x = objectMatrix._11; > fwd.y = objectMatrix._21; > fwd.z = objectMatrix._31; > > fwd *= dist; > > objectOrigin += fwd; > } > > This appears to work, but I found out that the objects matrix appears > to be inverted, they will move on very strange directions, if on the > above function I use a invert matrix, everything works fine! I don't > know what I am missing here, because I was expecting the above > function to work without using the inverse matrix. > > I have similar code on opengl few years ago and it worked. Does anyone > has any clue what is going on? Or at least, is this expected? :) > > Please note for all math, I am using d3dx math functions. > > Thank you for your help! > > Regards > Bruno Sanches > >  > >  > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ >  > > _______________________________________________ > GDAlgorithmslist mailing list > GDAlgorithmslist@... > https://lists.sourceforge.net/lists/listinfo/gdalgorithmslist > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithmslist   Go is to Western chess what philosophy is to double entry accounting. 
From: Johnson, Matt <Matt.Johnson@am...>  20080207 14:46:01

http://www.toymaker.info/Games/html/camera.html So, it appears that for the view, I will need to use the invert matrix after fixing the code, thats weird to me, does anyone knows a tutorial / doc that explain the math behind view matrix? 
From: Bruno Sanches <bcsanches@gm...>  20080207 14:37:39

Sam, Richard and Oscar, thank you for your help!! Now the things are clear to me, I was confused by the view matrix stuff from d3d, I came from opengl, and there I used to change the MODEL_VIEW matrix with the camera invert matrix (exactly as you described) and goes pushing the object2world matrix on stack (transforming against the invert view matrix). But when I arrived on d3d, I through that the view matrix will invert my camera matrix and do the work, add to this the bug on my GetAxis function (that Oscar spotted), everything worked until I started moving the objects around. But based on your comments, it appears that the View matrix is just a helper function, so I don't need to transform all my objects by the invert camera matrix before rendering (like I did on opengl), I just need to set the view matrix to the *invert matrix* of the camera and the world by the objects matrix. Nice, now everything makes sense!! Sorry for the API specific comments / questions. Thanks again! Bruno Sanches On 2/7/08, Sam Martin <sam.martin@...> wrote: > > There's a simple way of thinking about these matrices that might help > you. > > > > All of these matrices are transformations that take you from one space to > another. If each space is a vertex in a graph, then the matrices are the > directed edges linking the vertices. You can actually sit down a draw a > graph of how your geometry transitions between these spaces. > > > > Your 'standard object matrix' is an object_space > world_space > transformation. And a 'camera view matrix' is a world_space > view_space > transformation. Inverting these matrices reverses the direction of the > transformation. > > > > If your view_space is the same as your object_space for the camera – which > is up to you to define but is perfectly reasonable – then the inverse of > your camera 'view matrix' is actually the camera's 'standard object matrix'. > Draw the graph if you are confused. This might explain to you why one works > with an inverse and the other doesn't. > > > > Because of this I find it more helpful to think of my matrices as > object2world, world2view, view2proj rather than just 'world', 'view' or > 'proj' as the link between the two is relevant. > > > > Hope that helps, > > Sam > > >  > > *From:* gdalgorithmslistbounces@... [mailto: > gdalgorithmslistbounces@...] *On Behalf Of *Bruno > Sanches > *Sent:* 07 February 2008 13:43 > *To:* Game Development Algorithms > *Subject:* Re: [Algorithms] Dummie Matrix math questions > > > > I will verify that when I arrive at home, because thinking again, I belive > my code at home is wrong, because now it makes sense why using the inverse > matrix its works :). Two days investigating this and havent figured out > this! > > > > So, it appears that for the view, I will need to use the invert matrix > after fixing the code, thats weird to me, does anyone knows a tutorial / doc > that explain the math behind view matrix? > > > > Thank you! > > Bruno Sanches > > > > On 2/7/08, *Oscar Forth* <oscar@...> wrote: > > Well either you wrote it twice wrong in your original mail ... or you > wrote it correctly both times. > > > > Anyway, I still think its because GL and DX matrices are transposes of > each other ... an invert of a simple rotation matrix is the transpose of > that matrix. > > > > View matrices are odd beasts ... they are not constructed like a standard > object matrix. They aren't interchangeable ... > > > > Hope thats some help. > > > >  Original Message  > > *From:* Bruno Sanches <bcsanches@...> > > *To:* Game Development Algorithms<gdalgorithmslist@...> > > *Sent:* Thursday, February 07, 2008 12:28 PM > > *Subject:* Re: [Algorithms] Dummie Matrix math questions > > > > > Sorry Oscar, I typed it wrong when writing the email, the object code uses > the same code from camera to extract the axis. > > > > I am not sure if something with my math is wrong. The most strange for me > is that for the camera, when I get the fwd vector and use it to move the > camera, everything goes fine, but for objects, I need to get the fwd vector > from the inverse matrix. > > > > I am not understanding why I need to do that, because I was expecting the > camera to behave like any other object. > > > > Thank you > > > > Bruno Sanches > > > > On 2/7/08, *Oscar Forth* <oscar@...> wrote: > > Sounds like the difference between GL and DX row/column ordering. > > > > Under DX it should be > > > > fwd.x = objectMatrix._11; > fwd.y = objectMatrix._12; > fwd.z = objectMatrix._13; > > > Don't get confused by the two ... > > > > Sorry if thats a bit of a platform specific answer admins! > >  Original Message  > > *From:* Bruno Sanches <bcsanches@...> > > *To:* Game Development Algorithms<gdalgorithmslist@...> > > *Sent:* Thursday, February 07, 2008 12:07 PM > > *Subject:* [Algorithms] Dummie Matrix math questions > > > > > Hello Folks, > > I am reading this list emails (and learning a lot) from some time and I > would like to ask some help with basic 3d transformations that is giving a > lot of headaches for me on last days (and nights)... > > On the framework that I am working (d3d9) I have a basic scene graph > system, each node has a transformation matrix. > > On rendering, I have a code (pseudo code) like this: > > Vec3 fwd; > > fwd.x = cameraMatrix._11; > fwd.y = cameraMatrix._21; > fwd.z = cameraMatrix._31; > > //My coordinate system, x is forward, y is right, Z is up (right hand with > Z pointing up) > Vec3 origin = cameraOrigin; > Vec3 at = origin + fwd; > > Vec3 up; > up.x = cameraMatrix._13; > up.x = cameraMatrix._23; > up.x = cameraMatrix._33; > > D3DXMATRIX viewMat; > D3DXMatrixLookAtRH(&viewMat, cameraOrigin, &at, &up); > > screen>SetViewTransform(viewMat); > > After setting up the camera transformation like above, I go rendering my > objects: > > for each object > { > D3DXMATRIX mat = object.matrix; > screen>SetWorldTransform(mat); > > DrawObject(); > } > > And everything works fine. > > But, now I am trying to move a object forward, and this is where my > problems start, for moving my objects, I do: > > void moveObject(float dist) > { > Vec3 fwd; > > fwd.x = objectMatrix._11; > fwd.y = objectMatrix._21; > fwd.z = objectMatrix._31; > > fwd *= dist; > > objectOrigin += fwd; > } > > This appears to work, but I found out that the objects matrix appears to > be inverted, they will move on very strange directions, if on the above > function I use a invert matrix, everything works fine! I don't know what I > am missing here, because I was expecting the above function to work without > using the inverse matrix. > > I have similar code on opengl few years ago and it worked. Does anyone has > any clue what is going on? Or at least, is this expected? :) > > Please note for all math, I am using d3dx math functions. > > Thank you for your help! > > Regards > Bruno Sanches >  > >  > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ >  > > _______________________________________________ > GDAlgorithmslist mailing list > GDAlgorithmslist@... > https://lists.sourceforge.net/lists/listinfo/gdalgorithmslist > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithmslist > > >  > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > GDAlgorithmslist mailing list > GDAlgorithmslist@... > https://lists.sourceforge.net/lists/listinfo/gdalgorithmslist > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithmslist > > >  > >  > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ >  > > _______________________________________________ > GDAlgorithmslist mailing list > GDAlgorithmslist@... > https://lists.sourceforge.net/lists/listinfo/gdalgorithmslist > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithmslist > > >  > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > GDAlgorithmslist mailing list > GDAlgorithmslist@... > https://lists.sourceforge.net/lists/listinfo/gdalgorithmslist > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithmslist > > > >  > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > GDAlgorithmslist mailing list > GDAlgorithmslist@... > https://lists.sourceforge.net/lists/listinfo/gdalgorithmslist > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithmslist > 
From: Sam Martin <sam.martin@ge...>  20080207 13:57:49

There's a simple way of thinking about these matrices that might help you. All of these matrices are transformations that take you from one space to another. If each space is a vertex in a graph, then the matrices are the directed edges linking the vertices. You can actually sit down a draw a graph of how your geometry transitions between these spaces. Your 'standard object matrix' is an object_space > world_space transformation. And a 'camera view matrix' is a world_space > view_space transformation. Inverting these matrices reverses the direction of the transformation. If your view_space is the same as your object_space for the camera  which is up to you to define but is perfectly reasonable  then the inverse of your camera 'view matrix' is actually the camera's 'standard object matrix'. Draw the graph if you are confused. This might explain to you why one works with an inverse and the other doesn't. Because of this I find it more helpful to think of my matrices as object2world, world2view, view2proj rather than just 'world', 'view' or 'proj' as the link between the two is relevant. Hope that helps, Sam ________________________________ From: gdalgorithmslistbounces@... [mailto:gdalgorithmslistbounces@...] On Behalf Of Bruno Sanches Sent: 07 February 2008 13:43 To: Game Development Algorithms Subject: Re: [Algorithms] Dummie Matrix math questions I will verify that when I arrive at home, because thinking again, I belive my code at home is wrong, because now it makes sense why using the inverse matrix its works :). Two days investigating this and havent figured out this! So, it appears that for the view, I will need to use the invert matrix after fixing the code, thats weird to me, does anyone knows a tutorial / doc that explain the math behind view matrix? Thank you! Bruno Sanches On 2/7/08, Oscar Forth <oscar@...> wrote: Well either you wrote it twice wrong in your original mail ... or you wrote it correctly both times. Anyway, I still think its because GL and DX matrices are transposes of each other ... an invert of a simple rotation matrix is the transpose of that matrix. View matrices are odd beasts ... they are not constructed like a standard object matrix. They aren't interchangeable ... Hope thats some help.  Original Message  From: Bruno Sanches <mailto:bcsanches@...> To: Game Development Algorithms <mailto:gdalgorithmslist@...> Sent: Thursday, February 07, 2008 12:28 PM Subject: Re: [Algorithms] Dummie Matrix math questions Sorry Oscar, I typed it wrong when writing the email, the object code uses the same code from camera to extract the axis. I am not sure if something with my math is wrong. The most strange for me is that for the camera, when I get the fwd vector and use it to move the camera, everything goes fine, but for objects, I need to get the fwd vector from the inverse matrix. I am not understanding why I need to do that, because I was expecting the camera to behave like any other object. Thank you Bruno Sanches On 2/7/08, Oscar Forth <oscar@...> wrote: Sounds like the difference between GL and DX row/column ordering. Under DX it should be fwd.x = objectMatrix._11; fwd.y = objectMatrix._12; fwd.z = objectMatrix._13; Don't get confused by the two ... Sorry if thats a bit of a platform specific answer admins!  Original Message  From: Bruno Sanches <mailto:bcsanches@...> To: Game Development Algorithms <mailto:gdalgorithmslist@...> Sent: Thursday, February 07, 2008 12:07 PM Subject: [Algorithms] Dummie Matrix math questions Hello Folks, I am reading this list emails (and learning a lot) from some time and I would like to ask some help with basic 3d transformations that is giving a lot of headaches for me on last days (and nights)... On the framework that I am working (d3d9) I have a basic scene graph system, each node has a transformation matrix. On rendering, I have a code (pseudo code) like this: Vec3 fwd; fwd.x = cameraMatrix._11; fwd.y = cameraMatrix._21; fwd.z = cameraMatrix._31; //My coordinate system, x is forward, y is right, Z is up (right hand with Z pointing up) Vec3 origin = cameraOrigin; Vec3 at = origin + fwd; Vec3 up; up.x = cameraMatrix._13; up.x = cameraMatrix._23; up.x = cameraMatrix._33; D3DXMATRIX viewMat; D3DXMatrixLookAtRH(&viewMat, cameraOrigin, &at, &up); screen>SetViewTransform(viewMat); After setting up the camera transformation like above, I go rendering my objects: for each object { D3DXMATRIX mat = object.matrix; screen>SetWorldTransform(mat); DrawObject(); } And everything works fine. But, now I am trying to move a object forward, and this is where my problems start, for moving my objects, I do: void moveObject(float dist) { Vec3 fwd; fwd.x = objectMatrix._11; fwd.y = objectMatrix._21; fwd.z = objectMatrix._31; fwd *= dist; objectOrigin += fwd; } This appears to work, but I found out that the objects matrix appears to be inverted, they will move on very strange directions, if on the above function I use a invert matrix, everything works fine! I don't know what I am missing here, because I was expecting the above function to work without using the inverse matrix. I have similar code on opengl few years ago and it worked. Does anyone has any clue what is going on? Or at least, is this expected? :) Please note for all math, I am using d3dx math functions. Thank you for your help! Regards Bruno Sanches ________________________________   This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ ________________________________ _______________________________________________ GDAlgorithmslist mailing list GDAlgorithmslist@... https://lists.sourceforge.net/lists/listinfo/gdalgorithmslist Archives: http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithmslis t   This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ GDAlgorithmslist mailing list GDAlgorithmslist@... https://lists.sourceforge.net/lists/listinfo/gdalgorithmslist Archives: http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithmslis t ________________________________   This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ ________________________________ _______________________________________________ GDAlgorithmslist mailing list GDAlgorithmslist@... https://lists.sourceforge.net/lists/listinfo/gdalgorithmslist Archives: http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithmslis t   This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ GDAlgorithmslist mailing list GDAlgorithmslist@... https://lists.sourceforge.net/lists/listinfo/gdalgorithmslist Archives: http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithmslis t 
From: Richard Fabian <raspo1@gm...>  20080207 13:56:35

you can think of a view matrix as just being a model matrix of your camera, and the reason you use the inverse of it is that you're trying to transform the scene by the camera's model matrix, but the camera is the other way up/down the scene graph. consider this: "object" is a child of "transform", is a child of "scene root", "camera" is a child of "scene root" to render "object", you need to get each vertex of "object", multiply each of them by the transforms "down" the chain . First by "object"'s model matrix, then down to "transform", then you reach the scene root (which you might have as a transform, but not normally as you'll see in a moment), but to get to the camera you have to go "up" (using the inverse matrix instead) of "camera" so you apply the inverse camera after you've built your "world" representation using the idea that a inverse multiply is a divide, you can figure it through like this V * object * transform * root / root / camera as you can see, the root scene transform is unimportant because it cancels immediately, leaving you with: V * object * transform / camera and this is why you need to use the inverse camera local matrix to build your renderer camera transform. On Feb 7, 2008 1:42 PM, Bruno Sanches <bcsanches@...> wrote: > I will verify that when I arrive at home, because thinking again, I belive > my code at home is wrong, because now it makes sense why using the inverse > matrix its works :). Two days investigating this and havent figured out > this! > > So, it appears that for the view, I will need to use the invert matrix > after fixing the code, thats weird to me, does anyone knows a tutorial / doc > that explain the math behind view matrix? > > Thank you! > Bruno Sanches > > On 2/7/08, Oscar Forth <oscar@...> wrote: > > > > Well either you wrote it twice wrong in your original mail ... or you > > wrote it correctly both times. > > > > Anyway, I still think its because GL and DX matrices are transposes of > > each other ... an invert of a simple rotation matrix is the transpose of > > that matrix. > > > > View matrices are odd beasts ... they are not constructed like a > > standard object matrix. They aren't interchangeable ... > > > > Hope thats some help. > > > > > >  Original Message  > > *From:* Bruno Sanches <bcsanches@...> > > *To:* Game Development Algorithms<gdalgorithmslist@...> > > *Sent:* Thursday, February 07, 2008 12:28 PM > > *Subject:* Re: [Algorithms] Dummie Matrix math questions > > > > > > Sorry Oscar, I typed it wrong when writing the email, the object code > > uses the same code from camera to extract the axis. > > > > I am not sure if something with my math is wrong. The most strange for > > me is that for the camera, when I get the fwd vector and use it to move the > > camera, everything goes fine, but for objects, I need to get the fwd vector > > from the inverse matrix. > > > > I am not understanding why I need to do that, because I was expecting > > the camera to behave like any other object. > > > > Thank you > > > > Bruno Sanches > > > > > > On 2/7/08, Oscar Forth <oscar@...> wrote: > > > > > > Sounds like the difference between GL and DX row/column ordering. > > > > > > Under DX it should be > > > > > > fwd.x = objectMatrix._11; > > > fwd.y = objectMatrix._12; > > > fwd.z = objectMatrix._13; > > > > > > Don't get confused by the two ... > > > > > > Sorry if thats a bit of a platform specific answer admins! > > > > > >  Original Message  > > > *From:* Bruno Sanches <bcsanches@...> > > > *To:* Game Development Algorithms<gdalgorithmslist@...> > > > *Sent:* Thursday, February 07, 2008 12:07 PM > > > *Subject:* [Algorithms] Dummie Matrix math questions > > > > > > > > > > > > Hello Folks, > > > > > > I am reading this list emails (and learning a lot) from some time and > > > I would like to ask some help with basic 3d transformations that is giving a > > > lot of headaches for me on last days (and nights)... > > > > > > On the framework that I am working (d3d9) I have a basic scene graph > > > system, each node has a transformation matrix. > > > > > > On rendering, I have a code (pseudo code) like this: > > > > > > Vec3 fwd; > > > > > > fwd.x = cameraMatrix._11; > > > fwd.y = cameraMatrix._21; > > > fwd.z = cameraMatrix._31; > > > > > > //My coordinate system, x is forward, y is right, Z is up (right hand > > > with Z pointing up) > > > Vec3 origin = cameraOrigin; > > > Vec3 at = origin + fwd; > > > > > > Vec3 up; > > > up.x = cameraMatrix._13; > > > up.x = cameraMatrix._23; > > > up.x = cameraMatrix._33; > > > > > > D3DXMATRIX viewMat; > > > D3DXMatrixLookAtRH(&viewMat, cameraOrigin, &at, &up); > > > > > > screen>SetViewTransform(viewMat); > > > > > > After setting up the camera transformation like above, I go rendering > > > my objects: > > > > > > for each object > > > { > > > D3DXMATRIX mat = object.matrix; > > > screen>SetWorldTransform(mat); > > > > > > DrawObject(); > > > } > > > > > > And everything works fine. > > > > > > But, now I am trying to move a object forward, and this is where my > > > problems start, for moving my objects, I do: > > > > > > void moveObject(float dist) > > > { > > > Vec3 fwd; > > > > > > fwd.x = objectMatrix._11; > > > fwd.y = objectMatrix._21; > > > fwd.z = objectMatrix._31; > > > > > > fwd *= dist; > > > > > > objectOrigin += fwd; > > > } > > > > > > This appears to work, but I found out that the objects matrix appears > > > to be inverted, they will move on very strange directions, if on the above > > > function I use a invert matrix, everything works fine! I don't know what I > > > am missing here, because I was expecting the above function to work without > > > using the inverse matrix. > > > > > > I have similar code on opengl few years ago and it worked. Does anyone > > > has any clue what is going on? Or at least, is this expected? :) > > > > > > Please note for all math, I am using d3dx math functions. > > > > > > Thank you for your help! > > > > > > Regards > > > Bruno Sanches > > > > > >  > > > > > > > > >  > > > This SF.net email is sponsored by: Microsoft > > > Defy all challenges. Microsoft(R) Visual Studio 2008. > > > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > > > > > >  > > > > > > _______________________________________________ > > > GDAlgorithmslist mailing list > > > GDAlgorithmslist@... > > > https://lists.sourceforge.net/lists/listinfo/gdalgorithmslist > > > Archives: > > > > > > http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithmslist > > > > > > > > > > > >  > > > This SF.net email is sponsored by: Microsoft > > > Defy all challenges. Microsoft(R) Visual Studio 2008. > > > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > > > _______________________________________________ > > > GDAlgorithmslist mailing list > > > GDAlgorithmslist@... > > > https://lists.sourceforge.net/lists/listinfo/gdalgorithmslist > > > Archives: > > > > > > http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithmslist > > > > > > >  > > > > > >  > > This SF.net email is sponsored by: Microsoft > > Defy all challenges. Microsoft(R) Visual Studio 2008. > > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > > > >  > > > > _______________________________________________ > > GDAlgorithmslist mailing list > > GDAlgorithmslist@... > > https://lists.sourceforge.net/lists/listinfo/gdalgorithmslist > > Archives: > > > > http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithmslist > > > > > > > >  > > This SF.net email is sponsored by: Microsoft > > Defy all challenges. Microsoft(R) Visual Studio 2008. > > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > > _______________________________________________ > > GDAlgorithmslist mailing list > > GDAlgorithmslist@... > > https://lists.sourceforge.net/lists/listinfo/gdalgorithmslist > > Archives: > > > > http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithmslist > > > > >  > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > GDAlgorithmslist mailing list > GDAlgorithmslist@... > https://lists.sourceforge.net/lists/listinfo/gdalgorithmslist > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithmslist >  fabs(); Just because the world is full of people that think just like you, doesn't mean the other ones can't be right. 
From: Bruno Sanches <bcsanches@gm...>  20080207 13:42:42

I will verify that when I arrive at home, because thinking again, I belive my code at home is wrong, because now it makes sense why using the inverse matrix its works :). Two days investigating this and havent figured out this! So, it appears that for the view, I will need to use the invert matrix after fixing the code, thats weird to me, does anyone knows a tutorial / doc that explain the math behind view matrix? Thank you! Bruno Sanches On 2/7/08, Oscar Forth <oscar@...> wrote: > > Well either you wrote it twice wrong in your original mail ... or you > wrote it correctly both times. > > Anyway, I still think its because GL and DX matrices are transposes of > each other ... an invert of a simple rotation matrix is the transpose of > that matrix. > > View matrices are odd beasts ... they are not constructed like a standard > object matrix. They aren't interchangeable ... > > Hope thats some help. > > >  Original Message  > *From:* Bruno Sanches <bcsanches@...> > *To:* Game Development Algorithms<gdalgorithmslist@...> > *Sent:* Thursday, February 07, 2008 12:28 PM > *Subject:* Re: [Algorithms] Dummie Matrix math questions > > > Sorry Oscar, I typed it wrong when writing the email, the object code uses > the same code from camera to extract the axis. > > I am not sure if something with my math is wrong. The most strange for me > is that for the camera, when I get the fwd vector and use it to move the > camera, everything goes fine, but for objects, I need to get the fwd vector > from the inverse matrix. > > I am not understanding why I need to do that, because I was expecting the > camera to behave like any other object. > > Thank you > > Bruno Sanches > > > On 2/7/08, Oscar Forth <oscar@...> wrote: > > > > Sounds like the difference between GL and DX row/column ordering. > > > > Under DX it should be > > > > fwd.x = objectMatrix._11; > > fwd.y = objectMatrix._12; > > fwd.z = objectMatrix._13; > > > > Don't get confused by the two ... > > > > Sorry if thats a bit of a platform specific answer admins! > > > >  Original Message  > > *From:* Bruno Sanches <bcsanches@...> > > *To:* Game Development Algorithms<gdalgorithmslist@...> > > *Sent:* Thursday, February 07, 2008 12:07 PM > > *Subject:* [Algorithms] Dummie Matrix math questions > > > > > > > > Hello Folks, > > > > I am reading this list emails (and learning a lot) from some time and I > > would like to ask some help with basic 3d transformations that is giving a > > lot of headaches for me on last days (and nights)... > > > > On the framework that I am working (d3d9) I have a basic scene graph > > system, each node has a transformation matrix. > > > > On rendering, I have a code (pseudo code) like this: > > > > Vec3 fwd; > > > > fwd.x = cameraMatrix._11; > > fwd.y = cameraMatrix._21; > > fwd.z = cameraMatrix._31; > > > > //My coordinate system, x is forward, y is right, Z is up (right hand > > with Z pointing up) > > Vec3 origin = cameraOrigin; > > Vec3 at = origin + fwd; > > > > Vec3 up; > > up.x = cameraMatrix._13; > > up.x = cameraMatrix._23; > > up.x = cameraMatrix._33; > > > > D3DXMATRIX viewMat; > > D3DXMatrixLookAtRH(&viewMat, cameraOrigin, &at, &up); > > > > screen>SetViewTransform(viewMat); > > > > After setting up the camera transformation like above, I go rendering my > > objects: > > > > for each object > > { > > D3DXMATRIX mat = object.matrix; > > screen>SetWorldTransform(mat); > > > > DrawObject(); > > } > > > > And everything works fine. > > > > But, now I am trying to move a object forward, and this is where my > > problems start, for moving my objects, I do: > > > > void moveObject(float dist) > > { > > Vec3 fwd; > > > > fwd.x = objectMatrix._11; > > fwd.y = objectMatrix._21; > > fwd.z = objectMatrix._31; > > > > fwd *= dist; > > > > objectOrigin += fwd; > > } > > > > This appears to work, but I found out that the objects matrix appears to > > be inverted, they will move on very strange directions, if on the above > > function I use a invert matrix, everything works fine! I don't know what I > > am missing here, because I was expecting the above function to work without > > using the inverse matrix. > > > > I have similar code on opengl few years ago and it worked. Does anyone > > has any clue what is going on? Or at least, is this expected? :) > > > > Please note for all math, I am using d3dx math functions. > > > > Thank you for your help! > > > > Regards > > Bruno Sanches > > > >  > > > > > >  > > This SF.net email is sponsored by: Microsoft > > Defy all challenges. Microsoft(R) Visual Studio 2008. > > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > > > >  > > > > _______________________________________________ > > GDAlgorithmslist mailing list > > GDAlgorithmslist@... > > https://lists.sourceforge.net/lists/listinfo/gdalgorithmslist > > Archives: > > > > http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithmslist > > > > > > > >  > > This SF.net email is sponsored by: Microsoft > > Defy all challenges. Microsoft(R) Visual Studio 2008. > > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > > _______________________________________________ > > GDAlgorithmslist mailing list > > GDAlgorithmslist@... > > https://lists.sourceforge.net/lists/listinfo/gdalgorithmslist > > Archives: > > > > http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithmslist > > > >  > >  > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > >  > > _______________________________________________ > GDAlgorithmslist mailing list > GDAlgorithmslist@... > https://lists.sourceforge.net/lists/listinfo/gdalgorithmslist > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithmslist > > >  > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > GDAlgorithmslist mailing list > GDAlgorithmslist@... > https://lists.sourceforge.net/lists/listinfo/gdalgorithmslist > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithmslist > 
From: Oscar Forth <oscar@tr...>  20080207 12:32:41

Well either you wrote it twice wrong in your original mail ... or you wrote it correctly both times. Anyway, I still think its because GL and DX matrices are transposes of each other ... an invert of a simple rotation matrix is the transpose of that matrix. View matrices are odd beasts ... they are not constructed like a standard object matrix. They aren't interchangeable ... Hope thats some help.  Original Message  From: Bruno Sanches To: Game Development Algorithms Sent: Thursday, February 07, 2008 12:28 PM Subject: Re: [Algorithms] Dummie Matrix math questions Sorry Oscar, I typed it wrong when writing the email, the object code uses the same code from camera to extract the axis. I am not sure if something with my math is wrong. The most strange for me is that for the camera, when I get the fwd vector and use it to move the camera, everything goes fine, but for objects, I need to get the fwd vector from the inverse matrix. I am not understanding why I need to do that, because I was expecting the camera to behave like any other object. Thank you Bruno Sanches On 2/7/08, Oscar Forth <oscar@...> wrote: Sounds like the difference between GL and DX row/column ordering. Under DX it should be fwd.x = objectMatrix._11; fwd.y = objectMatrix._12; fwd.z = objectMatrix._13; Don't get confused by the two ... Sorry if thats a bit of a platform specific answer admins!  Original Message  From: Bruno Sanches To: Game Development Algorithms Sent: Thursday, February 07, 2008 12:07 PM Subject: [Algorithms] Dummie Matrix math questions Hello Folks, I am reading this list emails (and learning a lot) from some time and I would like to ask some help with basic 3d transformations that is giving a lot of headaches for me on last days (and nights)... On the framework that I am working (d3d9) I have a basic scene graph system, each node has a transformation matrix. On rendering, I have a code (pseudo code) like this: Vec3 fwd; fwd.x = cameraMatrix._11; fwd.y = cameraMatrix._21; fwd.z = cameraMatrix._31; //My coordinate system, x is forward, y is right, Z is up (right hand with Z pointing up) Vec3 origin = cameraOrigin; Vec3 at = origin + fwd; Vec3 up; up.x = cameraMatrix._13; up.x = cameraMatrix._23; up.x = cameraMatrix._33; D3DXMATRIX viewMat; D3DXMatrixLookAtRH(&viewMat, cameraOrigin, &at, &up); screen>SetViewTransform(viewMat); After setting up the camera transformation like above, I go rendering my objects: for each object { D3DXMATRIX mat = object.matrix; screen>SetWorldTransform(mat); DrawObject(); } And everything works fine. But, now I am trying to move a object forward, and this is where my problems start, for moving my objects, I do: void moveObject(float dist) { Vec3 fwd; fwd.x = objectMatrix._11; fwd.y = objectMatrix._21; fwd.z = objectMatrix._31; fwd *= dist; objectOrigin += fwd; } This appears to work, but I found out that the objects matrix appears to be inverted, they will move on very strange directions, if on the above function I use a invert matrix, everything works fine! I don't know what I am missing here, because I was expecting the above function to work without using the inverse matrix. I have similar code on opengl few years ago and it worked. Does anyone has any clue what is going on? Or at least, is this expected? :) Please note for all math, I am using d3dx math functions. Thank you for your help! Regards Bruno Sanches   This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/  _______________________________________________ GDAlgorithmslist mailing list GDAlgorithmslist@... https://lists.sourceforge.net/lists/listinfo/gdalgorithmslist Archives: http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithmslist  This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ GDAlgorithmslist mailing list GDAlgorithmslist@... https://lists.sourceforge.net/lists/listinfo/gdalgorithmslist Archives: http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithmslist   This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/  _______________________________________________ GDAlgorithmslist mailing list GDAlgorithmslist@... https://lists.sourceforge.net/lists/listinfo/gdalgorithmslist Archives: http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithmslist 
From: Bruno Sanches <bcsanches@gm...>  20080207 12:28:46

Sorry Oscar, I typed it wrong when writing the email, the object code uses the same code from camera to extract the axis. I am not sure if something with my math is wrong. The most strange for me is that for the camera, when I get the fwd vector and use it to move the camera, everything goes fine, but for objects, I need to get the fwd vector from the inverse matrix. I am not understanding why I need to do that, because I was expecting the camera to behave like any other object. Thank you Bruno Sanches On 2/7/08, Oscar Forth <oscar@...> wrote: > > Sounds like the difference between GL and DX row/column ordering. > > Under DX it should be > > fwd.x = objectMatrix._11; > fwd.y = objectMatrix._12; > fwd.z = objectMatrix._13; > > Don't get confused by the two ... > > Sorry if thats a bit of a platform specific answer admins! > >  Original Message  > *From:* Bruno Sanches <bcsanches@...> > *To:* Game Development Algorithms<gdalgorithmslist@...> > *Sent:* Thursday, February 07, 2008 12:07 PM > *Subject:* [Algorithms] Dummie Matrix math questions > > > > Hello Folks, > > I am reading this list emails (and learning a lot) from some time and I > would like to ask some help with basic 3d transformations that is giving a > lot of headaches for me on last days (and nights)... > > On the framework that I am working (d3d9) I have a basic scene graph > system, each node has a transformation matrix. > > On rendering, I have a code (pseudo code) like this: > > Vec3 fwd; > > fwd.x = cameraMatrix._11; > fwd.y = cameraMatrix._21; > fwd.z = cameraMatrix._31; > > //My coordinate system, x is forward, y is right, Z is up (right hand with > Z pointing up) > Vec3 origin = cameraOrigin; > Vec3 at = origin + fwd; > > Vec3 up; > up.x = cameraMatrix._13; > up.x = cameraMatrix._23; > up.x = cameraMatrix._33; > > D3DXMATRIX viewMat; > D3DXMatrixLookAtRH(&viewMat, cameraOrigin, &at, &up); > > screen>SetViewTransform(viewMat); > > After setting up the camera transformation like above, I go rendering my > objects: > > for each object > { > D3DXMATRIX mat = object.matrix; > screen>SetWorldTransform(mat); > > DrawObject(); > } > > And everything works fine. > > But, now I am trying to move a object forward, and this is where my > problems start, for moving my objects, I do: > > void moveObject(float dist) > { > Vec3 fwd; > > fwd.x = objectMatrix._11; > fwd.y = objectMatrix._21; > fwd.z = objectMatrix._31; > > fwd *= dist; > > objectOrigin += fwd; > } > > This appears to work, but I found out that the objects matrix appears to > be inverted, they will move on very strange directions, if on the above > function I use a invert matrix, everything works fine! I don't know what I > am missing here, because I was expecting the above function to work without > using the inverse matrix. > > I have similar code on opengl few years ago and it worked. Does anyone has > any clue what is going on? Or at least, is this expected? :) > > Please note for all math, I am using d3dx math functions. > > Thank you for your help! > > Regards > Bruno Sanches > >  > >  > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > >  > > _______________________________________________ > GDAlgorithmslist mailing list > GDAlgorithmslist@... > https://lists.sourceforge.net/lists/listinfo/gdalgorithmslist > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithmslist > > >  > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > GDAlgorithmslist mailing list > GDAlgorithmslist@... > https://lists.sourceforge.net/lists/listinfo/gdalgorithmslist > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithmslist > 
From: Oscar Forth <oscar@tr...>  20080207 12:13:40

Sounds like the difference between GL and DX row/column ordering. Under DX it should be fwd.x = objectMatrix._11; fwd.y = objectMatrix._12; fwd.z = objectMatrix._13; Don't get confused by the two ... Sorry if thats a bit of a platform specific answer admins!  Original Message  From: Bruno Sanches To: Game Development Algorithms Sent: Thursday, February 07, 2008 12:07 PM Subject: [Algorithms] Dummie Matrix math questions Hello Folks, I am reading this list emails (and learning a lot) from some time and I would like to ask some help with basic 3d transformations that is giving a lot of headaches for me on last days (and nights)... On the framework that I am working (d3d9) I have a basic scene graph system, each node has a transformation matrix. On rendering, I have a code (pseudo code) like this: Vec3 fwd; fwd.x = cameraMatrix._11; fwd.y = cameraMatrix._21; fwd.z = cameraMatrix._31; //My coordinate system, x is forward, y is right, Z is up (right hand with Z pointing up) Vec3 origin = cameraOrigin; Vec3 at = origin + fwd; Vec3 up; up.x = cameraMatrix._13; up.x = cameraMatrix._23; up.x = cameraMatrix._33; D3DXMATRIX viewMat; D3DXMatrixLookAtRH(&viewMat, cameraOrigin, &at, &up); screen>SetViewTransform(viewMat); After setting up the camera transformation like above, I go rendering my objects: for each object { D3DXMATRIX mat = object.matrix; screen>SetWorldTransform(mat); DrawObject(); } And everything works fine. But, now I am trying to move a object forward, and this is where my problems start, for moving my objects, I do: void moveObject(float dist) { Vec3 fwd; fwd.x = objectMatrix._11; fwd.y = objectMatrix._21; fwd.z = objectMatrix._31; fwd *= dist; objectOrigin += fwd; } This appears to work, but I found out that the objects matrix appears to be inverted, they will move on very strange directions, if on the above function I use a invert matrix, everything works fine! I don't know what I am missing here, because I was expecting the above function to work without using the inverse matrix. I have similar code on opengl few years ago and it worked. Does anyone has any clue what is going on? Or at least, is this expected? :) Please note for all math, I am using d3dx math functions. Thank you for your help! Regards Bruno Sanches   This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/  _______________________________________________ GDAlgorithmslist mailing list GDAlgorithmslist@... https://lists.sourceforge.net/lists/listinfo/gdalgorithmslist Archives: http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithmslist 
From: Bruno Sanches <bcsanches@gm...>  20080207 12:07:45

Hello Folks, I am reading this list emails (and learning a lot) from some time and I would like to ask some help with basic 3d transformations that is giving a lot of headaches for me on last days (and nights)... On the framework that I am working (d3d9) I have a basic scene graph system, each node has a transformation matrix. On rendering, I have a code (pseudo code) like this: Vec3 fwd; fwd.x = cameraMatrix._11; fwd.y = cameraMatrix._21; fwd.z = cameraMatrix._31; //My coordinate system, x is forward, y is right, Z is up (right hand with Z pointing up) Vec3 origin = cameraOrigin; Vec3 at = origin + fwd; Vec3 up; up.x = cameraMatrix._13; up.x = cameraMatrix._23; up.x = cameraMatrix._33; D3DXMATRIX viewMat; D3DXMatrixLookAtRH(&viewMat, cameraOrigin, &at, &up); screen>SetViewTransform(viewMat); After setting up the camera transformation like above, I go rendering my objects: for each object { D3DXMATRIX mat = object.matrix; screen>SetWorldTransform(mat); DrawObject(); } And everything works fine. But, now I am trying to move a object forward, and this is where my problems start, for moving my objects, I do: void moveObject(float dist) { Vec3 fwd; fwd.x = objectMatrix._11; fwd.y = objectMatrix._21; fwd.z = objectMatrix._31; fwd *= dist; objectOrigin += fwd; } This appears to work, but I found out that the objects matrix appears to be inverted, they will move on very strange directions, if on the above function I use a invert matrix, everything works fine! I don't know what I am missing here, because I was expecting the above function to work without using the inverse matrix. I have similar code on opengl few years ago and it worked. Does anyone has any clue what is going on? Or at least, is this expected? :) Please note for all math, I am using d3dx math functions. Thank you for your help! Regards Bruno Sanches 