Benjamin Danger Johnson

Dec 2, 2024 03:26
but the question I now have is why? Ideally I would like to come up with a general solution that could be easily mapped to a function like
destinationPostion, destinationQuaternionRotation, destinationScale = ConvertCoordinates(sourceUpAxis, sourceRightAxis, sourceForwardAxis, isSourceLeftHanded, destinationUpAxis, destinationRightAxis, destiantionForwardAxis, isDestinationLeftHanded, sourcePostion, sourceQuaternionRotation, sourceScale).
Dec 2, 2024 03:24
@NicholasTodoroff Okay, I did a bit more experimenting today. Unfortunately un-negating the directions did not work. I did however find that when using a 0 rotation, the UE project was off by +90 degrees in both Roll (X) and Yaw (Z). Using this observation I was able to get the correct rotation by first rotation by 90, 0, 90 and then by the Touch Designer quaternion. I've tested this with a few values now and it seems to be working fine so I am able to proceed with my work.
Nov 29, 2024 07:37
In unreal engine the rotation order is also x (pitch), y (yaw), and z (roll)
Nov 29, 2024 07:36
There should be some internal converion to Euler angles (or a Rotator in Unreal Engines case) but I don't know much about that myself.
Nov 29, 2024 07:36
and I assign that to a game object.
Nov 29, 2024 07:35
I then move the x, y, z, w values over to Unreal Engine and use the following code to format the quaternion:

FQuat(Rotation.Z, -Rotation.X, -Rotation.Y, Rotation.W);
Nov 29, 2024 07:35
I believe the rotation order is defined as x, y, z
Nov 29, 2024 07:34
Where the rotation in euler angles is defined as rx, ry, and rz.

pitch = math.radians(ry])
yaw = math.radians(rz)
roll = math.radians(rx)

cr = math.cos(roll * 0.5)
sr = math.sin(roll * 0.5)
cp = math.cos(pitch * 0.5)
sp = math.sin(pitch * 0.5)
cy = math.cos(yaw * 0.5)
sy = math.sin(yaw * 0.5)

w= cr * cp * cy + sr * sp * sy
x = sr * cp * cy - cr * sp * sy
y = cr * sp * cy + sr * cp * sy
z = cr * cp * sy - sr * sp * cy
Nov 29, 2024 07:33
Since I wasn't sure if this was correct, I brought in the earlier 321 euler -> quaternion function I linked. This code produces the same quaternion as the built in function.
Nov 29, 2024 07:32
In TouchDesigner I have a transform (position, rotation and scale). I convert that to a quaternion using and internal method.
Nov 29, 2024 07:32
So to clarify,
Nov 29, 2024 07:32
sorry about that. Let me know when you are online and we can talk.
Nov 29, 2024 07:00
sorry i have to walk away from the pc for a moment but I will be back.
Nov 29, 2024 06:53
Hey Nichiolas, thank you fro starting the chat. Please, let me know what information I can provide you with or any tests you need me to run.
Nov 29, 2024 06:43
I appreciate your help so far but I've been trying to figure this out for a good 6 hours today with no luck. I've been trying to use the quaternions genrated by TouchDesigner, sending the values to Unreal Engine, reshuffling them, and finally using the Unreal Engine quaternion to euler angle function but the result always seems off. It's basically off by 1 or 2 90 degree rotations every time. Do you have any idea what that might be, or can you update your answer to provide a more clear solution? I don't mean to sound ungrateful but I'm having a lot of trouble getting this to work.
Nov 29, 2024 06:43
I'm pretty sure you are correct about the quaternion generation in TouchDesigner. The issue I have is how can I convert the TouchDesigner Euler angle (or quaternion) into the UE. It looks like the quaternion formula you provided roughly matches the 3-2-1 algorithm on Wikipedia (en.wikipedia.org/wiki/…). Would it be safe to say I could follow the code given on this page, but negate all of the sine values to generate a convertable quaternion? Or would it have to be specific sines only? or am I just totally wrong with this approach?
Nov 29, 2024 06:43
I think I followed everything up to the creating a quaternion step. If I had to guess this sounds like where I am probably going wrong. I'll look into this a bit more and follow up with some questions if you don't mind me asking.
 
May 24, 2024 00:35
Is it possible to define $R=R_x(\Delta x) R_y(\Delta y) R_z(\Delta z) $ ($\Delta x$,$\Delta y$,$\Delta z$ is the base rotations around x,y and z axis (local axis parallel to world axis) ?
May 24, 2024 00:35
Thank you very much for answering. But, I'm wondering why you rotate z by $\phi, \beta$ (local axis) twice. Is $R$ the rotation matrix about the base rotation the object installed at? If $R$ is the rotation matrix about the base rotation, it's better for us to define $R$ as rotations around x,y, and z axis(local axis(however, they are parallel to the x, y, and z axis of the world axis.))and then set the order of rotation x → y → z, because our light operation software treats rotations in the same way.
May 24, 2024 00:35
And I want to confirm about $R_z(\beta)$. Is it a mistype as $R_x(\beta)$?
May 24, 2024 00:35
I'm trying to solve equation(2)(3)(4) with Newton-Raphson multi-variate method. But I don't know how to deal the unknown variable $p_0$ to calculate $\phi, \theta, \beta$ with the method. Whether should I deal it as constant value or variable, or substitute the final form of $p_0$$\left(p_0=R \left(\sum_{i=1}^{N} \left(I-u_i u_i^\top \right)\right)^{-1} \left(\sum_{i=0}^N \left(I-u_i u_i^\top \right)R^\top V_i \right)\right)$ for equation(2)(3)(4)?
May 24, 2024 00:35
@i-dont-know-what-i-am-doing Still sorry for the mistake, we really do appreciate all of your help so far. I'll let my coworker take over the responses from now, English is his second language (Japanese is the first) so please bear with him if something is worded in a strange way or if anything comes across as a bit rude rude.
May 24, 2024 00:35
@i-dont-know-what-i-am-doing Sorry about that, that is my fault. I am actually letting a coworker of mine use my account (he is much more skilled in math than I am and can understand the problem much better). That is my fault for forgetting about website etiquette, I should have up-voted before I passed on the task. Thank you for pointing that out and thank you for all your help so far.
May 24, 2024 00:35
And I have one more question about the part "E=∑_(i=1) N(V_i−p_0)^T(I−(R u_i)(R u_i)^T)(V_i−p_0)" above equation(1). How would you have derived this equation?
May 24, 2024 00:35
I appreciate your update. I have one question. Can you provide additional information on what the V means?
May 24, 2024 00:35
@Hosam_Hajeer Thanks again for your work on this, unfortunately I was not able to get your solution working. The main stumbling point for me is the law of cosines and solving for s1, s2, and s3. I tried using a few different math libraries but nothing was able to solve for these variables with the information given.
May 24, 2024 00:35
If you can provide those functions as well I would really appreciate it. I'm actually pretty stumped with this VBA script myself. It took a while to figure out that Dim points(3,3) As Double was actually creating a 4x4 matrix of doubles. I tried a couple of online converters but they seem to be very inconsistent. But I'll keep trying, if it works on your end the code must be valid, so now I just need to figure out how to translate it.
May 24, 2024 00:35
Thank for adding the VBA code but it looks like it calls a bunch of functions that are not built into VBA such as rd_xyz_1. Are these from some plugin or were they not included.
May 24, 2024 00:35
Thank you for the answer. I'll try testing this out tomorrow morning but it might take me some time since I am not very familiar with this math and I need to translate it into python. I also noticed a small typo with the cross produce of (p1-p2)x(p1-p3), at least I think I did. If you know how to translate this into code that would be greatly appreciated but I can take a crack at it myself tomorrow.
 

 Game Development

Game development and other polite discussion. Game development...
Apr 11, 2021 06:50
I think I will leave this chat room for a few days until it returns to a game development chat room.
Apr 11, 2021 03:30
I hope we can continue to talk about game development and other fun game topics.
Apr 11, 2021 03:30
I see my shopping photos brought a not fun conversation.
Apr 11, 2021 03:30
Good morning.
Apr 10, 2021 14:15
Apr 10, 2021 14:15
Apr 10, 2021 14:12
I hope you are all having a good evening. I had a fun day out looking at vintage game stores.
Apr 10, 2021 03:48
Very satisfying when something works on the first try. Now I can enjoy my weekend of programing non-work projects.
Apr 10, 2021 01:23
but when a deadline is close we will work extra and take a short holiday after the project.
Apr 10, 2021 01:23
normally we work 5 days each week, 10:30 to 7:30 on salary.
Apr 10, 2021 01:22
it depends on the project. This case is unusual because we are short 1 employee
Apr 10, 2021 01:22
ah sorry the question changed.
Apr 10, 2021 01:22
of course.
Apr 10, 2021 01:21
My current one has decided to leave the company so we I need to find a replacement soon.
Apr 10, 2021 01:21
I also need to make a job application for a new underling.
Apr 10, 2021 01:20
My boss wants some new shader for our next project
Apr 10, 2021 01:20
It is but unfortunately I am working today.
Apr 10, 2021 01:10
good morning
Apr 9, 2021 14:14
I imagine you could do some very interesting RTS or turnbased AI with it.
Apr 9, 2021 13:57
You could probably make something like the games from Zaktronics
Apr 9, 2021 13:57
why not just work on a game that uses CA?