rbdl / rbdl-toolkit

Application for visualizing and working with rbdl models
European Union Public License 1.2
19 stars 11 forks source link

Flying links #21

Closed jfslin closed 3 years ago

jfslin commented 3 years ago

This is an interesting one. Using

rod_length = 1

meshes = {
  rod1 = {
    color = { 1, 0, 0},
    mesh_center = {0, 0, -rod_length/2},
    dimensions = { 0.2, 0.2, rod_length},
    src = "unit_cube.obj"
  }
}

model = {
  configuration = {
    axis_right = { 1, 0, 0 },
    axis_front = { 0, 1, 0 },
    axis_up =    { 0, 0, 1 },
  },

  frames = {
    {
      name = "segment1",
      parent = "ROOT",
      visuals = { meshes.rod1 },
      joint = {{ 0, 1, 0, 0, 0, 0 }},
      joint_frame = {
        E = {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}}
      }
    }
  }
}

return model

and

0, 0
1, 1.57
2, 3.14
3, 4.73
4, 6.28

I get a normal looking render. However, if I change to E = {{1, 0, 0}, {0, -1, 0}, {0, 0, 1}}, not only does it not flip the axis rotation, the limb also flies into the screen. It looks like E doesn't like a flip from right hand rotations to left hand rotations.

https://user-images.githubusercontent.com/24707634/107698944-53f4cd80-6c83-11eb-90f7-f92ee95f78d5.mp4

https://user-images.githubusercontent.com/24707634/107698928-4fc8b000-6c83-11eb-8a9e-ea6a273bbc97.mp4

jfslin commented 3 years ago

So I'm wondering if this issue is because the configuration axis I used was inappropriate (#22), and so OpenGL messes up the rendering. I'll close this issue for now and will reopen if I see it again.