I am facing an issue.
I want that if the user places an object which should not be placed in the horizontal plane then it will restrict the user from placing the thing.
I have tried to restrict it after consider the world transform matrix from the singleHitTestResult but unable to it
`Future onPlaneOrPointTapped(
List hitTestResults) async {
var singleHitTestResult = hitTestResults.firstWhere(
(hitTestResult) => hitTestResult.type == ARHitTestResultType.plane);
if (singleHitTestResult != null) {
var newAnchor =
ARPlaneAnchor(transformation: singleHitTestResult.worldTransform);
final worldTransform = singleHitTestResult.worldTransform;
// Extract the rotation components from the world transform matrix
final rotationMatrix = worldTransform.getRotation();
final rotationQuaternion =
vector.Quaternion.fromRotation(rotationMatrix).axis;
print("roation: $rotationQuaternion");
if (rotationQuaternion[0] > 0) {
//create the anchor
// then add the object in the anchor
I am facing an issue. I want that if the user places an object which should not be placed in the horizontal plane then it will restrict the user from placing the thing. I have tried to restrict it after consider the world transform matrix from the singleHitTestResult but unable to it
`Future onPlaneOrPointTapped(
List hitTestResults) async {
var singleHitTestResult = hitTestResults.firstWhere(
(hitTestResult) => hitTestResult.type == ARHitTestResultType.plane);
} '
can anyone help me to solve this issue