How to get the absolute position of a relative object?

Click For Summary

Discussion Overview

The discussion revolves around determining the absolute position of a relative object in a 3D coordinate system, particularly focusing on the relationship between an object's orientation and its forward direction vector. Participants explore concepts related to Euler's formula, rotation, and coordinate systems, with an emphasis on understanding how to derive the absolute position of a child object relative to a parent object.

Discussion Character

  • Exploratory
  • Technical explanation
  • Conceptual clarification
  • Debate/contested

Main Points Raised

  • One participant presents a formula for calculating the forward direction of an object based on its rotation angles, suggesting a method to derive absolute positions from relative ones.
  • Another participant questions the clarity of the original question, asking for definitions of terms like "forward" and the coordinate system being used.
  • Some participants introduce the concept of Frenet-Serret equations as potentially relevant to the discussion.
  • A participant clarifies that "forward" refers to a direction vector and provides examples of how forward and right vectors change with rotation.
  • There is a discussion about the distinction between "orientation" and "rotation," with suggestions to use terms like roll, pitch, and yaw to describe orientation in a 3D space.
  • One participant expresses confusion about the failure of their method and seeks guidance on where they might have misunderstood the concepts involved.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the best approach to determine the absolute position of a relative object. There are multiple competing views regarding the definitions and methods to be used, and the discussion remains unresolved.

Contextual Notes

Participants mention various coordinate systems and methods for expressing orientation, including Euler angles and quaternions, but do not settle on a single framework. There are also indications of missing assumptions regarding the relationships between the vectors and rotations discussed.

GuillemVS
Messages
12
Reaction score
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.
 
Mathematics news on Phys.org
Hello and :welcome: !

It is hard to parse what you want to know. What is a forward? I mean, except of a football position. Maybe you should start and say what you want to do, what you have, and where you want to end up. Obviously you have a kind of coordinate system. Which one? And which dimension? I read x and y, but also points with three coordinates.
 
fresh_42 said:
Hello and :welcome: !

It is hard to parse what you want to know. What is a forward? I mean, except of a football position. Maybe you should start and say what you want to do, what you have, and where you want to end up. Obviously you have a kind of coordinate system. Which one? And which dimension? I read x and y, but also points with three coordinates.
Hello, and thank you!

A forward is a direction vector of an object. For example:
If an object has this rotation (0,0,0) the forward will be (0,0,1) and the right will be (1,0,0).

We can understand the forward as a child element that is in (0,0,1) position relative to the parent, that when the parent rotates (and the child with it) we get the absolute position of the child and we get the forward vector of the parent. For example:
If the parent has this rotation (0,pi / 2, 0) the forward will be (1,0,0) and the right will be (0,0,-1).

What I wanted to do, is not only to get the forward (where child position is (0,0,1)) I want to get any absolute position of a child, not only forward or right.

So, as I explained before, I thought about passing from the child position to a rotation of the parent (such as (1,0,0) is (0,pi / 2,0)) and then adding it to the actual parent rotation (so that if the parent was looking at (0,0,0) now is at (0,pi / 2,0)) now the parent forward should/would be the position of the child (if we get the forward now from (0, pi / 2, 0) we get that the position absolute of the child is (1,0,0), in this example the parent rotation wasn't changed in the beginning, that's why the right (this vector) stays the same).

But I don't know why it didn't work, and I want to get a clue about it.
 
GuillemVS said:
If an object has this rotation (0,0,0) the forward will be (0,0,1) and the right will be (1,0,0).
Please slow down and start over.

An object has an "orientation", not a "rotation". That orientation can be expressed as a three-tuple in a variety of ways. One common way would be (roll, pitch, yaw). What scheme do you have in mind?
 
jbriggs444 said:
Please slow down and start over.

An object has an "orientation", not a "rotation". That orientation can be expressed as a three-tuple in a variety of ways. One common way would be (roll, pitch, yaw). What scheme do you have in mind?
Sorry! I'm supposing that you are supposing things that you can't.

So, (roll, pitch, yaw) we could say that they change these axis in this order (z, y, x). What I'm using right now is (x, y, z) the changing of axis.
I have been working with 3D Engines and that's why I use the word rotation (it's the term used) and the orientation is usually expressed as Quaternion that we define using Eulers(x, y, z).

Also when I talk about the forward and the right are just Vectors of position, not any rotation/orientation.

First post, I will need to be more precise in the future ^^
 

Similar threads

  • · Replies 51 ·
2
Replies
51
Views
5K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 6 ·
Replies
6
Views
4K
  • · Replies 57 ·
2
Replies
57
Views
3K
  • · Replies 35 ·
2
Replies
35
Views
4K
  • · Replies 5 ·
Replies
5
Views
2K