- #1
GuillemVS
- 12
- 1
I don't know if this question suits this forum, I post this here actually because I saw (if not my memory is failing) that here it is also possible to solve math problems.
So, back on track:
I like to discover things from myself, so I searched for the Euler's formula, willing to find the forward of an object. And so I came up with the result that:
forward = (sin(yrot) * cos(xrot), sin(xrot), cos(xrot) * cos(yrot))
So then I wanted to get the absolute from any relative, not just from the forward (0, 0, 1). I thought that I could just simply convert from the forward to a rotation, such as (1,0,0) is (0,pi / 2, 0) in rotation, with the following formula:
xrot = asin(y)
yrot = asin(x / cos(asin(y))
There's no need for zrot since it doesn't change the vector of direction, but the perspective of the object (seen or seeing).
I know that this formula doesn't accurately pass from one and another (because sometimes the resulting rotation might be different for the same forward, so there's no harm in the actual value of the rotation).
So then I thought about adding this rotation to the actual rotation of the parent, in order so that it's like it's facing the child (it's forward now is it's child position). And then afterwards get the forward that would get the absolute position of the child.
But it didn't work, I don't know if I did something wrong, or if I thought of something that's not actually true or that this couldn't work in the first place.
I would like to know, may I ask, how can I do that and where did I misunderstood or misthought (is that a word?) about what I'm saying.
Thank you in advance.
So, back on track:
I like to discover things from myself, so I searched for the Euler's formula, willing to find the forward of an object. And so I came up with the result that:
forward = (sin(yrot) * cos(xrot), sin(xrot), cos(xrot) * cos(yrot))
So then I wanted to get the absolute from any relative, not just from the forward (0, 0, 1). I thought that I could just simply convert from the forward to a rotation, such as (1,0,0) is (0,pi / 2, 0) in rotation, with the following formula:
xrot = asin(y)
yrot = asin(x / cos(asin(y))
There's no need for zrot since it doesn't change the vector of direction, but the perspective of the object (seen or seeing).
I know that this formula doesn't accurately pass from one and another (because sometimes the resulting rotation might be different for the same forward, so there's no harm in the actual value of the rotation).
So then I thought about adding this rotation to the actual rotation of the parent, in order so that it's like it's facing the child (it's forward now is it's child position). And then afterwards get the forward that would get the absolute position of the child.
But it didn't work, I don't know if I did something wrong, or if I thought of something that's not actually true or that this couldn't work in the first place.
I would like to know, may I ask, how can I do that and where did I misunderstood or misthought (is that a word?) about what I'm saying.
Thank you in advance.