Open parmandorc opened 7 years ago
The following code draws the axis twice - the second time after rotating 30 degrees on the Y axis, and then translating along the (local) X axis.
mat4t mat; mat.loadIdentity(); app_scene->add_shape(mat, new mesh_box(vec3(5.0f, 0.1f, 0.1f)), red, false); app_scene->add_shape(mat, new mesh_box(vec3(0.1f, 5.0f, 0.1f)), green, false); app_scene->add_shape(mat, new mesh_box(vec3(0.1f, 0.1f, 5.0f)), blue, false); mat.rotateY(30); mat.translate(1, 0, 0); app_scene->add_shape(mat, new mesh_box(vec3(2.0f, 0.1f, 0.1f)), red, false); app_scene->add_shape(mat, new mesh_box(vec3(0.1f, 2.0f, 0.1f)), green, false); app_scene->add_shape(mat, new mesh_box(vec3(0.1f, 0.1f, 2.0f)), blue, false);
It looks like this:
When it should look like this:
The position of the object is correct, but its orientation is as if the rotation had been in the opposite direction.
The following code draws the axis twice - the second time after rotating 30 degrees on the Y axis, and then translating along the (local) X axis.
It looks like this:
When it should look like this:
The position of the object is correct, but its orientation is as if the rotation had been in the opposite direction.