Skip to main content
Tweeted twitter.com/StackGameDev/status/871652354889842688
grammar and punctuation; converted video to inline animation
Source Link
Gnemlock
  • 5.3k
  • 5
  • 28
  • 59

Child Objects and World Pitch How do I maintain the world pitch, Rollroll or Yawyaw of child objects?

I've got an application where I'm trying to showdisplay an object in 3D, with information provided by real-world accelerometers and inclinometers - sensors that pick up the angle of the equipment relative to ground, relative to ground.

  The trouble comes from when I want to show this 'world pitch' or 'world roll' on an object that is a child of another.

  I'd think that there is a trivial solution to the problem...but I can't, but for the life of me, I can't figure out what it is.

Let's say I've got a robot arm with several pieces - "LowerArm", "Elbow", "UpperArm" and "Hand". The hand"Hand" is the child of the UpperArm"UpperArm", Upperarmand "UpperArm" is the child of the Elbow etc"Elbow".

What I'd like to do is place 'hand'"Hand" at 0 degreesdegree pitch relative to world-space, relative to world-space, no matter how I move the parent objects. So ifIf I grab my "LowerArm", and rotate it 90 degrees, the hand isshould still lay 'flat', relative to the ground ( butground; in local coordinate space has, it should moved 90 degrees, to compensate. )

However, I want it to remain attached,attached; so it should continue to follow the other parts, in terms of roll and yaw. IE. ifIf I twisttwist the arm, the hand twists with everything else - it just maintains that 0-degree degree world pitch.

You can find an illustration of Observe the problem here - https://www.youtube.com/watch?v=3tyhJgjfqNsyellow object, in the below example:

In the video, I'm talking about the yellow object.enter image description here

Does anyone have any suggestions of how IHow can I do this? I would have thought that there was some kind of trick, with matriciesmatrices or quaternions, that could resolve it,it; but I've had no luck, so far. It's hard to figure out what the new 'forward' vector should be.

Child Objects and World Pitch, Roll or Yaw

I've got an application where I'm trying to show an object in 3D with information provided by real-world accelerometers and inclinometers - sensors that pick up the angle of the equipment relative to ground.

  The trouble comes from when I want to show this 'world pitch' or 'world roll' on an object that is a child of another.

  I'd think that there is a trivial solution to the problem...but I can't for the life of me figure out what it is.

Let's say I've got a robot arm with several pieces - "LowerArm", "Elbow", "UpperArm" and "Hand". The hand is the child of the UpperArm, Upperarm the child of the Elbow etc.

What I'd like to do is place 'hand' at 0 degrees pitch relative to world-space, no matter how I move the parent objects. So if I grab my "LowerArm" and rotate it 90 degrees, the hand is still 'flat' relative to the ground ( but in local coordinate space has moved 90 degrees to compensate. )

However, I want it to remain attached, so it should continue to follow the other parts in terms of roll and yaw. IE. if I twist the arm, the hand twists with everything else - it just maintains that 0-degree world pitch.

You can find an illustration of the problem here - https://www.youtube.com/watch?v=3tyhJgjfqNs

In the video, I'm talking about the yellow object.

Does anyone have any suggestions of how I can do this? I would have thought that there was some kind of trick with matricies or quaternions that could resolve it, but I've had no luck so far. It's hard to figure out what the new 'forward' vector should be.

How do I maintain the world pitch, roll or yaw of child objects?

I've got an application where I'm trying to display an object in 3D, with information provided by real-world accelerometers and inclinometers - sensors that pick up the angle of the equipment, relative to ground. The trouble comes when I want to show this 'world pitch' or 'world roll' on an object that is a child of another. I'd think that there is a trivial solution to the problem, but for the life of me, I can't figure out what it is.

Let's say I've got a robot arm with several pieces - "LowerArm", "Elbow", "UpperArm" and "Hand". "Hand" is the child of the "UpperArm", and "UpperArm" is the child of "Elbow". I'd like to place "Hand" at 0 degree pitch, relative to world-space, no matter how I move the parent objects. If I grab my "LowerArm", and rotate it 90 degrees, the hand should still lay 'flat', relative to the ground; in local coordinate space, it should moved 90 degrees, to compensate.

I want it to remain attached; so it should continue to follow the other parts, in terms of roll and yaw. If I twist the arm, the hand twists with everything else - it just maintains that 0 degree world pitch. Observe the yellow object, in the below example:

enter image description here

How can I do this? I would have thought that there was some kind of trick, with matrices or quaternions, that could resolve it; but I've had no luck, so far. It's hard to figure out what the new 'forward' vector should be.

Source Link

Child Objects and World Pitch, Roll or Yaw

I've got an application where I'm trying to show an object in 3D with information provided by real-world accelerometers and inclinometers - sensors that pick up the angle of the equipment relative to ground.

The trouble comes from when I want to show this 'world pitch' or 'world roll' on an object that is a child of another.

I'd think that there is a trivial solution to the problem...but I can't for the life of me figure out what it is.

Let's say I've got a robot arm with several pieces - "LowerArm", "Elbow", "UpperArm" and "Hand". The hand is the child of the UpperArm, Upperarm the child of the Elbow etc.

What I'd like to do is place 'hand' at 0 degrees pitch relative to world-space, no matter how I move the parent objects. So if I grab my "LowerArm" and rotate it 90 degrees, the hand is still 'flat' relative to the ground ( but in local coordinate space has moved 90 degrees to compensate. )

However, I want it to remain attached, so it should continue to follow the other parts in terms of roll and yaw. IE. if I twist the arm, the hand twists with everything else - it just maintains that 0-degree world pitch.

You can find an illustration of the problem here - https://www.youtube.com/watch?v=3tyhJgjfqNs

In the video, I'm talking about the yellow object.

Does anyone have any suggestions of how I can do this? I would have thought that there was some kind of trick with matricies or quaternions that could resolve it, but I've had no luck so far. It's hard to figure out what the new 'forward' vector should be.