Need some help with code


RE: Need some help with code
#6
(2023-04-04, 23:30)Max Murtazin Wrote: I don't have any single-vector matrices. Each matrix I have is info of some type 1 line. 
All the tmp stuff, just checked, is some old unused code I accidentally left in (thought I removed it) — the function actually in use is ParseLine1, not ReplaceLine1

For accumulating transformation — each time I encounter a type 1 line, I tranform it using matrix from current function call, and then pass that transformed line as an argument to call of the function right after, thus transformation is, or at least meant to recursively accumulate — and then each time it gives to the parent call transformed data

What is really a problem, as I mentioned in first post, is that for whatever reason line type 1s are not being properly transformed properly, while 2 through 5 work fine. 
Maybe there really is something wrong with just using matrix multiplication, but that simply makes no sense to me — Vector3's transformation function should be doing exactly the same — matrix multiplication

I would step through it with a debugger or use print statements. Matrix decomposition is your friend for these types of problems. Apparently there's a Matrix4x4.Decompose function you can use. The overall process you described sounds right. Note that for matrices A,B it's not true in general that A*B == B*A. I would also check for needing to transpose or not transpose the results. This will be easy to detect if you decompose the matrix and check the translation vector. You can also decompose each line 1 transform to make sure it's initialized properly.
Reply
« Next Oldest | Next Newest »



Messages In This Thread
Need some help with code - by Max Murtazin - 2023-04-04, 19:26
RE: Need some help with code - by Jonathan N - 2023-04-04, 21:02
RE: Need some help with code - by Jonathan N - 2023-04-04, 22:26
RE: Need some help with code - by Jonathan N - 2023-04-04, 23:50

Forum Jump:


Users browsing this thread: 1 Guest(s)