1
\$\begingroup\$
cube [[ 1. 0. 0. 6.] [ 0. 1. 0. 0.] [ 0. 0. 1. 0.] [ 0. 0. 0. 1.]] view [[1. 0. 0. 0.] [0. 1. 0. 0.] [0. 0. 1. 0.] [0. 0. 0. 1.]] final [[ 1. 0. 0. 6.] [ 0. 1. 0. 0.] [ 0. 0. 1. 0.] [ 0. 0. 0. 1.]] 

Hello! I have a cube and I'm trying to move it around. The above are the calculated matricies for the cube, viewport, and the combined matrix after multiplication. The result is this:

enter image description here

I'm not sure why it's being warped like this instead of scooting over a bit. Any idea?

\$\endgroup\$
0

1 Answer 1

2
\$\begingroup\$

Your matrix is row major, so you should transpose it in order to get behaviour you expect, since OpenGL memory layout is more column-major friendly, because translation is located in the memory at the fourth vector of the 4x4 matrix.

\$\endgroup\$
1
  • \$\begingroup\$ You're a legend, can't believe I didn't think to try that. \$\endgroup\$ Commented Jul 5, 2019 at 20:24

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.