Oh no, not this topic again: LH vs. RH.

Started by
21 comments, last by DwarvesH 10 years ago

I would opt for RH and RM , Im doing this in my software rasterizer so i can chose it myself - sometimes this kind of decissions are hard to chose but this two I seem to be quite sure

ps could somebody maybe someone said to me how opengl and direct x storages such kind of matrix i would be probably using in my softrasterizer

xdir_x, xdir_y, xdir_z

ydir_x, ydir_y, ydir_z

zdir_x, zdir_y, zdir_z

?

xdir is local x-vector in the model space,

same wyth ydir, zdir, matrix describes the

orientation of the model inthe global space

should i really add position to it

xdir_x, xdir_y, xdir_z

ydir_x, ydir_y, ydir_z

zdir_x, zdir_y, zdir_z

pos_x, pos_y, pos_z
or better to handle it seperately?
if i use such matrix for camera orientation too
(in the camera case it would be expilcite
camera orientation:
1, 0, 0
0,1,0
0,0,-1
camera position:
0,0,1000
(i mean camera is +1000 on z axis and facing toward 0,0,0)
need i just multiply model matrix by this camera matrix
should i use some matrix for projection to 2d too? how it would look like?
Advertisement


I think the key part of what Buckeye said is " as commonly implemented". but no, you should not need to swap matrix multiplication order for handedness, only for majorness, as Mona2000 mentioned. The only real place that handedness matters is in the projection transform, or how our mapping of the 3D vector space is converted to 2D

Not even majorness matters. What determines whether the vector goes on the left or the right hand side of the matrix depends on whether you use row or column vectors and nothing else. A column vector cannot go anywhere but on the right hand side, and a row vector cannot go anywhere but on the left hand side of a multiplication with a matrix, and majorness or handedness are irrelevant.

Touche, I was just so excited that I could 1up on Buck's post that I used the wrong vocabulary. Mathematically you are correct, of course, but depending on how the multiplication is implemented in code, the majorness could effect the product, which I think is what what LSpiro and Hodgman discuss above.

Wow, some discussion! I did not know about the row/column major distinction and multiplication order, but it makes sense. So there where no votes for LH... I started the port to RH and the progress is fast because I switched from RH to LH only a few month ago :). But the good news is that generally my happiness level went up when working with RH. I'll never touch LH again unless forced.

This topic is closed to new replies.

Advertisement