Skip to content

Problem when rotating an object #247

@ricarthlima

Description

@ricarthlima

Good morning,

I'm having an issue rotating an anchored object on a plane without using gestures. Somehow, it seems that the object always remains fixed or tries to return to its original position, making a stumble effect.

You can check out the full code in the Gist.

Below is the rotation function code:

rotate() {
  // attempt 1
  final currentRotation = _placedObject!.eulerAngles;
  final newRotation = Vector3(
    currentRotation.x,
    currentRotation.y + 15,
    currentRotation.z,
  );
  _placedObject!.eulerAngles = newRotation;

  // attempt 2
  // Matrix4 newMatrix = Matrix4.copy(_placedObject!.transform);
  // newMatrix *= Matrix4.rotationY(radians(10));
  // _placedObject!.transform = newMatrix;

  // attempt 3
  // if (_placedObject != null) {
  //   _placedObject!.rotation.setRotationY(0.9);
  // }

  print("EulerAngles: ${_placedObject!.eulerAngles}");
  print("Rotation: ${_placedObject!.rotation}");
  print("Transform: ${_placedObject!.transform}");
}

I've tried multiple rotation methods, as shown above. What's peculiar is that all attempts seem to have the same outcome, as demonstrated in this video:

issue_rotation.mp4

I've been struggling with this issue for a few days, and no solution has worked so far :(

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions